X-Git-Url: https://yaffs.net/gitweb/?a=blobdiff_plain;f=vendor%2Fsymfony%2Fvalidator%2FConstraints%2FIsTrueValidator.php;h=89aa337d2c054375aeb73c1aa98c81c361d35882;hb=9917807b03b64faf00f6a1f29dcb6eafc454efa5;hp=e1ca56ecd737e6f28689e003e00c701480231589;hpb=a2bd1bf0c2c1f1a17d188f4dc0726a45494cefae;p=yaffs-website diff --git a/vendor/symfony/validator/Constraints/IsTrueValidator.php b/vendor/symfony/validator/Constraints/IsTrueValidator.php index e1ca56ecd..89aa337d2 100644 --- a/vendor/symfony/validator/Constraints/IsTrueValidator.php +++ b/vendor/symfony/validator/Constraints/IsTrueValidator.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; @@ -35,17 +34,10 @@ class IsTrueValidator extends ConstraintValidator } if (true !== $value && 1 !== $value && '1' !== $value) { - if ($this->context instanceof ExecutionContextInterface) { - $this->context->buildViolation($constraint->message) - ->setParameter('{{ value }}', $this->formatValue($value)) - ->setCode(IsTrue::NOT_TRUE_ERROR) - ->addViolation(); - } else { - $this->buildViolation($constraint->message) - ->setParameter('{{ value }}', $this->formatValue($value)) - ->setCode(IsTrue::NOT_TRUE_ERROR) - ->addViolation(); - } + $this->context->buildViolation($constraint->message) + ->setParameter('{{ value }}', $this->formatValue($value)) + ->setCode(IsTrue::NOT_TRUE_ERROR) + ->addViolation(); } } }