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 a constraint to sequentially validate a set of constraints#13206

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

Conversation

@ogizanagi
Copy link
Contributor

closes#13076

Copy link
Contributor

@HeahDudeHeahDude left a comment

Choose a reason for hiding this comment

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

Looks really good, thanks. Just some minor comments

@ogizanagiogizanagiforce-pushed thevalidator-sequentially-constraint branch 2 times, most recently frombc09631 tofdd9badCompareFebruary 22, 2020 15:25
@ogizanagi
Copy link
ContributorAuthor

I've applied your suggestions, thank you 👍

Copy link
Contributor

@HeahDudeHeahDude left a comment

Choose a reason for hiding this comment

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

Another round :)

Copy link
Contributor

@HeahDudeHeahDude left a comment

Choose a reason for hiding this comment

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

Nice! Thanks

Copy link
Contributor

@OskarStarkOskarStark left a comment

Choose a reason for hiding this comment

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

👍🏻

* @Assert\NotBlank(),
* @Assert\Type("string"),
* @Assert\Length(min=10),
* @Assert\Regex(Place::ADDRESS_REGEX),
Copy link
Contributor

@OskarStarkOskarStarkFeb 23, 2020
edited
Loading

Choose a reason for hiding this comment

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

One minor, do you have a regex pattern which can be added? Do we really need the regex here? If yes, should we add the constant to the code example?

But adding a regex is maybe distracting, could we inline the pattern or is it anyway to complex?

What do you think of removing it completely from the example?

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

I'd prefer to avoid adding a regex pattern. I used (but didn't show) a constant for the reason mentioned: the regex isn't important on its own and would be distracting.
I think the@Regex in the example deserve a purpose to demonstrate the step-by-step application of the rules, as it'll usually fail hard despite being used conjointly withType without theSequential constraint. But@Length demonstrate the same, so if you really prefer, I can remove it indeed.

OskarStark reacted with thumbs up emoji
@OskarStark
Copy link
Contributor

Thank you Maxime.

@OskarStarkOskarStark merged commitb78e05a intosymfony:masterFeb 24, 2020
@ogizanagiogizanagi deleted the validator-sequentially-constraint branchFebruary 24, 2020 10:06
nicolas-grekas added a commit to symfony/symfony that referenced this pull requestFeb 25, 2020
…+ target guards (ogizanagi)This PR was merged into the 5.1-dev branch.Discussion----------[Validator] Allow Sequentially constraints on classes + target guards| Q             | A| ------------- | ---| Branch?       | master <!-- see below -->| Bug fix?      | no| New feature?  | yes <!-- please update src/**/CHANGELOG.md files -->| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->| Tickets       | N/A <!-- prefix each issue number with "Fix #", if any -->| License       | MIT| Doc PR        | todo insymfony/symfony-docs#13206 if not merged yetThere is no reason to limit this constraint to properties, so let's add classes as targets.Additionally, let's ensure embedded constraints matches allowed targets too.Commits-------1e02a96 [Validator] Allow Sequentially constraints on classes
symfony-splitter pushed a commit to symfony/validator that referenced this pull requestFeb 25, 2020
…+ target guards (ogizanagi)This PR was merged into the 5.1-dev branch.Discussion----------[Validator] Allow Sequentially constraints on classes + target guards| Q             | A| ------------- | ---| Branch?       | master <!-- see below -->| Bug fix?      | no| New feature?  | yes <!-- please update src/**/CHANGELOG.md files -->| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->| Tickets       | N/A <!-- prefix each issue number with "Fix #", if any -->| License       | MIT| Doc PR        | todo insymfony/symfony-docs#13206 if not merged yetThere is no reason to limit this constraint to properties, so let's add classes as targets.Additionally, let's ensure embedded constraints matches allowed targets too.Commits-------1e02a96286 [Validator] Allow Sequentially constraints on classes
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@OskarStarkOskarStarkOskarStark approved these changes

@xabbuhxabbuhAwaiting requested review from xabbuh

@javiereguiluzjaviereguiluzAwaiting requested review from javiereguiluz

+1 more reviewer

@HeahDudeHeahDudeHeahDude approved these changes

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Projects

None yet

Milestone

5.1

Development

Successfully merging this pull request may close these issues.

[Validator] Add a constraint to sequentially validate a set of constrai…

4 participants

@ogizanagi@OskarStark@HeahDude@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp