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] fall back to legacy options handling if configured named arguments do not match#61617
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
| } | ||
| if (array_is_list($options)) { | ||
| if (array_is_list($options) ||isset($options['value'])) { |
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.
This might be a bit risky if the constraint has a constructor argument named$value.
An alternative solution would be wrapping the call further down in atrycatch block like this:
try {returnnew$className(...$options);}catch (\Error$e) {if (str_starts_with($e->getMessage(),'Unknown named parameter')) {returnnew$className($options); }throw$e;}
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.
in any case, we should deprecate this in 7.4 after merging up
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.
let's do it the safest way?
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.
done
Thank you@xabbuh. |
e7c41fe intosymfony:7.3Uh oh!
There was an error while loading.Please reload this page.
nicolas-grekas commentedSep 4, 2025 • 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.
Thanks! Follow up welcome on 7.4 🙏 |
the follow-up PR for the deprecation is here:#61791 |
… in YAML/XML mapping files (xabbuh)This PR was merged into the 7.4 branch.Discussion----------[Validator] deprecate implicit constraint option names in YAML/XML mapping files| Q | A| ------------- | ---| Branch? | 7.4| Bug fix? | no| New feature? | no| Deprecations? | yes| Issues | see#61617 (comment)| License | MITCommits-------14ca8ac deprecate implicit constraint option names in YAML/XML mapping files
… in YAML/XML mapping files (xabbuh)This PR was merged into the 7.4 branch.Discussion----------[Validator] deprecate implicit constraint option names in YAML/XML mapping files| Q | A| ------------- | ---| Branch? | 7.4| Bug fix? | no| New feature? | no| Deprecations? | yes| Issues | seesymfony/symfony#61617 (comment)| License | MITCommits-------14ca8ac7dcc deprecate implicit constraint option names in YAML/XML mapping files
generalized alternative to#61613