EmailValidator.php in Drupal 9
File
core/lib/Drupal/Component/Utility/EmailValidator.php
View source
<?php
namespace Drupal\Component\Utility;
use Egulias\EmailValidator\EmailValidator as EmailValidatorUtility;
use Egulias\EmailValidator\Validation\EmailValidation;
use Egulias\EmailValidator\Validation\RFCValidation;
class EmailValidator extends EmailValidatorUtility implements EmailValidatorInterface {
public function isValid($email, EmailValidation $email_validation = NULL) {
if ($email_validation) {
throw new \BadMethodCallException('Calling \\Drupal\\Component\\Utility\\EmailValidator::isValid() with the second argument is not supported. See https://www.drupal.org/node/2997196');
}
return parent::isValid($email, new RFCValidation());
}
}