position = $position; } public function leaveNode(Node $node) { if ($this->node === null) { $range = Range::fromNode($node); if ($range->includes($this->position)) { $this->node = $node; return NodeTraverser::STOP_TRAVERSAL; } } } }