PDepend\Source\Language\PHP\AbstractPHPParser::setNodePositionsAndReturn PHP Method

setNodePositionsAndReturn() protected method

This method configures the given node with its start and end positions.
Since: 0.9.8
protected setNodePositionsAndReturn ( PDepend\Source\AST\ASTNode $node, array &$tokens = null ) : PDepend\Source\AST\ASTNode
$node PDepend\Source\AST\ASTNode
$tokens array
return PDepend\Source\AST\ASTNode
    protected function setNodePositionsAndReturn(ASTNode $node, array &$tokens = null)
    {
        $tokens = $this->stripTrailingComments($this->tokenStack->pop());
        $end = $tokens[count($tokens) - 1];
        $start = $tokens[0];
        $node->configureLinesAndColumns($start->startLine, $end->endLine, $start->startColumn, $end->endColumn);
        return $node;
    }
AbstractPHPParser