Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[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

Merged
nicolas-grekas merged 1 commit intosymfony:7.3fromxabbuh:issue-61612
Sep 4, 2025

Conversation

@xabbuh
Copy link
Member

QA
Branch?7.3
Bug fix?yes
New feature?no
Deprecations?no
IssuesFix#61612
LicenseMIT

generalized alternative to#61613

}

if (array_is_list($options)) {
if (array_is_list($options) ||isset($options['value'])) {
Copy link
MemberAuthor

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;}

Copy link
MemberAuthor

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

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?

Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

done

@xabbuhxabbuh changed the title[Validator] fall back to legacy options handling if the value element is used[Validator] fall back to legacy options handling if configured named arguments do not matchSep 4, 2025
@nicolas-grekas
Copy link
Member

Thank you@xabbuh.

@nicolas-grekasnicolas-grekas merged commite7c41fe intosymfony:7.3Sep 4, 2025
7 of 11 checks passed
@nicolas-grekas
Copy link
Member

nicolas-grekas commentedSep 4, 2025
edited
Loading

Thanks! Follow up welcome on 7.4 🙏

@xabbuh
Copy link
MemberAuthor

the follow-up PR for the deprecation is here:#61791

nicolas-grekas added a commit that referenced this pull requestSep 24, 2025
… 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
symfony-splitter pushed a commit to symfony/validator that referenced this pull requestSep 24, 2025
… 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
@fabpotfabpot mentioned this pull requestSep 27, 2025
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@nicolas-grekasnicolas-grekasnicolas-grekas left review comments

Assignees

No one assigned

Projects

None yet

Milestone

7.3

Development

Successfully merging this pull request may close these issues.

3 participants

@xabbuh@nicolas-grekas@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp