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

Appearance settings

Commit 809a6a0

Browse filesBrowse files
feature #35815 [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 in symfony/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. Commits ------- 1e02a96286 [Validator] Allow Sequentially constraints on classes
2 parents 4eab907 + faac008 commit 809a6a0
Copy full SHA for 809a6a0

File tree

Expand file treeCollapse file tree

1 file changed

+6
-1
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+6
-1
lines changed

‎Constraints/Sequentially.php

Copy file name to clipboardExpand all lines: Constraints/Sequentially.php
+6-1Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
* Validation for the nested constraints collection will stop at first violation.
1717
*
1818
* @Annotation
19-
* @Target({"PROPERTY", "METHOD", "ANNOTATION"})
19+
* @Target({"CLASS", "PROPERTY", "METHOD", "ANNOTATION"})
2020
*
2121
* @author Maxime Steinhausser <maxime.steinhausser@gmail.com>
2222
*/
@@ -38,4 +38,9 @@ protected function getCompositeOption()
3838
{
3939
return 'constraints';
4040
}
41+
42+
public function getTargets()
43+
{
44+
return [self::CLASS_CONSTRAINT, self::PROPERTY_CONSTRAINT];
45+
}
4146
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.