function DoubleQuote::checkDQUOTE
1 call to DoubleQuote::checkDQUOTE()
- DoubleQuote::parse in vendor/
egulias/ email-validator/ src/ Parser/ DoubleQuote.php
File
-
vendor/
egulias/ email-validator/ src/ Parser/ DoubleQuote.php, line 73
Class
Namespace
Egulias\EmailValidator\ParserCode
protected function checkDQUOTE() : Result {
$previous = $this->lexer
->getPrevious();
if ($this->lexer
->isNextToken(EmailLexer::GENERIC) && $previous->isA(EmailLexer::GENERIC)) {
$description = 'https://tools.ietf.org/html/rfc5322#section-3.2.4 - quoted string should be a unit';
return new InvalidEmail(new ExpectingATEXT($description), $this->lexer->current->value);
}
try {
$this->lexer
->find(EmailLexer::S_DQUOTE);
} catch (\Exception $e) {
return new InvalidEmail(new UnclosedQuotedString(), $this->lexer->current->value);
}
$this->warnings[QuotedString::CODE] = new QuotedString($previous->value, $this->lexer->current->value);
return new ValidEmail();
}