Service container inti instructions
@param ContainerBuilder $container
@throws \Exception
500787
protected function initServiceContainer(Container $container)
    {
        $sr = new ServiceRegistrator($this->coreRoot, "Wpci\\Core\\", $container);

        $sr->exclude(Path::class);

        $sr->prepareArguments(View::class,
            [
                TemplateInterface::class => MustacheTemplate::class,
                ResponseInterface::class => WpResponse::class
            ]
        );

        $sr->walkDirForServices('Flow');
        $sr->walkDirForServices('DataSource');
        $sr->walkDirForServices('Helpers');
        $sr->walkDirForServices('Http');
        $sr->walkDirForServices('Render');
        $sr->walkDirForServices('Wordpress');

        $container->singleton('router-store', \Wpci\Core\Http\RouterStore::class);
        $container->instance('promise-pool.shutdown', new PromisePool());
    }
345437
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()));
            $definition->setMethodCalls($this->processArguments($definition->getMethodCalls()));
            $definition->setProperties($this->processArguments($definition->getProperties()));
            $definition->setFactory($this->processFactory($definition->getFactory()));
        }

        foreach ($container->getAliases() as $id => $alias) {
            $aliasId = (string) $alias;
            if ($aliasId !== $defId = $this->getDefinitionId($aliasId)) {
                $container->setAlias($id, new Alias($defId, $alias->isPublic()));
            }
        }
    }
785224
public function process(ContainerBuilder $container)
    {
        if (!$container->hasDefinition($this->serviceId)) {
            return;
        }

        $references = [];
        foreach ($container->findTaggedServiceIds($this->tagName) as $id => $tags) {
            $reference = new Reference($id);

            foreach ($tags as $attributes) {
                $references[$attributes[$this->aliasAttribute]] = $reference;
            }
        }

        if (0 === count($references)) {
            return;
        }

        $container->getDefinition($this->serviceId)->replaceArgument($this->argumentNumber, $references);
    }
612299
public function process(\Symfony\Component\DependencyInjection\ContainerBuilder $container)
    {
        if (!$container->hasDefinition("thelia.admin.resources")) {
            return;
        }

        /** @var \Symfony\Component\DependencyInjection\Definition $adminResources */
        $adminResources = $container->getDefinition("thelia.admin.resources");

        $adminResources->addMethodCall("addModuleResources", [$this->getResources(), $this->getModuleCode()]);
    }
33750
public function process(ContainerBuilder $container)
    {
        $this->container = $container;
        $this->graph = $container->getCompiler()->getServiceReferenceGraph();
        $this->graph->clear();
        $this->lazy = false;

        foreach ($container->getAliases() as $id => $alias) {
            $targetId = $this->getDefinitionId((string) $alias);
            $this->graph->connect($id, $alias, $targetId, $this->getDefinition($targetId), null);
        }

        parent::process($container);
    }
1368332
public function process(ContainerBuilder $container)
    {
        $def = $container->getDefinition('zicht_admin.event_propagator');

        foreach ($container->findTaggedServiceIds('zicht_admin.event_propagation') as $id => $attributes) {
            foreach ($attributes as $attribute) {
                $def->addTag('kernel.event_listener', array('event' => $attribute['event'], 'method' => 'onEvent'));
                $def->addMethodCall('registerPropagation', array($attribute['event'], new Reference($id)));
            }
        }
    }
134024
public function process(ContainerBuilder $container): void
    {
        $servicesReference = [];
        $serviceIds        = [];

        /**
         * @psalm-var array<string, array<mixed, string>> $taggedServices
         *
         * @var array $taggedServices
         */
        $taggedServices = $container->findTaggedServiceIds('service_bus.service');

        foreach ($taggedServices as $id => $tags)
        {
            /** @psalm-var class-string|null $serviceClass */
            $serviceClass = $container->getDefinition($id)->getClass();

            if (null !== $serviceClass)
            {
                $this->collectServiceDependencies($serviceClass, $container, $servicesReference);

                $serviceIds[] = $serviceClass;

                $servicesReference[\sprintf('%s_service', $serviceClass)] = new ServiceClosureArgument(
                    new Reference($id)
                );
            }
        }

        $container->setParameter('service_bus.services_map', $serviceIds);

        $container
            ->register('service_bus.services_locator', ServiceLocator::class)
            ->setPublic(true)
            ->setArguments([$servicesReference]);
    }
404700
public function process(ContainerBuilder $container)
    {
        if (!$container->hasDefinition('drupal.event_dispatcher')) {
            return;
        }
        $dispatcherDefinition = $container->getDefinition('drupal.event_dispatcher');

        foreach ($container->findTaggedServiceIds('drupal.event_subscriber') as $id => $attributes) {
            foreach ($attributes as $attribute) {
                $priority = isset($attribute['priority']) ? intval($attribute['priority']) : 0;
                $dispatcherDefinition->addMethodCall(
                    'addSubscriber',
                    array(new Reference($id), $priority)
                );
            }
        }
    }
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)]
            );
        }
    }
942645
public function process(ContainerBuilder $container)
    {
        if ($container->hasDefinition('umenu.manager') || $container->hasAlias('umenu.manager')) {
            $eventListener = $container->getDefinition('ucms_tree.site_event_subscriber');

            $eventListener->addMethodCall(
                'setTreeManager',
                [new Reference('umenu.manager')]
            );
        }
    }
578733
protected function prepareContainer(ContainerBuilder $container)
    {
        parent::prepareContainer($container);
        $container->setParameter('smart_core_cms.modules', $this->modules);
        $container->setParameter('smart_core_cms.site_name', $this->siteName);
    }
1068475
public function process(ContainerBuilder $container)
    {
        // Check if session support is enabled
        if (!$container->hasParameter('cache.session')) {
            return;
        }

        // If there is no active session support, throw
        if (!$container->hasAlias('session.storage')) {
            throw new \Exception('Session cache support cannot be enabled if there is no session.storage service');
        }

        $container->setAlias('session.handler', 'cache.service.session');
    }
739713
public function process(ContainerBuilder $container)
    {
        $this->setFactoryAndServerClasses($container);
        parent::process($container);
        $this->setCasServerConfig($container);
    }
663406
public function process(ContainerBuilder $container)
    {
        foreach ($container->getDefinitions() as $definition) {
            $interfaces = class_implements($definition->getClass());
            foreach ($interfaces as $interface) {
                if (substr($interface, -14) === 'AwareInterface') {
                    $camelCasedServiceId = substr($interface, strrpos($interface, '\\') + 1, -14);
                    $serviceId = Container::underscore($camelCasedServiceId);

                    if ($container->has($serviceId)) {
                        $setterMethod = 'set'.$camelCasedServiceId;

                        $definition->addMethodCall($setterMethod, array(new Reference($serviceId)));
                    }
                }
            }
        }
    }
505518
public function build(ContainerBuilder $container)
    {
        parent::build($container);

        if ($container->hasDefinition('jms_translation.config_factory')) {
            $container->addCompilerPass(new TraductionCompilerPass());
        }
        $container->addCompilerPass(new AccessMapCompilerPass());
        $container->addCompilerPass(new OverrideServiceCompilerPass());
    }
163704
public function process(ContainerBuilder $container)
    {
        $pool = $container->getDefinition('admin.configuration.pool');
        // get tagged services
        $configurations = array();
        foreach ($container->findTaggedServiceIds('admin.configuration') as $id => $attributes) {
            $configurations[$id] = $attributes;
        }
        $pool->addMethodCall('setConfigurations', array($configurations));
    }
1155827
public function process(ContainerBuilder $container)
    {
        if (!$container->has(ConfigManagerInterface::class)) {
            return;
        }
        $definition = $container->getDefinition(ConfigManagerInterface::class);

        // Find all config's
        $configs = $container->findTaggedServiceIds('expansion.config');
        foreach ($configs as $id => $tags) {
            $definition->addMethodCall(
                'registerConfig',
                [new Reference($id), $id]
            );
        }

        // Find all services to display configs.
        $definition = $container->getDefinition(ConfigUiManager::class);
        $services = $this->findAndSortTaggedServices('expansion.config.ui', $container);
        foreach($services as $service) {
            $definition->addMethodCall(
                'registerUi',
                [$service]
            );
        }
    }