function ConstExprParser::enrichWithAttributes
* @template T of Ast\ConstExpr\ConstExprNode *
Parameters
T $node: * @return T
3 calls to ConstExprParser::enrichWithAttributes()
- ConstExprParser::parse in vendor/
phpstan/ phpdoc-parser/ src/ Parser/ ConstExprParser.php - ConstExprParser::parseArray in vendor/
phpstan/ phpdoc-parser/ src/ Parser/ ConstExprParser.php - ConstExprParser::parseArrayItem in vendor/
phpstan/ phpdoc-parser/ src/ Parser/ ConstExprParser.php
File
-
vendor/
phpstan/ phpdoc-parser/ src/ Parser/ ConstExprParser.php, line 318
Class
Namespace
PHPStan\PhpDocParser\ParserCode
private function enrichWithAttributes(TokenIterator $tokens, Ast\ConstExpr\ConstExprNode $node, int $startLine, int $startIndex) : Ast\ConstExpr\ConstExprNode {
if ($this->useLinesAttributes) {
$node->setAttribute(Ast\Attribute::START_LINE, $startLine);
$node->setAttribute(Ast\Attribute::END_LINE, $tokens->currentTokenLine());
}
if ($this->useIndexAttributes) {
$node->setAttribute(Ast\Attribute::START_INDEX, $startIndex);
$node->setAttribute(Ast\Attribute::END_INDEX, $tokens->endIndexOfLastRelevantToken());
}
return $node;
}