You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Egulias\EmailValidator\EmailValidator is not really perfect (toto@toto.___c is valid whereas it's not for HTML5 or filter_var), so I propose to use filter_var with FILTER_VALIDATE_EMAIL if Egulias is not installed:
EmailValidator:
if (!class_exists('\Egulias\EmailValidator\EmailValidator')) {
if (filter_var($value, FILTER_VALIDATE_EMAIL) === false) {
$this->context->buildViolation($constraint->message)
->setParameter('{{ value }}', $this->formatValue($value))
->setCode(Email::INVALID_FORMAT_ERROR)
->addViolation();
return;
}
}