-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Validator] Only handle numeric values in DivisibleBy #33435
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] Only handle numeric values in DivisibleBy #33435
Conversation
src/Symfony/Component/Validator/Constraints/DivisibleByValidator.php
Outdated
Show resolved
Hide resolved
6afa33e
to
13e8b44
Compare
Now the only problem with it is that the values can be transformed in the |
@fancyweb not sure i follow, the passed message still applies to numeric values. We get a different message/violation for type errors, like any other constraint does. |
What I mean is that if my constraint is |
i see, IMHO that's a side effect we can live with yes. |
13e8b44
to
f974add
Compare
Thank you @fancyweb. |
…cyweb) This PR was merged into the 4.3 branch. Discussion ---------- [Validator] Only handle numeric values in DivisibleBy | Q | A | ------------- | --- | Branch? | 4.3 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | - | License | MIT | Doc PR | - Currently it probably breaks because `abs` throws a notice on objects. Commits ------- f974add [Validator] Only handle numeric values in DivisibleBy
Currently it probably breaks because
abs
throws a notice on objects.