-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Validator] Reset constraint options #20122
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
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.
Thanks for the contribution. Looks good to me.
Have you check if this is the only place where we need that? |
@fabpot I grep'd through the Validator Component for The only other time they are used is in the |
I was thinking about the other components and bundles as well. |
I'll take a look. |
@fabpot I double checked the rest of symfony's code. As far as I can tell, all other uses of |
We should be careful though, it needs to be looked at on a per case basis. I've double checked all subclasses, and overridden constructors are good to go. |
Thank you @ro0NL. |
This PR was merged into the 2.7 branch. Discussion ---------- [Validator] Reset constraint options | Q | A | ------------- | --- | Branch? | 2.7 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #20106 | License | MIT | Doc PR | reference to the documentation PR, if any I think it's good to reset the internal pointer of the options array if we depend on `key($options)`. I've added tests to clarify we intentionally check for the first key. The current behavior actually differs for hhvm/php7 - https://3v4l.org/e6r6E Commits ------- 4c6ddd4 reset constraint options
I think it's good to reset the internal pointer of the options array if we depend on
key($options)
. I've added tests to clarify we intentionally check for the first key.The current behavior actually differs for hhvm/php7 - https://3v4l.org/e6r6E