X-Git-Url: https://yaffs.net/gitweb/?a=blobdiff_plain;f=vendor%2Fsymfony%2Fvalidator%2FConstraints%2FRegexValidator.php;h=48ee61a74edcb38d0a95640fdd4e1175372033b7;hb=9917807b03b64faf00f6a1f29dcb6eafc454efa5;hp=0aa0ed5e07787e4803e366b8a96a7c6f1b50aec8;hpb=a2bd1bf0c2c1f1a17d188f4dc0726a45494cefae;p=yaffs-website diff --git a/vendor/symfony/validator/Constraints/RegexValidator.php b/vendor/symfony/validator/Constraints/RegexValidator.php index 0aa0ed5e0..48ee61a74 100644 --- a/vendor/symfony/validator/Constraints/RegexValidator.php +++ b/vendor/symfony/validator/Constraints/RegexValidator.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; @@ -44,17 +43,10 @@ class RegexValidator extends ConstraintValidator $value = (string) $value; if ($constraint->match xor preg_match($constraint->pattern, $value)) { - if ($this->context instanceof ExecutionContextInterface) { - $this->context->buildViolation($constraint->message) - ->setParameter('{{ value }}', $this->formatValue($value)) - ->setCode(Regex::REGEX_FAILED_ERROR) - ->addViolation(); - } else { - $this->buildViolation($constraint->message) - ->setParameter('{{ value }}', $this->formatValue($value)) - ->setCode(Regex::REGEX_FAILED_ERROR) - ->addViolation(); - } + $this->context->buildViolation($constraint->message) + ->setParameter('{{ value }}', $this->formatValue($value)) + ->setCode(Regex::REGEX_FAILED_ERROR) + ->addViolation(); } } }