Skip to content

Commit

Permalink
[Validator] Deprecated PHP7-incompatible constraints and related vali…
Browse files Browse the repository at this point in the history
…dators
  • Loading branch information
nicolas-grekas committed May 15, 2015
1 parent 27c0a12 commit 267921c
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 6 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
-----
Expand Down
4 changes: 3 additions & 1 deletion Constraints/False.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 {}
4 changes: 3 additions & 1 deletion Constraints/FalseValidator.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 {}
4 changes: 3 additions & 1 deletion Constraints/Null.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 {}
4 changes: 3 additions & 1 deletion Constraints/NullValidator.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 {}
4 changes: 3 additions & 1 deletion Constraints/True.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 {}
4 changes: 3 additions & 1 deletion Constraints/TrueValidator.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 {}

0 comments on commit 267921c

Please sign in to comment.