Add the Resolvers.

@param ContainerBuilder $container
@param string $service
@param string $tag

@return void
481230
protected function addResolvers(ContainerBuilder $container, string $service, string $tag)
    {
        if (!$container->has($service)) {
            return;
        }

        $definition = $container->getDefinition($service);
        $taggedServices = $container->findTaggedServiceIds($tag);

        foreach ($taggedServices as $id => $tags) {
            foreach ($tags as $attributes) {
                $definition->addMethodCall('addResolver', [
                    new Reference($id)
                ]);
            }
        }
    }
837678
public function build(ContainerBuilder $container)
    {
        parent::build($container);

        $container->addCompilerPass(new ValidatorPass());
        $container->addCompilerPass(new FormPass());
        $container->addCompilerPass(new TwigLoaderPass());
    }
85560
public function build(ContainerBuilder $container)
    {
        parent::build($container);

        $container->addCompilerPass(new TagViewBuilderPass());
        $container->addCompilerPass(new TwigRuntimePass());

        $eZExtension = $container->getExtension('ezpublish');
        $eZExtension->addPolicyProvider(new TagsPolicyProvider());
    }
787991
public function process(ContainerBuilder $container)
    {
        if (!$container->has(PluginManager::class)) {
            return;
        }

        $pluginsData = [];

        // Find all Plugin services.
        $plugins = $container->findTaggedServiceIds('expansion.plugin');
        foreach ($plugins as $id => $tags) {
            $pluginsData[$id]['dataProviders'] = [];
            foreach ($tags as $attributes) {
                if (isset($attributes['data_provider'])) {
                    $pluginsData[$id]['dataProviders'][] = $attributes['data_provider'];
                }
            }
        }

        // Find the parent services.
        $plugins = $container->findTaggedServiceIds('expansion.plugin.parent');
        foreach ($plugins as $id => $tags) {
            foreach ($tags as $attributes) {
                $pluginsData[$id]['parent'][] = $attributes['parent'];
            }
        }

        // Get the data provider manager service definition to register data providers into.
        $definition = $container->getDefinition(PluginManager::class);

        foreach ($pluginsData as $pluginId => $data)
        {
            $definition->addMethodCall('registerPlugin', [
                    $pluginId,
                    empty($data['dataProviders']) ? [] : $data['dataProviders'],
                    empty($data['parent']) ? [] : $data['parent'],
                ]
            );
        }
    }
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)]
            );
        }
    }
243951
public function process(ContainerBuilder $container)
    {
        $builderDefinition = $container->getDefinition(ItemBuilder::class);
        $factories = $container->findTaggedServiceIds('expansion.menu.item.factory');

        foreach ($factories as $id => $tags) {
            $builderDefinition->addMethodCall(
                "addItemFactory",
                [new Reference($id)]
            );
        }
    }
1168597
protected function findTags(ContainerBuilder $container, $tagName, $argumentPosition, $ext = false): void
    {
        $services = [];

        foreach ($container->findTaggedServiceIds($tagName) as $serviceId => $tag) {
            $class = isset($tag[0]['class'])
                ? $this->getRealClassName($container, $tag[0]['class'])
                : $this->getClassName($container, $serviceId, $tagName);
            $class = $this->findResolveTarget($container, $class);
            $this->replaceResolveTargetClass($container, $tagName, $serviceId, $class);

            // Flip, because we want tag classe names (= type identifiers) as keys
            if ($ext) {
                $services[$class][] = $serviceId;
            } else {
                $services[$class] = $serviceId;
            }
        }

        $container->getDefinition('fxp_default_value.extension')->replaceArgument($argumentPosition, $services);
    }
952904
public function process(ContainerBuilder $container)
    {
        $this->setupPools($container);
        
        $pools = $container->getParameter('gendoria_command_queue.pools');

        foreach ($container->findTaggedServiceIds(self::QUEUE_MANAGER_TAG) as $id => $tags) {
            $def = $container->getDefinition($id);
            $reflection = new ReflectionClass($def->getClass());
            if ($reflection->implementsInterface(MultipleQueueManagerInterface::class)) {
                $this->setupMultipleQueueManager($id, $def, $tags, $pools);
            } elseif ($reflection->implementsInterface(SingleQueueManagerInterface::class)) {
                $this->setupSingleQueueManager($id, $def, $tags, $pools);
            } else {
                throw new InvalidArgumentException(sprintf('Service "%s" does not implement one of required interfaces.', $id));
            }
        }
    }
887335
public function process(ContainerBuilder $container)
    {
        if (!$container->hasDefinition(ProviderAggregator::class)) {
            return;
        }

        $providers = [];
        foreach ($container->findTaggedServiceIds('bazinga_geocoder.provider') as $providerId => $attributes) {
            $providers[] = new Reference($providerId);
        }

        $geocoderDefinition = $container->getDefinition(ProviderAggregator::class);
        $geocoderDefinition->addMethodCall('registerProviders', [$providers]);
    }
1001449
public function process(ContainerBuilder $container)
    {
        $parameterBag = $container->getParameterBag();

        foreach ($container->getDefinitions() as $id => $definition) {
            try {
                $definition->setClass($parameterBag->resolveValue($definition->getClass()));
                $definition->setFile($parameterBag->resolveValue($definition->getFile()));
                $definition->setArguments($parameterBag->resolveValue($definition->getArguments()));

                $factory = $definition->getFactory();

                if (is_array($factory) && isset($factory[0])) {
                    $factory[0] = $parameterBag->resolveValue($factory[0]);
                    $definition->setFactory($factory);
                }

                $calls = array();
                foreach ($definition->getMethodCalls() as $name => $arguments) {
                    $calls[$parameterBag->resolveValue($name)] = $parameterBag->resolveValue($arguments);
                }
                $definition->setMethodCalls($calls);

                $definition->setProperties($parameterBag->resolveValue($definition->getProperties()));
            } catch (ParameterNotFoundException $e) {
                $e->setSourceId($id);

                throw $e;
            }
        }

        $aliases = array();
        foreach ($container->getAliases() as $name => $target) {
            $aliases[$parameterBag->resolveValue($name)] = $parameterBag->resolveValue($target);
        }
        $container->setAliases($aliases);

        $parameterBag->resolve();
    }
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)]
        );
    }
1014361
private function findAndReplaceTaggedServices($id, array $service, ContainerBuilder $container)
    {
        $serviceConfig = $this->createServiceConfig($id, $service);

        if ($serviceConfig->has(ServiceConfig::CONTAINER)) {
            $replace = $this->getDefinitionsAsContainer($container, $serviceConfig);
        } else {
            $replace = $this->getDefinitionsAsArray($container, $serviceConfig);
        }

        $definition = $container->findDefinition($id);
        $definition->replaceArgument($this->findArgumentToReplace($definition, $serviceConfig), $replace);
    }
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]);
    }
1338139
public function process(ContainerBuilder $container)
    {
        $filters = $container->findTaggedServiceIds(self::TAG_EVENTS_FILTER);
        $filtersRepoDef = $container->getDefinition('smartesb.registry.event_filters');

        foreach ($filters as $serviceName => $tags) {
            $filtersRepoDef->addMethodCall('addDeferringFilter', [new Reference($serviceName)]);
        }
    }
22738
private function loadBundleServiceDefinitions(ContainerBuilder $container)
    {
        $fileLocator = new FileLocator(self::SERVICES_CONFIG_DIRECTORY_RELATIVE_PATH);

        $loader = new XmlFileLoader($container, $fileLocator);

        $loader->load('services.xml');
    }
103283
public function process(ContainerBuilder $container)
    {
        $this->container = $container;
        $this->buildReader();
        $this->buildUseCaseProxies();
    }
1321203
public function process(ContainerBuilder $container)
    {
        $parameterBag = $container->getParameterBag();

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

        $parameterReplacer->processParameterBag($parameterBag, $container);
    }