Processes the service override configuration into the container.

@param ContainerBuilder $container
@param array            $services
972979
private function overrideServices(ContainerBuilder $container, array $services)
    {
        $serviceConfig = array(
            'auth_handler' => 'ma27_api_key_authentication.auth_handler',
            'key_factory'  => 'ma27_api_key_authentication.key_factory',
        );

        foreach ($serviceConfig as $configIndex => $replaceableServiceId) {
            if (!isset($services[$configIndex]) || null === $serviceId = $services[$configIndex]) {
                continue;
            }

            $container->removeDefinition($replaceableServiceId);
            $container->setAlias($replaceableServiceId, new Alias($serviceId));
        }
    }
1055870
public function process(ContainerBuilder $container)
    {
        $taggedServices = $container->findTaggedServiceIds($this->tagName);
        foreach ($taggedServices as $id => $tags) {

            $reference = new Reference($id);
            foreach ($tags as $attr) {

                $tag = $this->getAttribute($id, $attr, 'tag');
                $method = $this->getAttribute($id, $attr, 'method');

                $this->injectInto($reference, $container, $tag, $method);
            }
        }
    }
258163
public function process(ContainerBuilder $container)
    {
        $taggedServiceIds = $container->findTaggedServiceIds('p2_ratchet.application');
        $events = array();

        foreach ($taggedServiceIds as $serviceId => $attributes) {
            $service = $container->getDefinition($serviceId);

            /** @var \P2\Bundle\RatchetBundle\WebSocket\ApplicationInterface $classname */
            $classname = $container->getParameterBag()->resolveValue($service->getClass());

            $eventList = array_keys($classname::getSubscribedEvents());
            $events = array_merge($events, $eventList);
        }

        $container
            ->getDefinition('p2_ratchet.websocket.server_bridge')
            ->addMethodCall('setAllowedEvents', array($events));
    }
639283
public function load(array $configs, ContainerBuilder $container)
    {
        $configuration = new Configuration();
        $this->config = $this->processConfiguration($configuration, $configs);

        foreach (ServicesFactory::getAvailableServices() as $service) {
            $serviceKey = StringUtil::camelcaseToUnderscore($service);
            $definition = new Definition('Aws\\'.$service.'\\'.$service.'Client', array($this->getConfig($serviceKey)));
            $definition->setPublic(true);
            $container->setDefinition('aws.'.$serviceKey, $definition);
        }
    }
615478
public function process(ContainerBuilder $container)
    {
        $taggedServices = $container->findTaggedServiceIds(
            'elcodi.rule_context'
        );

        $contextProviders = [];
        foreach ($taggedServices as $id => $attributes) {
            $contextProviders[] = new Reference($id);
        }

        $definition = $container->getDefinition(
            'elcodi.expression_language_context_collector'
        );

        $definition->addArgument($contextProviders);
    }
703810
public function load(array $configs, ContainerBuilder $container)
    {
        $configuration = $this->createConfiguration();
        $this->globalConfig = $this->processConfiguration($configuration, $configs);

        $container->setParameter($this->rootAlias.'.configuration', $this->globalConfig);

        parent::load($configs, $container);
    }
777066
public function process(ContainerBuilder $container)
    {
        if (!$container->hasDefinition($this->subjectService)) {
            return;
        }

        $subjects = $this->findTaggedServices($container, $this->subjectTag, SubjectInterface::class, 'support', false);

        $subjectDefinition = $container->getDefinition($this->subjectService);
        $subjectDefinition->replaceArgument(0, $subjects);
    }
520711
public function process(ContainerBuilder $container)
    {
        // Now, let's store the registry in the container (an empty version of it... it will be dynamically added at runtime):
        $this->registerRegistry($container);

        $registry = $this->registryProvider->getRegistry($container);

        // Note: in the 'boot' method of a bundle, the container is available.
        // We use that to push the lazy array in the container.
        // The lazy array can be used by the registry that is also part of the container.
        // The registry can itself be used by a factory that creates services!

        $this->registerAcclimatedContainer($container);

        foreach ($registry as $serviceProviderKey => $serviceProvider) {
            $this->registerFactories($serviceProviderKey, $serviceProvider, $container);
        }

        foreach ($registry as $serviceProviderKey => $serviceProvider) {
            $this->registerExtensions($serviceProviderKey, $serviceProvider, $container);
        }
    }
178182
public function process(ContainerBuilder $container)
    {
        if (!$container->has($this->serviceId)) {
            return;
        }
        $definition = $container->findDefinition($this->serviceId);
        $handlers = array();
        $this->collectServiceIds(
            $container,
            $this->tag,
            $this->keyAttribute,
            function ($key, $serviceId, array $tagAttributes) use (&$handlers) {
                if (isset($tagAttributes['method'])) {
                    $callable = [$serviceId, $tagAttributes['method']];
                } else {
                    $callable = $serviceId;
                }
                $handlers[ltrim($key, '\\')] = $callable;
            }
        );
        $definition->replaceArgument(0, $handlers);
    }
1143906
public function load(array $configs, ContainerBuilder $container)
    {
        $configuration = new Configuration();

        $config = $this->processConfiguration($configuration, $configs);

        $container->setParameter(
            static::OVERRIDE_KERNEL_TEMPLATES_PARAM_NAME,
            $config['override_kernel_templates']
        );
    }
511257
public function process(ContainerBuilder $container): void
    {
        if (true === self::enabled($container))
        {
            $excludedFiles = canonicalizeFilesPath(self::getExcludedFiles($container));

            $files = searchFiles(self::getDirectories($container), '/\.php/i');

            $this->registerClasses($container, $files, $excludedFiles);
        }
    }
220317
public function load(array $configs, ContainerBuilder $container)
    {
        $configuration = new Configuration();
        $processedConfiguration = $this->processConfiguration($configuration, $configs);
        $loader = new Loader\XmlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config'));
        $loader->load('services.xml');

        $this->passConfigurationToOptions($container, $processedConfiguration);

        $container->getDefinition(ClientBuilderInterface::class)
            ->setConfigurator([ClientBuilderConfigurator::class, 'configure']);

        foreach ($processedConfiguration['listener_priorities'] as $key => $priority) {
            $container->setParameter('sentry.listener_priorities.' . $key, $priority);
        }

        $this->tagConsoleErrorListener($container);
    }
1334978
public function process(ContainerBuilder $container)
    {
        $configs = $container->getExtensionConfig('nova_ezseo');

        //@todo: How to do that by SiteAccess
        if (isset($configs[0]['system']['default']['custom_fallback_service'])) {
            $fallbackService = $configs[0]['system']['default']['custom_fallback_service'];
            if ($fallbackService !== null) {
                $container->getDefinition('novactive.novaseobundle.twig_extension')->addMethodCall(
                    "setCustomFallbackService",
                    [new Reference($fallbackService)]
                );
            }
        }
    }
184579
public function process(ContainerBuilder $container): void
    {
        $loggerDefinition = $container->getDefinition('service_bus.logger');

        if (NullLogger::class === $loggerDefinition->getClass())
        {
            $loggerDefinition->setClass(Logger::class);
            $loggerDefinition->setArguments(['%service_bus.entry_point%']);
        }

        $processors = [
            PsrLogMessageProcessor::class,
            MemoryUsageProcessor::class,
            ProcessIdProcessor::class,
        ];

        foreach ($processors as $processor)
        {
            $container->addDefinitions([$processor => new Definition($processor)]);
            $loggerDefinition->addMethodCall(
                'pushProcessor',
                [new Reference($processor)]
            );
        }
    }
258765
public function load(array $configs, ContainerBuilder $container)
    {
        // Parse configuration
        $configuration = new Configuration();
        $config = $this->processConfiguration($configuration, $configs);

        $loader = new XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));

        // Toolbar
        $loader->load('toolbar.xml');
        if ($config['toolbar'] === 'demo') {
            $mode = ToolbarListener::DEMO;
        }
        else if ($config['toolbar']) {
            $mode = ToolbarListener::ENABLED;
        }
        else {
            $mode = ToolbarListener::DISABLED;
        }

        // Other Services
        $loader->load('services.xml');

        // Set parameter
        $container->setParameter('terrific_composer.toolbar.mode', $mode);
        $container->setParameter('terrific_composer.composition.bundles', $config['composition_bundles']);
        $container->setParameter('terrific_composer.module.layout', $config['module_layout']);
        $container->setParameter('terrific_composer.module.template', $config['module_template']);
    }
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);
    }
11593
public function process(ContainerBuilder $container)
    {
        if (
            $container->hasDefinition("nelmio_api_doc.parser.jms_metadata_parser") &&
            (
                $container->getAlias("fos_rest.serializer") == "tpg_extjs.orm_serializer" ||
                $container->getAlias("fos_rest.serializer") == "tpg_extjs.odm_serializer" ||
                $container->getAlias("fos_rest.serializer") == "tpg_extjs.serializer"
            )
        ) {
            $container
                ->getDefinition("nelmio_api_doc.parser.jms_metadata_parser")
                ->replaceArgument(1, new Reference("tpg_extjs.naming_strategy"));
        }
    }