Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

[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).
  • Loading branch information...
commit 9c2616e788159987308a7d23bc0bbaa897509bbd 1 parent cff4105
@jakzal jakzal authored
View
2  src/Symfony/Component/Validator/Constraints/Optional.php
@@ -13,7 +13,7 @@
/**
* @Annotation
- * @Target({"PROPERTY", "METHOD", "ANNOTATION"})
+ * @Target({"ANNOTATION"})
*
* @author Bernhard Schussek <bschussek@gmail.com>
*/
View
2  src/Symfony/Component/Validator/Constraints/Required.php
@@ -13,7 +13,7 @@
/**
* @Annotation
- * @Target({"PROPERTY", "METHOD", "ANNOTATION"})
+ * @Target({"ANNOTATION"})
*
* @author Bernhard Schussek <bschussek@gmail.com>
*/
Please sign in to comment.
Something went wrong with that request. Please try again.