Search for message handler services and provide them as a constructor argument to the message handler map
service.

@param ContainerBuilder $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);
    }
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);
    }
388225
public function process(ContainerBuilder $container)
    {
        $this->loader = $container->get('sulu.content.path_cleaner.replacer_loader');

        $service = $container->getDefinition('sulu.content.path_cleaner');
        $replacers = $this->loader->load($this->filename);
        $service->addArgument($replacers);
    }
909822
public function process(ContainerBuilder $container)
    {
        if ($container->hasDefinition('webit_shipment.serializer.model_handler')) {
            $locator = $container->getDefinition('jms_serializer.metadata.file_locator');
            $dirs = $locator->getArgument(0);
            $dirs['Webit\Shipment'] = '%kernel.root_dir%/../vendor/webit/shipment/src/Resources/serializer';
            $locator->replaceArgument(0, $dirs);
        }
    }
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);
        }
    }
867094
private function loadEnvironmentHandler(ContainerBuilder $container)
    {
        $definition = new Definition('Behat\Behat\Context\Environment\Handler\ContextEnvironmentHandler', array(
            new Reference(self::FACTORY_ID),
            new Reference(self::AGGREGATE_RESOLVER_FACTORY_ID)
        ));
        $definition->addTag(EnvironmentExtension::HANDLER_TAG, array('priority' => 50));
        $container->setDefinition(self::getEnvironmentHandlerId(), $definition);
    }
564014
public function build(ContainerBuilder $container)
    {
        parent::build($container);

        $container->addCompilerPass(new MetaTagHandlersCompilerPass());
        $container->addCompilerPass(new TwigRuntimePass());
    }
165706
public function process(ContainerBuilder $container)
    {
        if (!$container->hasParameter($this->enabledParameter)) {
            return;
        }

        $chainDriverDefService = $this->getChainDriverServiceName($container);
        $chainDriverDef = $container->getDefinition($chainDriverDefService);

        foreach ($this->namespaces as $namespace) {
            $chainDriverDef->addMethodCall('addDriver', [$this->driver, $namespace]);
        }
    }
1321203
public function process(ContainerBuilder $container)
    {
        $parameterBag = $container->getParameterBag();

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

        $parameterReplacer->processParameterBag($parameterBag, $container);
    }
739713
public function process(ContainerBuilder $container)
    {
        $this->setFactoryAndServerClasses($container);
        parent::process($container);
        $this->setCasServerConfig($container);
    }
297857
public function process(ContainerBuilder $container)
    {
        if (
            !$container->hasDefinition(self::VIEW_BUILDER_REGISTRY)
            || !$container->hasDefinition(self::VIEW_BUILDER_CONTENT_TRANSLATE)
        ) {
            return;
        }

        $registry = $container->findDefinition(self::VIEW_BUILDER_REGISTRY);

        $viewBuilders = [
            $container->getDefinition(self::VIEW_BUILDER_CONTENT_TRANSLATE),
        ];

        $registry->addMethodCall('addToRegistry', [$viewBuilders]);
    }
116532
public function process(ContainerBuilder $container)
    {
        $taggedServices = $container->findTaggedServiceIds('ongr_cookie.cookie');
        $injectorDefinition = $container->getDefinition('ongr_cookie.injector');

        foreach ($taggedServices as $id => $tagAttributes) {
            $injectorDefinition->addMethodCall('addCookieModel', [new Reference($id)]);
        }
    }
502050
public function process(ContainerBuilder $container)
    {
        if (!$container->hasDefinition($this->generatorService)) {
            return;
        }

        if (!$generators = $this->findTaggedServices($container, $this->generatorTag, PluginInterface::class, 'getName')) {
            throw new RuntimeException(sprintf('You must tag at least one service as "%s" to use the "%s" service.', $this->generatorTag, $this->generatorService));
        }

        $generatorDefinition = $container->getDefinition($this->generatorService);
        $generatorDefinition->replaceArgument(0, $generators);
    }
103283
public function process(ContainerBuilder $container)
    {
        $this->container = $container;
        $this->buildReader();
        $this->buildUseCaseProxies();
    }
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)
                );
            }
        }
    }
340604
public function build(ContainerBuilder $container)
    {
        parent::build($container);

        $container->addCompilerPass(new VersionCompilerPass(new PrettyVersions()));
        $container->addCompilerPass(new EnvParametersCompilerPass());
        $container->addCompilerPass(new RouteLoaderCompilerPass());
        $container->addCompilerPass(new HttpClientOptionsCompilerPass());
    }
313259
public function process(ContainerBuilder $container)
    {
        $commands = $container->findTaggedServiceIds(
            'cli.command'
        );

        /** @var Application $application */
        $application = $container->get('application');

        foreach (array_keys($commands) as $id) {
            /** @var Command $command */
            $command = $container->get($id);

            if ($command instanceof ConditionalUseInterface) {
                /** @var ConditionalUseInterface $command */
                if (true !== $command->isUsable()) {
                    continue;
                }
            }

            $application->add($command);
        }
    }