X-Git-Url: https://yaffs.net/gitweb/?a=blobdiff_plain;f=vendor%2Fsymfony%2Fvalidator%2FConstraints%2FIpValidator.php;h=7f806bf7fcf249641a30497bc600bd052c56f2f6;hb=9917807b03b64faf00f6a1f29dcb6eafc454efa5;hp=eb8642b547f14e86c2102053992e6651de0cd796;hpb=a2bd1bf0c2c1f1a17d188f4dc0726a45494cefae;p=yaffs-website diff --git a/vendor/symfony/validator/Constraints/IpValidator.php b/vendor/symfony/validator/Constraints/IpValidator.php index eb8642b54..7f806bf7f 100644 --- a/vendor/symfony/validator/Constraints/IpValidator.php +++ b/vendor/symfony/validator/Constraints/IpValidator.php @@ -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; @@ -94,17 +93,10 @@ class IpValidator extends ConstraintValidator } if (!filter_var($value, FILTER_VALIDATE_IP, $flag)) { - if ($this->context instanceof ExecutionContextInterface) { - $this->context->buildViolation($constraint->message) - ->setParameter('{{ value }}', $this->formatValue($value)) - ->setCode(Ip::INVALID_IP_ERROR) - ->addViolation(); - } else { - $this->buildViolation($constraint->message) - ->setParameter('{{ value }}', $this->formatValue($value)) - ->setCode(Ip::INVALID_IP_ERROR) - ->addViolation(); - } + $this->context->buildViolation($constraint->message) + ->setParameter('{{ value }}', $this->formatValue($value)) + ->setCode(Ip::INVALID_IP_ERROR) + ->addViolation(); } } }