You are here

protected function DomainPart::hasBrackets in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/egulias/email-validator/src/Egulias/EmailValidator/Parser/DomainPart.php \Egulias\EmailValidator\Parser\DomainPart::hasBrackets()
1 call to DomainPart::hasBrackets()
DomainPart::doParseDomainPart in vendor/egulias/email-validator/src/Egulias/EmailValidator/Parser/DomainPart.php

File

vendor/egulias/email-validator/src/Egulias/EmailValidator/Parser/DomainPart.php, line 279

Class

DomainPart

Namespace

Egulias\EmailValidator\Parser

Code

protected function hasBrackets() {
  if ($this->lexer->token['type'] !== EmailLexer::S_OPENBRACKET) {
    return false;
  }
  try {
    $this->lexer
      ->find(EmailLexer::S_CLOSEBRACKET);
  } catch (\RuntimeException $e) {
    throw new \InvalidArgumentException('ERR_EXPECTING_DOMLIT_CLOSE');
  }
  return true;
}