[Validator] Deprecated PHP7-incompatible constraints and related validators

This commit is contained in:
Nicolas Grekas 2015-05-15 12:05:21 +02:00
parent 8622a7b22a
commit a3fc6b9fa9
8 changed files with 25 additions and 6 deletions

View File

@ -528,3 +528,9 @@ Config
* The `__toString()` method of the `\Symfony\Component\Config\ConfigCache` is marked as
deprecated in favor of the new `getPath()` method.
Validator
---------
* The PHP7-incompatible constraints (Null, True, False) and related validators
(NullValidator, TrueValidator, FalseValidator) are marked as deprecated
in favor of their `Is`-prefixed equivalent.

View File

@ -5,6 +5,7 @@ CHANGELOG
-----
* deprecated `DefaultTranslator` in favor of `Symfony\Component\Translation\IdentityTranslator`
* deprecated PHP7-incompatible constraints (Null, True, False) and related validators (NullValidator, TrueValidator, FalseValidator) in favor of their `Is`-prefixed equivalent
2.6.0
-----

View File

@ -11,12 +11,14 @@
namespace Symfony\Component\Validator\Constraints;
trigger_error('The '.__NAMESPACE__.'\False class is deprecated since version 2.7 and will be removed in 3.0. Use the IsFalse class in the same namespace instead.', E_USER_DEPRECATED);
/**
* @Annotation
* @Target({"PROPERTY", "METHOD", "ANNOTATION"})
*
* @author Bernhard Schussek <bschussek@gmail.com>
*
* @api
* @deprecated since version 2.7, to be removed in 3.0. Use IsFalse instead.
*/
class False extends IsFalse {}

View File

@ -11,9 +11,11 @@
namespace Symfony\Component\Validator\Constraints;
trigger_error('The '.__NAMESPACE__.'\FalseValidator class is deprecated since version 2.7 and will be removed in 3.0. Use the IsFalseValidator class in the same namespace instead.', E_USER_DEPRECATED);
/**
* @author Bernhard Schussek <bschussek@gmail.com>
*
* @api
* @deprecated since version 2.7, to be removed in 3.0. Use IsFalseValidator instead.
*/
class FalseValidator extends IsFalseValidator {}

View File

@ -11,12 +11,14 @@
namespace Symfony\Component\Validator\Constraints;
trigger_error('The '.__NAMESPACE__.'\Null class is deprecated since version 2.7 and will be removed in 3.0. Use the IsNull class in the same namespace instead.', E_USER_DEPRECATED);
/**
* @Annotation
* @Target({"PROPERTY", "METHOD", "ANNOTATION"})
*
* @author Bernhard Schussek <bschussek@gmail.com>
*
* @api
* @deprecated since version 2.7, to be removed in 3.0. Use IsNull instead.
*/
class Null extends IsNull {}

View File

@ -11,9 +11,11 @@
namespace Symfony\Component\Validator\Constraints;
trigger_error('The '.__NAMESPACE__.'\NullValidator class is deprecated since version 2.7 and will be removed in 3.0. Use the IsNullValidator class in the same namespace instead.', E_USER_DEPRECATED);
/**
* @author Bernhard Schussek <bschussek@gmail.com>
*
* @api
* @deprecated since version 2.7, to be removed in 3.0. Use IsNullValidator instead.
*/
class NullValidator extends IsNullValidator {}

View File

@ -11,12 +11,14 @@
namespace Symfony\Component\Validator\Constraints;
trigger_error('The '.__NAMESPACE__.'\True class is deprecated since version 2.7 and will be removed in 3.0. Use the IsTrue class in the same namespace instead.', E_USER_DEPRECATED);
/**
* @Annotation
* @Target({"PROPERTY", "METHOD", "ANNOTATION"})
*
* @author Bernhard Schussek <bschussek@gmail.com>
*
* @api
* @deprecated since version 2.7, to be removed in 3.0. Use IsTrue instead.
*/
class True extends IsTrue {}

View File

@ -11,9 +11,11 @@
namespace Symfony\Component\Validator\Constraints;
trigger_error('The '.__NAMESPACE__.'\TrueValidator class is deprecated since version 2.7 and will be removed in 3.0. Use the IsTrueValidator class in the same namespace instead.', E_USER_DEPRECATED);
/**
* @author Bernhard Schussek <bschussek@gmail.com>
*
* @api
* @deprecated since version 2.7, to be removed in 3.0. Use IsTrueValidator instead.
*/
class TrueValidator extends IsTrueValidator {}