src/Configuration/Compiler/PhpParserCompilerPass.php
public function process(ContainerBuilder $container)
    {
        $traverserConfigurator = $container->findDefinition('grumphp.parser.php.configurator.traverser');
        foreach ($container->findTaggedServiceIds(self::TAG) as $id => $tags) {
            $definition = $container->findDefinition($id);
            $this->markServiceAsPrototype($definition);
            foreach ($tags as $tag) {
                $alias = array_key_exists('alias', $tag) ? $tag['alias'] : $id;
                $traverserConfigurator->addMethodCall('registerVisitorId', [$alias, $id]);
            }
        }
    }
public function process(ContainerBuilder $container)
    {
        $traverserConfigurator = $container->findDefinition('grumphp.parser.php.configurator.traverser');
        foreach ($container->findTaggedServiceIds(self::TAG) as $id => $tags) {
            $definition = $container->findDefinition($id);
            $this->markServiceAsPrototype($definition);
            foreach ($tags as $tag) {
                $alias = array_key_exists('alias', $tag) ? $tag['alias'] : $id;
                $traverserConfigurator->addMethodCall('registerVisitorId', [$alias, $id]);
            }
        }
    }
public function process ( ContainerBuilder $ container ) { $ traverserConfigurator = $ container -> findDefinition ( 'grumphp.parser.php.configurator.traverser' ) ; foreach ( $ container -> findTaggedServiceIds ( self :: TAG ) as $ id => $ tags ) { $ definition = $ container -> findDefinition ( $ id ) ; $ this -> markServiceAsPrototype ( $ definition ) ; foreach ( $ tags as $ tag ) { $ alias = array_key_exists ( 'alias' , $ tag ) ? $ tag [ 'alias' ] : $ id ; $ traverserConfigurator -> addMethodCall ( 'registerVisitorId' , [ $ alias , $ id ] ) ; } } }
Sets the visitors as non shared services.
This will make sure that the state of the visitor won't need to be reset after an iteration of the traverser.

All visitor Ids are registered in the traverser configurator.
The configurator will be used to apply the configured visitors to the traverser.


@throws \Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException
@throws \Symfony\Component\DependencyInjection\Exception\InvalidArgumentException
Sets the visitors as non shared services . This will make sure that the state of the visitor won t need to be reset after an iteration of the traverser .