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

Breadcrumb

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

function LocalPart::validateEscaping

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

File

vendor/egulias/email-validator/src/Parser/LocalPart.php, line 149

Class

LocalPart

Namespace

Egulias\EmailValidator\Parser

Code

private function validateEscaping() : Result {
    
    //Backslash found
    if (!$this->lexer->current
        ->isA(EmailLexer::S_BACKSLASH)) {
        return new ValidEmail();
    }
    if ($this->lexer
        ->isNextToken(EmailLexer::GENERIC)) {
        return new InvalidEmail(new ExpectingATEXT('Found ATOM after escaping'), $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