DependencyInjection/Compiler/RegisterRoutersPass.php
public function process(ContainerBuilder $container)
    {
        if (!$container->hasDefinition('ekyna_core.router')) {
            return;
        }

        $definition = $container->getDefinition('ekyna_core.router');

        // Gather routers
        $routers = [];
        if ($container->hasParameter('ekyna_core.chain_router.routers')) {
            $routers = $container->getParameter('ekyna_core.chain_router.routers');
        }
        foreach ($container->findTaggedServiceIds('router') as $id => $attributes) {
            $priority = isset($attributes[0]['priority']) ? $attributes[0]['priority'] : 0;
            $routers[$id] = $priority;
        }

        // Register routers
        foreach ($routers as $id => $priority) {
            $definition->addMethodCall('add', [new Reference($id), $priority]);
        }
    }
public function process(ContainerBuilder $container)
    {
        if (!$container->hasDefinition('ekyna_core.router')) {
            return;
        }

        $definition = $container->getDefinition('ekyna_core.router');

        // Gather routers
        $routers = [];
        if ($container->hasParameter('ekyna_core.chain_router.routers')) {
            $routers = $container->getParameter('ekyna_core.chain_router.routers');
        }
        foreach ($container->findTaggedServiceIds('router') as $id => $attributes) {
            $priority = isset($attributes[0]['priority']) ? $attributes[0]['priority'] : 0;
            $routers[$id] = $priority;
        }

        // Register routers
        foreach ($routers as $id => $priority) {
            $definition->addMethodCall('add', [new Reference($id), $priority]);
        }
    }
{@inheritdoc}