Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
[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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
lemoinem left a comment
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.
fabpot commentedOct 2, 2016
Have you check if this is the only place where we need that? |
lemoinem commentedOct 2, 2016 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
@fabpot I grep'd through the Validator Component for The only other time they are used is in the |
fabpot commentedOct 2, 2016
I was thinking about the other components and bundles as well. |
lemoinem commentedOct 2, 2016
I'll take a look. |
lemoinem commentedOct 2, 2016
@fabpot I double checked the rest of symfony's code. As far as I can tell, all other uses of |
ro0NL commentedOct 2, 2016
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. |
fabpot commentedOct 2, 2016
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 anyI 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/e6r6ECommits-------4c6ddd4 reset constraint options
Uh oh!
There was an error while loading.Please reload this page.
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