Skip to content

Commit 2a7f22e

Browse files
committed
[Validator] Remove property and method targets from the optional and required constraints.
At the moment both constraints can only be defined on other annotations (specifically, the Collection annotation). Defining the required or optional annotation directly on a field or method throws a ClassNotFoundException, since the constraint validator factory tries to load the validator (which does not exist).
1 parent b19a9a1 commit 2a7f22e

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

Constraints/Optional.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
/**
1515
* @Annotation
16-
* @Target({"PROPERTY", "METHOD", "ANNOTATION"})
16+
* @Target({"ANNOTATION"})
1717
*
1818
* @author Bernhard Schussek <[email protected]>
1919
*/

Constraints/Required.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
/**
1515
* @Annotation
16-
* @Target({"PROPERTY", "METHOD", "ANNOTATION"})
16+
* @Target({"ANNOTATION"})
1717
*
1818
* @author Bernhard Schussek <[email protected]>
1919
*/

0 commit comments

Comments
 (0)