[Validator] Remove specific check for Valid targets

This commit is contained in:
Maxime Steinhausser 2020-02-21 16:29:16 +01:00
parent 643f34ff59
commit 0086562c77

View 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