class EmailConstraint

Same name in other branches
  1. 9 core/lib/Drupal/Core/Validation/Plugin/Validation/Constraint/EmailConstraint.php \Drupal\Core\Validation\Plugin\Validation\Constraint\EmailConstraint
  2. 8.9.x core/lib/Drupal/Core/Validation/Plugin/Validation/Constraint/EmailConstraint.php \Drupal\Core\Validation\Plugin\Validation\Constraint\EmailConstraint
  3. 10 core/lib/Drupal/Core/Validation/Plugin/Validation/Constraint/EmailConstraint.php \Drupal\Core\Validation\Plugin\Validation\Constraint\EmailConstraint

Count constraint.

Overrides the symfony constraint to use the strict setting.

Hierarchy

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

Expanded class hierarchy of EmailConstraint

1 file declares its use of EmailConstraint
ConstraintManager.php in core/lib/Drupal/Core/Validation/ConstraintManager.php

File

core/lib/Drupal/Core/Validation/Plugin/Validation/Constraint/EmailConstraint.php, line 15

Namespace

Drupal\Core\Validation\Plugin\Validation\Constraint
View source
class EmailConstraint extends Email {
    
    /**
     * {@inheritdoc}
     */
    public function __construct(...$args) {
        $this->mode = static::VALIDATION_MODE_STRICT;
        parent::__construct(...$args);
    }
    
    /**
     * {@inheritdoc}
     */
    public function validatedBy() : string {
        return EmailValidator::class;
    }

}

Members

Title Sort descending Modifiers Object type Summary
EmailConstraint::validatedBy public function
EmailConstraint::__construct public function

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