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

Breadcrumb

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

function DomainPart::checkLabelLength

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

File

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

Class

DomainPart

Namespace

Egulias\EmailValidator\Parser

Code

private function checkLabelLength(bool $isEndOfDomain = false) : Result {
    if ($this->lexer->current
        ->isA(EmailLexer::S_DOT) || $isEndOfDomain) {
        if ($this->isLabelTooLong($this->label)) {
            return new InvalidEmail(new LabelTooLong(), $this->lexer->current->value);
        }
        $this->label = '';
    }
    $this->label .= $this->lexer->current->value;
    return new ValidEmail();
}
RSS feed
Powered by Drupal