Security update for Core, with self-updated composer
[yaffs-website] / vendor / symfony / validator / Constraints / NotNullValidator.php
index 0402b3d690f409abbfb54fcc940af12243ea63e8..d6f620713e6a606807eff2ebc186ea3cb7989d86 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;
 
 /**
@@ -31,17 +30,10 @@ class NotNullValidator extends ConstraintValidator
         }
 
         if (null === $value) {
-            if ($this->context instanceof ExecutionContextInterface) {
-                $this->context->buildViolation($constraint->message)
-                    ->setParameter('{{ value }}', $this->formatValue($value))
-                    ->setCode(NotNull::IS_NULL_ERROR)
-                    ->addViolation();
-            } else {
-                $this->buildViolation($constraint->message)
-                    ->setParameter('{{ value }}', $this->formatValue($value))
-                    ->setCode(NotNull::IS_NULL_ERROR)
-                    ->addViolation();
-            }
+            $this->context->buildViolation($constraint->message)
+                ->setParameter('{{ value }}', $this->formatValue($value))
+                ->setCode(NotNull::IS_NULL_ERROR)
+                ->addViolation();
         }
     }
 }