function DocParser::matchAny

Same name and namespace in other branches
  1. 9 core/lib/Drupal/Component/Annotation/Doctrine/DocParser.php \Drupal\Component\Annotation\Doctrine\DocParser::matchAny()
  2. 8.9.x core/lib/Drupal/Component/Annotation/Doctrine/DocParser.php \Drupal\Component\Annotation\Doctrine\DocParser::matchAny()
  3. 10 core/lib/Drupal/Component/Annotation/Doctrine/DocParser.php \Drupal\Component\Annotation\Doctrine\DocParser::matchAny()

Attempts to match the current lookahead token with any of the given tokens.

If any of them matches, this method updates the lookahead token; otherwise a syntax error is raised.

Parameters

array $tokens:

Return value

boolean

2 calls to DocParser::matchAny()
DocParser::ArrayEntry in core/lib/Drupal/Component/Annotation/Doctrine/DocParser.php
ArrayEntry ::= Value | KeyValuePair KeyValuePair ::= Key ("=" | ":") PlainValue | Constant Key ::= string | integer | Constant
DocParser::Identifier in core/lib/Drupal/Component/Annotation/Doctrine/DocParser.php
Identifier ::= string

File

core/lib/Drupal/Component/Annotation/Doctrine/DocParser.php, line 392

Class

DocParser
A parser for docblock annotations.

Namespace

Drupal\Component\Annotation\Doctrine

Code

private function matchAny(array $tokens) {
    if (!$this->lexer
        ->isNextTokenAny($tokens)) {
        $this->syntaxError(implode(' or ', array_map(array(
            $this->lexer,
            'getLiteral',
        ), $tokens)));
    }
    return $this->lexer
        ->moveNext();
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.