You are here

protected function EmailLexer::getType in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/egulias/email-validator/src/Egulias/EmailValidator/EmailLexer.php \Egulias\EmailValidator\EmailLexer::getType()

Retrieve token type. Also processes the token value if necessary.

Parameters

string $value:

Return value

integer

Throws

\InvalidArgumentException

Overrides AbstractLexer::getType

File

vendor/egulias/email-validator/src/Egulias/EmailValidator/EmailLexer.php, line 166

Class

EmailLexer

Namespace

Egulias\EmailValidator

Code

protected function getType(&$value) {
  if ($this
    ->isNullType($value)) {
    return self::C_NUL;
  }
  if ($this
    ->isValid($value)) {
    return $this->charValue[$value];
  }
  if ($this
    ->isUTF8Invalid($value)) {
    $this->hasInvalidTokens = true;
    return self::INVALID;
  }
  return self::GENERIC;
}