10000 minor #14642 [Validator] Deprecated PHP7-incompatible constraints and… · symfony/symfony@fcebef3 · GitHub
[go: up one dir, main page]

Skip to content

Commit fcebef3

Browse files
committed
minor #14642 [Validator] Deprecated PHP7-incompatible constraints and related validators (nicolas-grekas)
This PR was merged into the 2.7 branch. Discussion ---------- [Validator] Deprecated PHP7-incompatible constraints and related validators | Q | A | ------------- | --- | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | yes | Tests pass? | yes | Fixed tickets | - | License | MIT | Doc PR | - Commits ------- a3fc6b9 [Validator] Deprecated PHP7-incompatible constraints and related validators
2 parents c477c5b + a3fc6b9 commit fcebef3

File tree

8 files changed

+25
-6
lines changed

8 files changed

+25
-6
lines changed

UPGRADE-2.7.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -528,3 +528,9 @@ Config
528528
* The `__toString()` method of the `\Symfony\Component\Config\ConfigCache` is marked as
529529
deprecated in favor of the new `getPath()` method.
530530

531+
Validator
532+
---------
533+
534+
* The PHP7-incompatible constraints (Null, True, False) and related validators
535+
(NullValidator, TrueValidator, FalseValidator) are marked as deprecated
536+
in favor of their `Is`-prefixed equivalent.

src/Symfony/Component/Validator/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ CHANGELOG
55
-----
66

77
* deprecated `DefaultTranslator` in favor of `Symfony\Component\Translation\IdentityTranslator`
8+
* deprecated PHP7-incompatible constraints (Null, True, False) and related validators (NullValidator, TrueValidator, FalseValidator) in favor of their `Is`-prefixed equivalent
89

910
2.6.0
1011
-----

src/Symfony/Component/Validator/Constraints/False.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,14 @@
1111

1212
namespace Symfony\Component\Validator\Constraints;
1313

14+
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);
15+
1416
/**
1517
* @Annotation
1618
* @Target({"PROPERTY", "METHOD", "ANNOTATION"})
1719
*
1820
* @author Bernhard Schussek <bschussek@gmail.com>
1921
*
20-
* @api
22+
* @deprecated since version 2.7, to be removed in 3.0. Use IsFalse instead.
2123
*/
2224
class False extends IsFalse {}

src/Symfony/Component/Validator/Constraints/FalseValidator.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,11 @@
1111

1212
namespace Symfony\Component\Validator\Constraints;
1313

14+
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);
15+
1416
/**
1517
* @author Bernhard Schussek <bschussek@gmail.com>
1618
*
17-
* @api
19+
* @deprecated since version 2.7, to be removed in 3.0. Use IsFalseValidator instead.
1820
*/
1921
class FalseValidator extends IsFalseValidator {}

src/Symfony/Component/Validator/Constraints/Null.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,14 @@
1111

1212
namespace Symfony\Component\Validator\Constraints;
1313

14+
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);
15+
1416
/**
1517
* @Annotation
1618
* @Target({"PROPERTY", "METHOD", "ANNOTATION"})
1719
*
1820
* @author Bernhard Schussek <bschussek@gmail.com>
1921
*
20-
* @api
22+
* @deprecated since version 2.7, to be removed in 3.0. Use IsNull instead.
2123
*/
2224
class Null extends IsNull {}

src/Symfony/Component/Validator/Constraints/NullValidator.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,11 @@
1111

1212
namespace Symfony\Component\Validator\Constraints;
1313

14+
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);
15+
1416
/**
1517
* @author Bernhard Schussek <bschussek@gmail.com>
1618
*
17-
* @api
19+
* @deprecated since version 2.7, to be removed in 3.0. Use IsNullValidator instead.
1820
*/
1921
class NullValidator extends IsNullValidator {}

src/Symfony/Component/Validator/Constraints/True.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,14 @@
1111

1212
namespace Symfony\Component\Validator\Constraints;
1313

14+
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);
15+
1416
/**
1517
* @Annotation
1618
* @Target({"PROPERTY", "METHOD", "ANNOTATION"})
1719
*
1820
* @author Bernhard Schussek <bschussek@gmail.com>
1921
*
20-
* @api
22+
* @deprecated since version 2.7, to be removed in 3.0. Use IsTrue instead.
2123
*/
2224
class True extends IsTrue {}

src/Symfony/Component/Validator/Constraints/TrueValidator.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,11 @@
1111

1212
namespace Symfony\Component\Validator\Constraints;
1313

14+
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);
15+
1416
/**
1517
* @author Bernhard Schussek <bschussek@gmail.com>
1618
*
17-
* @api
19+
* @deprecated since version 2.7, to be removed in 3.0. Use IsTrueValidator instead.
1820
*/
1921
class TrueValidator extends IsTrueValidator {}

0 commit comments

Comments
 (0)
0