You are here

protected function LocalPart::isInvalidToken in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/egulias/email-validator/src/Egulias/EmailValidator/Parser/LocalPart.php \Egulias\EmailValidator\Parser\LocalPart::isInvalidToken()
1 call to LocalPart::isInvalidToken()
LocalPart::parse in vendor/egulias/email-validator/src/Egulias/EmailValidator/Parser/LocalPart.php

File

vendor/egulias/email-validator/src/Egulias/EmailValidator/Parser/LocalPart.php, line 104

Class

LocalPart

Namespace

Egulias\EmailValidator\Parser

Code

protected function isInvalidToken($token, $closingQuote) {
  $forbidden = array(
    EmailLexer::S_COMMA,
    EmailLexer::S_CLOSEBRACKET,
    EmailLexer::S_OPENBRACKET,
    EmailLexer::S_GREATERTHAN,
    EmailLexer::S_LOWERTHAN,
    EmailLexer::S_COLON,
    EmailLexer::S_SEMICOLON,
    EmailLexer::INVALID,
  );
  if (in_array($token['type'], $forbidden) && !$closingQuote) {
    throw new \InvalidArgumentException('ERR_EXPECTING_ATEXT');
  }
}