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

Breadcrumb

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

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

DoubleQuote

Namespace

Egulias\EmailValidator\Parser

Code

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();
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal