src/PhpDocument.php
public function getNodeAtPosition(Position $position)
    {
        if ($this->sourceFileNode === null) {
            return null;
        }

        $offset = $position->toOffset($this->sourceFileNode->getFileContents());
        $node = $this->sourceFileNode->getDescendantNodeAtPosition($offset);
        if ($node !== null && $node->getStart() > $offset) {
            return null;
        }
        return $node;
    }
public function getNodeAtPosition(Position $position)
    {
        if ($this->sourceFileNode === null) {
            return null;
        }

        $offset = $position->toOffset($this->sourceFileNode->getFileContents());
        $node = $this->sourceFileNode->getDescendantNodeAtPosition($offset);
        if ($node !== null && $node->getStart() > $offset) {
            return null;
        }
        return $node;
    }
public function getNodeAtPosition ( Position $ position ) { if ( $ this -> sourceFileNode === null ) { return null ; } $ offset = $ position -> toOffset ( $ this -> sourceFileNode -> getFileContents ( ) ) ; $ node = $ this -> sourceFileNode -> getDescendantNodeAtPosition ( $ offset ) ; if ( $ node !== null && $ node -> getStart ( ) > $ offset ) { return null ; } return $ node ; }
Returns the node at a specified position

@param Position $position
@return Node|null
Returns the node at a specified position