Setup pools.

@param ContainerBuilder $container
@throws InvalidArgumentException
@return void
971769
private function setupPools(ContainerBuilder $container)
    {
        $pools = $container->getParameter('gendoria_command_queue.pools');
        $usedServiceIds = array();
        foreach ($pools as $poolData) {
            $sendServiceId = substr($poolData['send_driver'], 1);
            if (in_array($sendServiceId, $usedServiceIds)) {
                throw new InvalidArgumentException(sprintf(
                    'Each pool has to have unique send service - duplicate service id "%s" found.',
                    $sendServiceId
                ));
            }
            if (!$container->hasDefinition($sendServiceId)) {
                throw new InvalidArgumentException('Non existing send driver service provided: ' . $poolData['send_driver'].'.');
            }
            $sendDriverReflection = new ReflectionClass($container->getDefinition($sendServiceId)->getClass());
            if (!$sendDriverReflection->implementsInterface(SendDriverInterface::class)) {
                throw new InvalidArgumentException(sprintf(
                    'Service "%s" does not implement interface "%s".',
                    $sendServiceId,
                    SendDriverInterface::class
                ));
            }
            $usedServiceIds[] = $sendServiceId;
        }
    }
63734
public function process(ContainerBuilder $container)
    {
        $manager = $container->findDefinition(self::MANAGER_ID);

        $serviceIds = $container->findTaggedServiceIds(self::WORKER_RUNNER_TAG);
        foreach ($serviceIds as $serviceId => $tags) {
            $this->addManagerCalls($container, $manager, $serviceId, $tags);
        }
    }
681391
public function process(ContainerBuilder $container)
    {
        $this->container = $container;
        foreach ($container->getDefinitions() as $definition) {
            if ($definition->isSynthetic() || $definition->isAbstract()) {
                continue;
            }

            $definition->setArguments(
                $this->processArguments($definition->getArguments())
            );

            $calls = array();
            foreach ($definition->getMethodCalls() as $call) {
                try {
                    $calls[] = array($call[0], $this->processArguments($call[1], true));
                } catch (RuntimeException $e) {
                    // this call is simply removed
                }
            }
            $definition->setMethodCalls($calls);

            $properties = array();
            foreach ($definition->getProperties() as $name => $value) {
                try {
                    $value = $this->processArguments(array($value), true);
                    $properties[$name] = reset($value);
                } catch (RuntimeException $e) {
                    // ignore property
                }
            }
            $definition->setProperties($properties);
        }
    }
1182861
public function process(ContainerBuilder $container)
    {
        $serviceName = $container->getParameter('o_auth2_server.user_provider');

        if ($container->hasAlias($serviceName)) {
            $serviceName = (string) $container->getAlias($serviceName); // to service id
        }

        if (!$container->hasDefinition($serviceName)) {
            throw new InvalidConfigurationException("Service or alias '$serviceName' does not exist.");
        }

        $service = $container->getDefinition($serviceName);

        if (!is_subclass_of($service->getClass(), 'Symfony\\Component\\Security\\Core\\User\\UserProviderInterface')) {
            throw new InvalidConfigurationException(
                "Service '$serviceName' has to implement Symfony\\Component\\Security\\Core\\User\\UserProviderInterface."
            );
        }

        $container->setAlias('o_auth2_server.user_provider', $serviceName);
    }
1255770
public function build(ContainerBuilder $container): void
    {
        parent::build($container);

        $container->addCompilerPass(new AddMenuVotersPass());
        $container->addCompilerPass(new ReplaceMenuMatcherPass());
        $container->addCompilerPass(new ConfigureAmazonMetaPass());
    }
265403
public function process(ContainerBuilder $container)
    {
        if (!$container->hasDefinition($this->processorFactoryService) && !$container->hasAlias($this->processorFactoryService)) {
            return;
        }

        $dispatcher = $container->findDefinition($this->processorFactoryService);

        foreach ($container->findTaggedServiceIds($this->listenerTag) as $id => $tags) {
            $def = $container->getDefinition($id);
            $this->assertProcessorDefinition($def, $id);
            foreach ($tags as $attributes) {
                if (empty($attributes['command'])) {
                    throw new InvalidArgumentException(sprintf('The service "%s" is tagged as processor without specifying "command" attribute', $id));
                }
                $dispatcher->addMethodCall('registerProcessorIdForCommand', array(
                    $attributes['command'],
                    $id,
                ));
            }
        }
    }
701556
public function prepend(ContainerBuilder $container)
    {
        $bundles = $container->getParameter('kernel.bundles');
        foreach ($bundles as $bundle => $class) {
            if (method_exists($this, 'prepend' . $bundle)) {
                call_user_func_array(array($this, 'prepend' . $bundle), array($container));
            }
        }
    }
1084619
public function build(ContainerBuilder $container)
    {
        parent::build($container);

        $container->addCompilerPass(new MenuBuilderOptionsPass(), PassConfig::TYPE_AFTER_REMOVING);
    }
492409
public function build(ContainerBuilder $container)
    {
        parent::build($container);

        $container->addCompilerPass(new ShardingPass());
        $container->addCompilerPass(new CustomIteratorsPass());
        $container->addCompilerPass(new PackageCompilersPass());
    }
731184
public function process(ContainerBuilder $container): void
    {
        if (!$container->hasDefinition(Aggregator::class)) {
            return;
        }

        $aggregatorDefinition = $container->getDefinition(Aggregator::class);
        $taggedServiceIds = $container->findTaggedServiceIds(self::TAG_CONFIG_PROVIDER);

        foreach ($taggedServiceIds as $taggedServiceId => $tags) {
            foreach ($tags as $tag) {
                $key = $tag['key'] ?? $taggedServiceId;
                $aggregatorDefinition->addMethodCall('addProvider', [$key, new Reference($taggedServiceId)]);
            }
        }
    }
521863
public function build(ContainerBuilder $container)
    {
        parent::build($container);

        /**
         * Adds compiler pass.
         */
        $container
            ->addCompilerPass(new MappingCompilerPass())
            ->addCompilerPass(new ContextCompilerPass())
            ->addCompilerPass(new ExpressionLanguageCompilerPass());
    }
588382
public function process(ContainerBuilder $container): void
    {
        $container->setParameter('service_bus.logger.echo.log_level', $this->logLevel);

        $container->addDefinitions(
            [
                StdOutHandler::class => (new Definition(StdOutHandler::class))->setArguments(['%service_bus.logger.echo.log_level%']),
            ]
        );

        (new LoggerCompilerPass())->process($container);

        $loggerDefinition = $container->getDefinition('service_bus.logger');

        $loggerDefinition->addMethodCall(
            'pushHandler',
            [new Reference(StdOutHandler::class)]
        );
    }
847167
public function process(ContainerBuilder $container)
    {
        $checkers = array();
        foreach ($container->findTaggedServiceIds('avoo.resource_generator.template') as $id => $attributes) {
            $checkers[$attributes[0]['type']] = $id;
        }

        $container->setParameter('avoo.resource_generator.templates', $checkers);
    }
653685
public function prepend(ContainerBuilder $container)
    {
        $configs = $container->getExtensionConfig($this->getAlias());
        $config = $this->processConfiguration(new Configuration(), $configs);

        $bundles = $container->getParameter('kernel.bundles');

        // Publish assetic assets if desired
        if ($config['assets']['publish'] && isset($bundles['AsseticBundle'])) {
            $container->prependExtensionConfig('assetic', array('assets' => $this->getAssets($config)));
        }
    }
350821
public function build(ContainerBuilder $container)
    {
        parent::build($container);
        $container->addCompilerPass(new TransportCompilerPass());
        $container->addCompilerPass(new SpoolCompilerPass());
    }
1321203
public function process(ContainerBuilder $container)
    {
        $parameterBag = $container->getParameterBag();

        $parameterReplacer = $container->get(ServiceNames::PARAMETER_REPLACER);

        $parameterReplacer->processParameterBag($parameterBag, $container);
    }
1252491
public function build(ContainerBuilder $container)
    {
        $container->addCompilerPass(
            new GenericCompilerPass(
                AttributeTypeRegistry::class,
                'sidus.attribute_type',
                'addType'
            )
        );
        $container->addCompilerPass(
            new GenericCompilerPass(
                AttributeRegistry::class,
                'sidus.attribute',
                'addAttribute'
            )
        );
        $container->addCompilerPass(
            new GenericCompilerPass(
                FamilyRegistry::class,
                'sidus.family',
                'addFamily'
            )
        );
    }