class EmailValidator

Same name in this branch
  1. 10 core/lib/Drupal/Component/Utility/EmailValidator.php \Drupal\Component\Utility\EmailValidator
Same name in other branches
  1. 9 core/lib/Drupal/Component/Utility/EmailValidator.php \Drupal\Component\Utility\EmailValidator
  2. 8.9.x core/lib/Drupal/Component/Utility/EmailValidator.php \Drupal\Component\Utility\EmailValidator
  3. 11.x core/lib/Drupal/Core/Validation/Plugin/Validation/Constraint/EmailValidator.php \Drupal\Core\Validation\Plugin\Validation\Constraint\EmailValidator
  4. 11.x core/lib/Drupal/Component/Utility/EmailValidator.php \Drupal\Component\Utility\EmailValidator

Email constraint.

Overrides the symfony validator to use the HTML 5 setting.

@internal Exists only to override the constructor to avoid a deprecation in Symfony 6, and will be removed in drupal:11.0.0.

Hierarchy

  • class \Drupal\Core\Validation\Plugin\Validation\Constraint\EmailValidator extends \Symfony\Component\Validator\Constraints\EmailValidator

Expanded class hierarchy of EmailValidator

File

core/lib/Drupal/Core/Validation/Plugin/Validation/Constraint/EmailValidator.php, line 16

Namespace

Drupal\Core\Validation\Plugin\Validation\Constraint
View source
final class EmailValidator extends SymfonyEmailValidator {
    
    /**
     * {@inheritdoc}
     */
    public function __construct(string $defaultMode = Email::VALIDATION_MODE_HTML5) {
        parent::__construct($defaultMode);
    }

}

Members

Title Sort descending Modifiers Object type Summary
EmailValidator::__construct public function

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.