Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. DomainPart.php

function DomainPart::checkEmptyDomain

1 call to DomainPart::checkEmptyDomain()
DomainPart::performDomainStartChecks in vendor/egulias/email-validator/src/Parser/DomainPart.php

File

vendor/egulias/email-validator/src/Parser/DomainPart.php, line 112

Class

DomainPart

Namespace

Egulias\EmailValidator\Parser

Code

private function checkEmptyDomain() : Result {
    $thereIsNoDomain = $this->lexer->current
        ->isA(EmailLexer::S_EMPTY) || $this->lexer->current
        ->isA(EmailLexer::S_SP) && !$this->lexer
        ->isNextToken(EmailLexer::GENERIC);
    if ($thereIsNoDomain) {
        return new InvalidEmail(new NoDomainPart(), $this->lexer->current->value);
    }
    return new ValidEmail();
}
RSS feed
Powered by Drupal