EmailConstraint.php
Same filename in other branches
Namespace
Drupal\Core\Validation\Plugin\Validation\ConstraintFile
-
core/
lib/ Drupal/ Core/ Validation/ Plugin/ Validation/ Constraint/ EmailConstraint.php
View source
<?php
namespace Drupal\Core\Validation\Plugin\Validation\Constraint;
use Drupal\Core\StringTranslation\TranslatableMarkup;
use Drupal\Core\Validation\Attribute\Constraint;
use Symfony\Component\Validator\Constraints\Email;
use Symfony\Component\Validator\Constraints\EmailValidator;
/**
* Count constraint.
*
* Overrides the symfony constraint to use the strict setting.
*/
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;
}
}
Classes
Title | Deprecated | Summary |
---|---|---|
EmailConstraint | Count constraint. |
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.