Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork5.3k
[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
[Validator] Add a constraint to sequentially validate a set of constraints#13206
Uh oh!
There was an error while loading.Please reload this page.
Conversation
783fda7 to4a0255fCompare
HeahDude 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.
Looks really good, thanks. Just some minor comments
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
bc09631 tofdd9badCompareogizanagi commentedFeb 22, 2020
I've applied your suggestions, thank you 👍 |
HeahDude 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.
Another round :)
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
fdd9bad to29a6194Compare
HeahDude 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.
Nice! Thanks
OskarStark 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.
👍🏻
| * @Assert\NotBlank(), | ||
| * @Assert\Type("string"), | ||
| * @Assert\Length(min=10), | ||
| * @Assert\Regex(Place::ADDRESS_REGEX), |
OskarStarkFeb 23, 2020 • 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.
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.
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?
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.
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 commentedFeb 24, 2020
Thank you Maxime. |
…+ 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
…+ 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
closes#13076