Security update for Core, with self-updated composer
[yaffs-website] / vendor / symfony / validator / Constraints / AllValidator.php
index 94ff8190e47cb9e86046cbba3a8471c7336b0bde..a5eb32bbd97968a8a3a187683696aa95f63ab883 100644 (file)
@@ -13,7 +13,6 @@ namespace Symfony\Component\Validator\Constraints;
 
 use Symfony\Component\Validator\Constraint;
 use Symfony\Component\Validator\ConstraintValidator;
-use Symfony\Component\Validator\Context\ExecutionContextInterface;
 use Symfony\Component\Validator\Exception\UnexpectedTypeException;
 
 /**
@@ -40,17 +39,10 @@ class AllValidator extends ConstraintValidator
 
         $context = $this->context;
 
-        if ($context instanceof ExecutionContextInterface) {
-            $validator = $context->getValidator()->inContext($context);
-
-            foreach ($value as $key => $element) {
-                $validator->atPath('['.$key.']')->validate($element, $constraint->constraints);
-            }
-        } else {
-            // 2.4 API
-            foreach ($value as $key => $element) {
-                $context->validateValue($element, $constraint->constraints, '['.$key.']');
-            }
+        $validator = $context->getValidator()->inContext($context);
+
+        foreach ($value as $key => $element) {
+            $validator->atPath('['.$key.']')->validate($element, $constraint->constraints);
         }
     }
 }