EmailConstraint.php
Same filename and directory in other branches
- 11.x core/lib/Drupal/Core/Validation/Plugin/Validation/Constraint/EmailConstraint.php
- 10 core/lib/Drupal/Core/Validation/Plugin/Validation/Constraint/EmailConstraint.php
- 9 core/lib/Drupal/Core/Validation/Plugin/Validation/Constraint/EmailConstraint.php
- 8.9.x core/lib/Drupal/Core/Validation/Plugin/Validation/Constraint/EmailConstraint.php
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\Attribute\HasNamedArguments;
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(?array $options = NULL, ?string $message = NULL, ?string $mode = NULL, ?callable $normalizer = NULL, ?array $groups = NULL, mixed $payload = NULL) {
parent::__construct($options, $message, $mode, $normalizer, $groups, $payload);
$this->mode = static::VALIDATION_MODE_STRICT;
}
/**
* {@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.