getAttribute('startLine') - 1, $node->getAttribute('startColumn') - 1), new Position($node->getAttribute('endLine') - 1, $node->getAttribute('endColumn')) ); } public function __construct(Position $start = null, Position $end = null) { $this->start = $start; $this->end = $end; } /** * Checks if a position is within the range * * @param Position $position * @return bool */ public function includes(Position $position): bool { return $this->start->compare($position) <= 0 && $this->end->compare($position) >= 0; } }