From 98582557a107e2db3a4e95e6dea0df8016dc246c Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Sun, 15 Jan 2023 15:54:19 +0100 Subject: [PATCH] [Validator] Fix Email validator logic --- Constraints/EmailValidator.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Constraints/EmailValidator.php b/Constraints/EmailValidator.php index ee78024d6..11fc7be2d 100644 --- a/Constraints/EmailValidator.php +++ b/Constraints/EmailValidator.php @@ -16,6 +16,7 @@ use Egulias\EmailValidator\Validation\NoRFCWarningsValidation; use Symfony\Component\Validator\Constraint; use Symfony\Component\Validator\ConstraintValidator; +use Symfony\Component\Validator\Exception\LogicException; use Symfony\Component\Validator\Exception\UnexpectedTypeException; use Symfony\Component\Validator\Exception\UnexpectedValueException; @@ -71,7 +72,7 @@ public function validate($value, Constraint $constraint) if (null === $constraint->mode) { if (Email::VALIDATION_MODE_STRICT === $this->defaultMode && !class_exists(EguliasEmailValidator::class)) { - throw new LogicException(sprintf('The "egulias/email-validator" component is required to make the "%s" constraint default to strict mode.', EguliasEmailValidator::class)); + throw new LogicException(sprintf('The "egulias/email-validator" component is required to make the "%s" constraint default to strict mode.', Email::class)); } $constraint->mode = $this->defaultMode;