configurator = $configurator; } /** * @throws \GrumPHP\Exception\RuntimeException */ public function createForTaskContext(array $parserOptions, ParserContext $context): NodeTraverser { $this->configurator->registerOptions($parserOptions); $this->configurator->registerContext($context); $traverser = new NodeTraverser(); $this->configurator->configure($traverser); return $traverser; } }