feature #22826 [Validator] improve strict option value deprecation (xabbuh)
This PR was merged into the 3.4 branch.
Discussion
----------
[Validator] improve strict option value deprecation
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | yes
| Tests pass? | yes
| Fixed tickets |
| License | MIT
| Doc PR |
Commits
-------
a820b42
improve strict option value deprecation
This commit is contained in:
commit
c3be3ea898
8
UPGRADE-3.4.md
Normal file
8
UPGRADE-3.4.md
Normal file
@ -0,0 +1,8 @@
|
||||
UPGRADE FROM 3.3 to 3.4
|
||||
=======================
|
||||
|
||||
Validator
|
||||
---------
|
||||
|
||||
* not setting the `strict` option of the `Choice` constraint to `true` is
|
||||
deprecated and will throw an exception in Symfony 4.0
|
@ -507,6 +507,9 @@ TwigBridge
|
||||
Validator
|
||||
---------
|
||||
|
||||
* The default value of the `strict` option of the `Choice` constraint was changed
|
||||
to `true`. Using any other value will throw an exception.
|
||||
|
||||
* The `DateTimeValidator::PATTERN` constant was removed.
|
||||
|
||||
* `Tests\Constraints\AbstractConstraintValidatorTest` has been removed in
|
||||
|
@ -1,6 +1,12 @@
|
||||
CHANGELOG
|
||||
=========
|
||||
|
||||
3.4.0
|
||||
-----
|
||||
|
||||
* not setting the `strict` option of the `Choice` constraint to `true` is
|
||||
deprecated and will throw an exception in Symfony 4.0
|
||||
|
||||
3.3.0
|
||||
-----
|
||||
|
||||
|
@ -58,8 +58,8 @@ class ChoiceValidator extends ConstraintValidator
|
||||
$choices = $constraint->choices;
|
||||
}
|
||||
|
||||
if (false === $constraint->strict) {
|
||||
@trigger_error('Setting the strict option of the Choice constraint to false is deprecated since version 3.2 and will be removed in 4.0.', E_USER_DEPRECATED);
|
||||
if (true !== $constraint->strict) {
|
||||
@trigger_error('Not setting the strict option of the Choice constraint to true is deprecated since version 3.4 and will throw an exception in 4.0.', E_USER_DEPRECATED);
|
||||
}
|
||||
|
||||
if ($constraint->multiple) {
|
||||
|
Reference in New Issue
Block a user