function ParserAbstract::getAttributes
Get attributes for a node with the given start and end token positions.
Parameters
int $tokenStartPos Token position the node starts at:
int $tokenEndPos Token position the node ends at:
Return value
array<string, mixed> Attributes
3 calls to ParserAbstract::getAttributes()
- ParserAbstract::getAttributesAt in vendor/
nikic/ php-parser/ lib/ PhpParser/ ParserAbstract.php - Get combined start and end attributes at a stack location
- ParserAbstract::getAttributesForToken in vendor/
nikic/ php-parser/ lib/ PhpParser/ ParserAbstract.php - Get attributes for a single token at the given token position.
- ParserAbstract::maybeCreateNop in vendor/
nikic/ php-parser/ lib/ PhpParser/ ParserAbstract.php
File
-
vendor/
nikic/ php-parser/ lib/ PhpParser/ ParserAbstract.php, line 481
Class
Namespace
PhpParserCode
protected function getAttributes(int $tokenStartPos, int $tokenEndPos) : array {
$startToken = $this->tokens[$tokenStartPos];
$afterEndToken = $this->tokens[$tokenEndPos + 1];
return [
'startLine' => $startToken->line,
'startTokenPos' => $tokenStartPos,
'startFilePos' => $startToken->pos,
'endLine' => $afterEndToken->line,
'endTokenPos' => $tokenEndPos,
'endFilePos' => $afterEndToken->pos - 1,
];
}