diff --git a/src/Forms/FieldsValidator.php b/src/Forms/FieldsValidator.php index 0de96225fdf..81a2ee9df0f 100644 --- a/src/Forms/FieldsValidator.php +++ b/src/Forms/FieldsValidator.php @@ -2,11 +2,22 @@ namespace SilverStripe\Forms; +use SilverStripe\Dev\Deprecation; + /** * Validates the internal state of all fields in the form. */ class FieldsValidator extends Validator { + /** + * @deprecated 5.4.0 Will be renamed to SilverStripe\Forms\FormFieldsValidator + */ + public function __construct() + { + Deprecation::noticeWithNoReplacment('5.4.0', 'Will be renamed to SilverStripe\\Forms\\FieldsValidator', Deprecation::SCOPE_CLASS); + parent::__construct(); + } + public function php($data): bool { $valid = true; diff --git a/src/Forms/RequiredFields.php b/src/Forms/RequiredFields.php index 3f0e055c0b7..4d473b232ba 100644 --- a/src/Forms/RequiredFields.php +++ b/src/Forms/RequiredFields.php @@ -3,6 +3,7 @@ namespace SilverStripe\Forms; use SilverStripe\ORM\ArrayLib; +use SilverStripe\Dev\Deprecation; /** * Required Fields allows you to set which fields need to be present before @@ -25,9 +26,12 @@ class RequiredFields extends Validator /** * Pass each field to be validated as a separate argument to the constructor * of this object. (an array of elements are ok). + * + * @deprecated 5.4.0 Will be renamed to SilverStripe\Forms\RequiredFieldsValidator */ public function __construct() { + Deprecation::noticeWithNoReplacment('5.4.0', 'Will be renamed to SilverStripe\\Forms\\RequiredFieldsValidator', Deprecation::SCOPE_CLASS); $required = func_get_args(); if (isset($required[0]) && is_array($required[0])) { $required = $required[0];