X-Git-Url: https://yaffs.net/gitweb/?a=blobdiff_plain;f=vendor%2Fsymfony%2Fvalidator%2FMapping%2FGenericMetadata.php;h=83099aa5e3762a3cd944f4fd1c03d52baad3d8a4;hb=9e65bae52407293a5182f19dc57b5628b09e92f4;hp=97915ac71307f1b891f31cefbe5ddf27ad858561;hpb=a2bd1bf0c2c1f1a17d188f4dc0726a45494cefae;p=yaffs-website diff --git a/vendor/symfony/validator/Mapping/GenericMetadata.php b/vendor/symfony/validator/Mapping/GenericMetadata.php index 97915ac71..83099aa5e 100644 --- a/vendor/symfony/validator/Mapping/GenericMetadata.php +++ b/vendor/symfony/validator/Mapping/GenericMetadata.php @@ -14,9 +14,7 @@ namespace Symfony\Component\Validator\Mapping; use Symfony\Component\Validator\Constraint; use Symfony\Component\Validator\Constraints\Traverse; use Symfony\Component\Validator\Constraints\Valid; -use Symfony\Component\Validator\Exception\BadMethodCallException; use Symfony\Component\Validator\Exception\ConstraintDefinitionException; -use Symfony\Component\Validator\ValidationVisitorInterface; /** * A generic container of {@link Constraint} objects. @@ -110,17 +108,12 @@ class GenericMetadata implements MetadataInterface * * If the constraint {@link Valid} is added, the cascading strategy will be * changed to {@link CascadingStrategy::CASCADE}. Depending on the - * properties $traverse and $deep of that constraint, the traversal strategy + * $traverse property of that constraint, the traversal strategy * will be set to one of the following: * - * - {@link TraversalStrategy::IMPLICIT} if $traverse is enabled and $deep - * is enabled - * - {@link TraversalStrategy::IMPLICIT} | {@link TraversalStrategy::STOP_RECURSION} - * if $traverse is enabled, but $deep is disabled + * - {@link TraversalStrategy::IMPLICIT} if $traverse is enabled * - {@link TraversalStrategy::NONE} if $traverse is disabled * - * @param Constraint $constraint The constraint to add - * * @return $this * * @throws ConstraintDefinitionException When trying to add the @@ -136,16 +129,11 @@ class GenericMetadata implements MetadataInterface )); } - if ($constraint instanceof Valid) { + if ($constraint instanceof Valid && null === $constraint->groups) { $this->cascadingStrategy = CascadingStrategy::CASCADE; if ($constraint->traverse) { - // Traverse unless the value is not traversable $this->traversalStrategy = TraversalStrategy::IMPLICIT; - - if (!$constraint->deep) { - $this->traversalStrategy |= TraversalStrategy::STOP_RECURSION; - } } else { $this->traversalStrategy = TraversalStrategy::NONE; } @@ -223,21 +211,4 @@ class GenericMetadata implements MetadataInterface { return $this->traversalStrategy; } - - /** - * Exists for compatibility with the deprecated - * {@link Symfony\Component\Validator\MetadataInterface}. - * - * Should not be used. - * - * Implemented for backward compatibility with Symfony < 2.5. - * - * @throws BadMethodCallException - * - * @deprecated since version 2.5, to be removed in 3.0. - */ - public function accept(ValidationVisitorInterface $visitor, $value, $group, $propertyPath) - { - throw new BadMethodCallException('Not supported.'); - } }