[Validator] Remove specific check for Valid targets
authorMaxime Steinhausser <maxime.steinhausser@elao.com>
Fri, 21 Feb 2020 15:29:16 +0000 (16:29 +0100)
committerMaxime Steinhausser <maxime.steinhausser@elao.com>
Fri, 21 Feb 2020 15:29:16 +0000 (16:29 +0100)
src/Symfony/Component/Validator/Mapping/ClassMetadata.php

index 03b0ae6..aaa30cd 100644 (file)
@@ -14,7 +14,6 @@ namespace Symfony\Component\Validator\Mapping;
 use Symfony\Component\Validator\Constraint;
 use Symfony\Component\Validator\Constraints\GroupSequence;
 use Symfony\Component\Validator\Constraints\Traverse;
-use Symfony\Component\Validator\Constraints\Valid;
 use Symfony\Component\Validator\Exception\ConstraintDefinitionException;
 use Symfony\Component\Validator\Exception\GroupDefinitionException;
 
@@ -183,10 +182,6 @@ class ClassMetadata extends GenericMetadata implements ClassMetadataInterface
             throw new ConstraintDefinitionException(sprintf('The constraint "%s" cannot be put on classes.', \get_class($constraint)));
         }
 
-        if ($constraint instanceof Valid) {
-            throw new ConstraintDefinitionException(sprintf('The constraint "%s" cannot be put on classes.', \get_class($constraint)));
-        }
-
         if ($constraint instanceof Traverse) {
             if ($constraint->traverse) {
                 // If traverse is true, traversal should be explicitly enabled