Skip to content

Commit

Permalink
[Validator] Remove property and method targets from the optional and …
Browse files Browse the repository at this point in the history
…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).
  • Loading branch information
jakzal committed May 29, 2014
1 parent cff4105 commit 9c2616e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Symfony/Component/Validator/Constraints/Optional.php
Expand Up @@ -13,7 +13,7 @@

/**
* @Annotation
* @Target({"PROPERTY", "METHOD", "ANNOTATION"})
* @Target({"ANNOTATION"})
*
* @author Bernhard Schussek <bschussek@gmail.com>
*/
Expand Down
2 changes: 1 addition & 1 deletion src/Symfony/Component/Validator/Constraints/Required.php
Expand Up @@ -13,7 +13,7 @@

/**
* @Annotation
* @Target({"PROPERTY", "METHOD", "ANNOTATION"})
* @Target({"ANNOTATION"})
*
* @author Bernhard Schussek <bschussek@gmail.com>
*/
Expand Down

0 comments on commit 9c2616e

Please sign in to comment.