Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. ConstExprParser.php

function ConstExprParser::parseArray

1 call to ConstExprParser::parseArray()
ConstExprParser::parse in vendor/phpstan/phpdoc-parser/src/Parser/ConstExprParser.php

File

vendor/phpstan/phpdoc-parser/src/Parser/ConstExprParser.php, line 250

Class

ConstExprParser

Namespace

PHPStan\PhpDocParser\Parser

Code

private function parseArray(TokenIterator $tokens, int $endToken, int $startIndex) : Ast\ConstExpr\ConstExprArrayNode {
    $items = [];
    $startLine = $tokens->currentTokenLine();
    if (!$tokens->tryConsumeTokenType($endToken)) {
        do {
            $items[] = $this->parseArrayItem($tokens);
        } while ($tokens->tryConsumeTokenType(Lexer::TOKEN_COMMA) && !$tokens->isCurrentTokenType($endToken));
        $tokens->consumeTokenType($endToken);
    }
    return $this->enrichWithAttributes($tokens, new Ast\ConstExpr\ConstExprArrayNode($items), $startLine, $startIndex);
}
RSS feed
Powered by Drupal