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
Namespace
Egulias\EmailValidator\ParserCode
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();
}