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] Allow Sequentially constraints on classes + target guards#35815

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:masterfromogizanagi:validator-sequentially-on-classes
Feb 25, 2020
Merged

[Validator] Allow Sequentially constraints on classes + target guards#35815

nicolas-grekas merged 1 commit intosymfony:masterfromogizanagi:validator-sequentially-on-classes
Feb 25, 2020

Conversation

@ogizanagi
Copy link
Contributor

QA
Branch?master
Bug fix?no
New feature?yes
Deprecations?no
TicketsN/A
LicenseMIT
Doc PRtodo insymfony/symfony-docs#13206 if not merged yet

There 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.

thrownewConstraintDefinitionException(sprintf('The constraint "%s" cannot be put on classes.',\get_class($constraint)));
}

if ($constraintinstanceof Sequentially ||$constraintinstanceof Compound) {
Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

All could probably be added to this list, but could it lead to a BC break somehow?

Copy link
Contributor

Choose a reason for hiding this comment

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

All could probably be added to this list

Why? It does not allow classes already thanks to theif before 🤔

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

Wrong path. I meant inMemberMetadata 😄

Copy link
Contributor

Choose a reason for hiding this comment

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

Hmm, what about a check againstComposite instead? It may be needed for both then, and even target 3.4?

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

Alright, let's consider this a bug fix. I'll move the second commit to another PR for 3.4

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

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.

LGTM

@nicolas-grekas
Copy link
Member

Thank you@ogizanagi.

@nicolas-grekasnicolas-grekas merged commit7b89d1b intosymfony:masterFeb 25, 2020
@ogizanagiogizanagi deleted the validator-sequentially-on-classes branchFebruary 25, 2020 15:27
@nicolas-grekasnicolas-grekas modified the milestones:next,5.1May 4, 2020
@fabpotfabpot mentioned this pull requestMay 5, 2020
fabpot added a commit that referenced this pull requestAug 12, 2020
…ints (ogizanagi)This PR was merged into the 3.4 branch.Discussion----------[Validator] Add target guards for Composite nested constraints| Q             | A| ------------- | ---| Branch?       | 3.4 <!-- see below -->| Bug fix?      | yes| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->| Tickets       |Fix#35815 (review) <!-- prefix each issue number with "Fix #", if any -->| License       | MIT| Doc PR        | N/ACommits-------a08ddf7 [Validator] Add target guards for Composite nested constraints
symfony-splitter pushed a commit to symfony/validator that referenced this pull requestAug 12, 2020
…ints (ogizanagi)This PR was merged into the 3.4 branch.Discussion----------[Validator] Add target guards for Composite nested constraints| Q             | A| ------------- | ---| Branch?       | 3.4 <!-- see below -->| Bug fix?      | yes| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->| Tickets       |Fixsymfony/symfony#35815 (review) <!-- prefix each issue number with "Fix #", if any -->| License       | MIT| Doc PR        | N/ACommits-------a08ddf7636 [Validator] Add target guards for Composite nested constraints
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@stofstofstof approved these changes

@chalasrchalasrchalasr approved these changes

+1 more reviewer

@HeahDudeHeahDudeHeahDude left review comments

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.

6 participants

@ogizanagi@nicolas-grekas@stof@chalasr@HeahDude@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp