diff --git a/UPGRADE-2.7.md b/UPGRADE-2.7.md index f491c7d471..7d532cf322 100644 --- a/UPGRADE-2.7.md +++ b/UPGRADE-2.7.md @@ -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. diff --git a/src/Symfony/Component/Validator/CHANGELOG.md b/src/Symfony/Component/Validator/CHANGELOG.md index db44225058..4531286fdb 100644 --- a/src/Symfony/Component/Validator/CHANGELOG.md +++ b/src/Symfony/Component/Validator/CHANGELOG.md @@ -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 ----- diff --git a/src/Symfony/Component/Validator/Constraints/False.php b/src/Symfony/Component/Validator/Constraints/False.php index 6ec76ee3d1..9e9f6ed3d2 100644 --- a/src/Symfony/Component/Validator/Constraints/False.php +++ b/src/Symfony/Component/Validator/Constraints/False.php @@ -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 * - * @api + * @deprecated since version 2.7, to be removed in 3.0. Use IsFalse instead. */ class False extends IsFalse {} diff --git a/src/Symfony/Component/Validator/Constraints/FalseValidator.php b/src/Symfony/Component/Validator/Constraints/FalseValidator.php index 72fd1d44d1..534400e9c6 100644 --- a/src/Symfony/Component/Validator/Constraints/FalseValidator.php +++ b/src/Symfony/Component/Validator/Constraints/FalseValidator.php @@ -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 * - * @api + * @deprecated since version 2.7, to be removed in 3.0. Use IsFalseValidator instead. */ class FalseValidator extends IsFalseValidator {} diff --git a/src/Symfony/Component/Validator/Constraints/Null.php b/src/Symfony/Component/Validator/Constraints/Null.php index 5ad789cef8..1031b482cd 100644 --- a/src/Symfony/Component/Validator/Constraints/Null.php +++ b/src/Symfony/Component/Validator/Constraints/Null.php @@ -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 * - * @api + * @deprecated since version 2.7, to be removed in 3.0. Use IsNull instead. */ class Null extends IsNull {} diff --git a/src/Symfony/Component/Validator/Constraints/NullValidator.php b/src/Symfony/Component/Validator/Constraints/NullValidator.php index 876924f375..721c95148f 100644 --- a/src/Symfony/Component/Validator/Constraints/NullValidator.php +++ b/src/Symfony/Component/Validator/Constraints/NullValidator.php @@ -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 * - * @api + * @deprecated since version 2.7, to be removed in 3.0. Use IsNullValidator instead. */ class NullValidator extends IsNullValidator {} diff --git a/src/Symfony/Component/Validator/Constraints/True.php b/src/Symfony/Component/Validator/Constraints/True.php index 832b84b92b..f09b084119 100644 --- a/src/Symfony/Component/Validator/Constraints/True.php +++ b/src/Symfony/Component/Validator/Constraints/True.php @@ -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 * - * @api + * @deprecated since version 2.7, to be removed in 3.0. Use IsTrue instead. */ class True extends IsTrue {} diff --git a/src/Symfony/Component/Validator/Constraints/TrueValidator.php b/src/Symfony/Component/Validator/Constraints/TrueValidator.php index fb0b7d6cdd..5d17bdba35 100644 --- a/src/Symfony/Component/Validator/Constraints/TrueValidator.php +++ b/src/Symfony/Component/Validator/Constraints/TrueValidator.php @@ -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 * - * @api + * @deprecated since version 2.7, to be removed in 3.0. Use IsTrueValidator instead. */ class TrueValidator extends IsTrueValidator {}