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

Breadcrumb

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

function FoldingWhiteSpace::checkCRLFInFWS

1 call to FoldingWhiteSpace::checkCRLFInFWS()
FoldingWhiteSpace::parse in vendor/egulias/email-validator/src/Parser/FoldingWhiteSpace.php

File

vendor/egulias/email-validator/src/Parser/FoldingWhiteSpace.php, line 61

Class

FoldingWhiteSpace

Namespace

Egulias\EmailValidator\Parser

Code

protected function checkCRLFInFWS() : Result {
    if (!$this->lexer->current
        ->isA(EmailLexer::CRLF)) {
        return new ValidEmail();
    }
    if (!$this->lexer
        ->isNextTokenAny(array(
        EmailLexer::S_SP,
        EmailLexer::S_HTAB,
    ))) {
        return new InvalidEmail(new CRLFX2(), $this->lexer->current->value);
    }
    
    //this has no coverage. Condition is repeated from above one
    if (!$this->lexer
        ->isNextTokenAny(array(
        EmailLexer::S_SP,
        EmailLexer::S_HTAB,
    ))) {
        return new InvalidEmail(new CRLFAtTheEnd(), $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