You are here

public function TokenStream::getNextIdentifierOrStar in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/css-selector/Parser/TokenStream.php \Symfony\Component\CssSelector\Parser\TokenStream::getNextIdentifierOrStar()

Returns nex identifier or star delimiter token.

Return value

null|string The identifier token value or null if star found

Throws

SyntaxErrorException If next token is not an identifier or a star delimiter

File

vendor/symfony/css-selector/Parser/TokenStream.php, line 156

Class

TokenStream
CSS selector token stream.

Namespace

Symfony\Component\CssSelector\Parser

Code

public function getNextIdentifierOrStar() {
  $next = $this
    ->getNext();
  if ($next
    ->isIdentifier()) {
    return $next
      ->getValue();
  }
  if ($next
    ->isDelimiter(array(
    '*',
  ))) {
    return;
  }
  throw SyntaxErrorException::unexpectedToken('identifier or "*"', $next);
}