-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
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
[Validator] deprecate the "allowEmptyString" option #36818
Conversation
xabbuh
commented
May 15, 2020
Q | A |
---|---|
Branch? | master |
Bug fix? | no |
New feature? | no |
Deprecations? | yes |
Tickets | Fix #36812 |
License | MIT |
Doc PR |
Can we deprecate the |
Good idea, this was actually suggested when the option was introduced in 4.4 (see #31528):
|
6df1211
to
fbbde1e
Compare
src/Symfony/Component/Validator/Tests/Constraints/LengthTest.php
Outdated
Show resolved
Hide resolved
7f518d4
to
a95b7a3
Compare
Thank you @xabbuh. |
Just wondering how we can achieve the "old behaviour" now when combining min, max and allowEmptyString=true It used to be "ok" to have have either an empty string OR apply min-max-constraints - this is gone now. Or am I missing something? |
Precisely for such use cases you can combine the |
…rjohnson) This PR was merged into the 6.0 branch. Discussion ---------- [Validator] Update Length Validator Empty String Docs Empty strings are no longer valid if a min is passed, null values still validate. Changed in 6.0 along with dropping the deprecated `allowEmptyString` symfony/symfony#36818 option. There is some discussion that this is the intended behavior in symfony/symfony#45993 Commits ------- 9fa967e Update Length Validator Empty String Docs