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] Add the match option to the Choice constraint#45977

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
fabpot merged 1 commit intosymfony:6.2fromfancyweb:validator/match-choice
Jul 21, 2022

Conversation

@fancyweb
Copy link
Contributor

@fancywebfancyweb commentedApr 8, 2022
edited
Loading

QA
Branch?6.1
Bug fix?no
New feature?yes
Deprecations?no
Tickets#26074
LicenseMIT
Doc PR-

I'd like to add amatch option like the one in theRegex constraint to validate that a value isnot in a given set of choices.

Reusing theChoice constraint with a flag instead of creating theNotChoice constraint looks way better to me.

* Deprecate constraint`ExpressionLanguageSyntax`, use`ExpressionSyntax` instead
* Add method`__toString()` to`ConstraintViolationInterface` &`ConstraintViolationListInterface`
* Allow creating constraints with required arguments
* Add the`match` option to the`Choice` constraint

Choose a reason for hiding this comment

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

I had to read the description of the PR to get what this was for.
Maybe it's a naming issue? Wouldnegate be better instead? I'm not sure, just trying :)

welcoMattic reacted with thumbs up emoji
Copy link
Member

Choose a reason for hiding this comment

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

Another possible naming isshouldMatch, as it's more clear to understand that a boolean is expected.

Copy link
Member

Choose a reason for hiding this comment

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

I've spent some time thinking about this. I didn't find any reasonable alternative. The whole concept seems like an edge case anyway, so let's keepmatch (at least, this is the same name as for Regexp). Doc should be well written though :)

Copy link
Member

Choose a reason for hiding this comment

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

And of course, if anyone has a better name before 6.2 final, we will be able to change it quickly.
cc @symfony/mergers

@fancywebfancyweb modified the milestones:6.1,6.2Apr 26, 2022
@fabpot
Copy link
Member

Thank you@fancyweb.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@fabpotfabpotfabpot approved these changes

@nicolas-grekasnicolas-grekasnicolas-grekas left review comments

@welcoMatticwelcoMatticwelcoMattic left review comments

Assignees

No one assigned

Projects

None yet

Milestone

6.2

Development

Successfully merging this pull request may close these issues.

5 participants

@fancyweb@fabpot@nicolas-grekas@welcoMattic@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp