-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Validator] deprecate the loose e-mail validation mode #46518
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
xabbuh
commented
May 31, 2022
Q | A |
---|---|
Branch? | 6.2 |
Bug fix? | no |
New feature? | no |
Deprecations? | yes |
Tickets | Fix #41855 |
License | MIT |
Doc PR |
src/Symfony/Component/Validator/Tests/Constraints/EmailValidatorTest.php
Outdated
Show resolved
Hide resolved
Thank you @xabbuh. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@xabbuh i know the code is already merged but maybe you can have a look at my comments?
@@ -68,6 +71,10 @@ public function __construct( | |||
$this->mode = $mode ?? $this->mode; | |||
$this->normalizer = $normalizer ?? $this->normalizer; | |||
|
|||
if (self::VALIDATION_MODE_LOOSE === $this->mode) { | |||
trigger_deprecation('symfony/validator', '6.2', 'The "%s" mode is deprecated. The default mode will be changed to "%s" in 7.0.', self::VALIDATION_MODE_LOOSE, self::VALIDATION_MODE_HTML5); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will the default be changed or will the validation mode be removed?
@@ -27,6 +27,9 @@ class Email extends Constraint | |||
{ | |||
public const VALIDATION_MODE_HTML5 = 'html5'; | |||
public const VALIDATION_MODE_STRICT = 'strict'; | |||
/** | |||
* @deprecated since Symfony 6.2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@deprecated since Symfony 6.2, use VALIDATION_MODE_HTML5 instead?
@johanadivare sorry for the late feedback, please see #49420 |
This PR was merged into the 6.2 branch. Discussion ---------- improve deprecation message | Q | A | ------------- | --- | Branch? | 6.2 | Bug fix? | no | New feature? | no | Deprecations? | no | Tickets | #46518 (comment) and #46518 (comment) | License | MIT | Doc PR | Commits ------- 54a1d1b improve deprecation message