[Validator] add deprecation log (#12674)

This commit is contained in:
Maximilian Reichel 2014-11-29 14:07:38 +01:00 committed by Maximilian Reichel
parent 4e6b74bb00
commit 2e47b62017
2 changed files with 6 additions and 0 deletions

View File

@ -52,6 +52,8 @@ class LegacyValidator extends RecursiveValidator implements LegacyValidatorInter
return parent::validate($value, $constraints, $groups); return parent::validate($value, $constraints, $groups);
} }
trigger_error('ValidatorInterface::validate() was deprecated in version 2.5 and will be removed in version 3.0. Please use Validator\\ValidatorInterface::validate() instead.', E_USER_DEPRECATED);
$constraint = new Valid(array('traverse' => $traverse, 'deep' => $deep)); $constraint = new Valid(array('traverse' => $traverse, 'deep' => $deep));
return parent::validate($value, $constraint, $groups); return parent::validate($value, $constraint, $groups);
@ -59,6 +61,8 @@ class LegacyValidator extends RecursiveValidator implements LegacyValidatorInter
public function validateValue($value, $constraints, $groups = null) public function validateValue($value, $constraints, $groups = null)
{ {
trigger_error('ValidatorInterface::validateValue() was deprecated in version 2.5 and will be removed in version 3.0. Please use Validator\\ValidatorInterface::validate() instead.', E_USER_DEPRECATED);
return parent::validate($value, $constraints, $groups); return parent::validate($value, $constraints, $groups);
} }

View File

@ -11,6 +11,8 @@
namespace Symfony\Component\Validator; namespace Symfony\Component\Validator;
trigger_error('ValidatorInterface was deprecated in version 2.5 and will be removed in version 3.0. Please use Validator\\ValidatorInterface instead.', E_USER_DEPRECATED);
/** /**
* Validates values and graphs of objects and arrays. * Validates values and graphs of objects and arrays.
* *