class EmailValidator
Same name in this branch
- 10 core/lib/Drupal/Core/Validation/Plugin/Validation/Constraint/EmailValidator.php \Drupal\Core\Validation\Plugin\Validation\Constraint\EmailValidator
Same name in other branches
- 9 core/lib/Drupal/Component/Utility/EmailValidator.php \Drupal\Component\Utility\EmailValidator
- 8.9.x core/lib/Drupal/Component/Utility/EmailValidator.php \Drupal\Component\Utility\EmailValidator
- 11.x core/lib/Drupal/Core/Validation/Plugin/Validation/Constraint/EmailValidator.php \Drupal\Core\Validation\Plugin\Validation\Constraint\EmailValidator
- 11.x core/lib/Drupal/Component/Utility/EmailValidator.php \Drupal\Component\Utility\EmailValidator
Validates email addresses.
Hierarchy
- class \Drupal\Component\Utility\EmailValidator extends \Egulias\EmailValidator\EmailValidator implements \Drupal\Component\Utility\EmailValidatorInterface
Expanded class hierarchy of EmailValidator
1 file declares its use of EmailValidator
- EmailValidatorTest.php in core/
tests/ Drupal/ Tests/ Component/ Utility/ EmailValidatorTest.php
1 string reference to 'EmailValidator'
- core.services.yml in core/
core.services.yml - core/core.services.yml
1 service uses EmailValidator
File
-
core/
lib/ Drupal/ Component/ Utility/ EmailValidator.php, line 12
Namespace
Drupal\Component\UtilityView source
class EmailValidator extends EmailValidatorUtility implements EmailValidatorInterface {
/**
* Validates an email address.
*
* @param string $email
* A string containing an email address.
* @param \Egulias\EmailValidator\Validation\EmailValidation|null $email_validation
* This argument is ignored. If it is supplied an error will be triggered.
* See https://www.drupal.org/node/2997196.
*
* @return bool
* TRUE if the address is valid.
*/
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());
}
}
Members
Title Sort descending | Modifiers | Object type | Summary |
---|---|---|---|
EmailValidator::isValid | public | function | Validates an email address. |
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.