X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=vendor%2Fsymfony%2Fvalidator%2FConstraints%2FLocaleValidator.php;fp=vendor%2Fsymfony%2Fvalidator%2FConstraints%2FLocaleValidator.php;h=93eab8cb7e757c92f41e31df6ccbf41aaf121ff1;hp=6e779df2bd62c0b2cd73ffaae776954f6fb5d560;hb=9917807b03b64faf00f6a1f29dcb6eafc454efa5;hpb=aea91e65e895364e460983b890e295aa5d5540a5 diff --git a/vendor/symfony/validator/Constraints/LocaleValidator.php b/vendor/symfony/validator/Constraints/LocaleValidator.php index 6e779df2b..93eab8cb7 100644 --- a/vendor/symfony/validator/Constraints/LocaleValidator.php +++ b/vendor/symfony/validator/Constraints/LocaleValidator.php @@ -12,7 +12,6 @@ namespace Symfony\Component\Validator\Constraints; use Symfony\Component\Intl\Intl; -use Symfony\Component\Validator\Context\ExecutionContextInterface; use Symfony\Component\Validator\Constraint; use Symfony\Component\Validator\ConstraintValidator; use Symfony\Component\Validator\Exception\UnexpectedTypeException; @@ -46,17 +45,10 @@ class LocaleValidator extends ConstraintValidator $aliases = Intl::getLocaleBundle()->getAliases(); if (!isset($locales[$value]) && !in_array($value, $aliases)) { - if ($this->context instanceof ExecutionContextInterface) { - $this->context->buildViolation($constraint->message) - ->setParameter('{{ value }}', $this->formatValue($value)) - ->setCode(Locale::NO_SUCH_LOCALE_ERROR) - ->addViolation(); - } else { - $this->buildViolation($constraint->message) - ->setParameter('{{ value }}', $this->formatValue($value)) - ->setCode(Locale::NO_SUCH_LOCALE_ERROR) - ->addViolation(); - } + $this->context->buildViolation($constraint->message) + ->setParameter('{{ value }}', $this->formatValue($value)) + ->setCode(Locale::NO_SUCH_LOCALE_ERROR) + ->addViolation(); } } }