public function afterAdoptNode(NodeInterface $node, Context $context, $recursive) { if (!$this->eventEmittingService->isEnabled()) { return; } $this->currentlyAdopting--; if ($this->currentlyAdopting === 0) { $this->eventEmittingService->popContext(); } }