Security update for Core, with self-updated composer
[yaffs-website] / vendor / symfony / validator / Constraints / NotBlankValidator.php
index 7ea5f1f4710f2d0f644fd50d758fa4f7cba70002..1d6c5bc983a373f94e2c3708f3d121f117fd9aca 100644 (file)
@@ -11,7 +11,6 @@
 
 namespace Symfony\Component\Validator\Constraints;
 
-use Symfony\Component\Validator\Context\ExecutionContextInterface;
 use Symfony\Component\Validator\Constraint;
 use Symfony\Component\Validator\ConstraintValidator;
 use Symfony\Component\Validator\Exception\UnexpectedTypeException;
@@ -31,17 +30,10 @@ class NotBlankValidator extends ConstraintValidator
         }
 
         if (false === $value || (empty($value) && '0' != $value)) {
-            if ($this->context instanceof ExecutionContextInterface) {
-                $this->context->buildViolation($constraint->message)
-                    ->setParameter('{{ value }}', $this->formatValue($value))
-                    ->setCode(NotBlank::IS_BLANK_ERROR)
-                    ->addViolation();
-            } else {
-                $this->buildViolation($constraint->message)
-                    ->setParameter('{{ value }}', $this->formatValue($value))
-                    ->setCode(NotBlank::IS_BLANK_ERROR)
-                    ->addViolation();
-            }
+            $this->context->buildViolation($constraint->message)
+                ->setParameter('{{ value }}', $this->formatValue($value))
+                ->setCode(NotBlank::IS_BLANK_ERROR)
+                ->addViolation();
         }
     }
 }