Loads stop on failure controller.

@param ContainerBuilder $container
481739
protected function loadStopOnFailureController(ContainerBuilder $container)
    {
        $definition = new Definition('Behat\Behat\EventDispatcher\Cli\StopOnFailureController', array(
            new Reference(EventDispatcherExtension::DISPATCHER_ID)
        ));
        $definition->addTag(CliExtension::CONTROLLER_TAG, array('priority' => 100));
        $container->setDefinition(CliExtension::CONTROLLER_TAG . '.stop_on_failure', $definition);
    }
107629
public function process(ContainerBuilder $container): void
    {
        if (!$container->has('ngsite.menu.factory.location')) {
            return;
        }

        $factory = $container->findDefinition('ngsite.menu.factory.location');

        $extensions = [];

        foreach ($container->findTaggedServiceIds('ngsite.menu.factory.location.extension') as $extension => $tags) {
            foreach ($tags as $tag) {
                $priority = (int) ($tag[0]['priority'] ?? 0);
                $extensions[$priority][] = new Reference($extension);
            }
        }

        krsort($extensions);
        $extensions = array_merge(...$extensions);

        $factory->replaceArgument(2, $extensions);
    }
1109577
public function process(ContainerBuilder $container): void
    {
        if (!$container->has('assetic.twig_formula_loader.real')) {
            return;
        }

        $container
            ->findDefinition('assetic.twig_formula_loader.real')
            ->replaceArgument(1, null);
    }
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);
        }
    }
979932
public function process(ContainerBuilder $container)
    {
        $this->container = $container;
        $this->signalingException = new RuntimeException('Invalid reference.');

        try {
            $this->processValue($container->getDefinitions(), 1);
        } finally {
            $this->container = $this->signalingException = null;
        }
    }
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]);
        }
    }
887154
public function process(ContainerBuilder $container): void
    {
        $collector = $container->findDefinition('fivelab.resource.serializer.context_collector');
        $services = $container->findTaggedServiceIds('resource.serializer.collector');

        foreach ($services as $serviceId => $tags) {
            try {
                $collectorDefinition = $container->getDefinition($serviceId);
                $collectorClass = $container->getParameterBag()->resolveValue($collectorDefinition->getClass());

                if (!is_a($collectorClass, SerializationContextCollectorInterface::class, true)) {
                    throw new \RuntimeException(sprintf(
                        'The serialization context collector should implement "%s".',
                        SerializationContextCollectorInterface::class
                    ));
                }

                $collector->addMethodCall('add', [
                    new Reference($serviceId),
                ]);
            } catch (\Exception $e) {
                throw new \RuntimeException(sprintf(
                    'Can\'t compile resource serialization collector with service id "%s".',
                    $serviceId
                ), 0, $e);
            }
        }
    }
857663
public function build(ContainerBuilder $container)
    {
        $this->initAdmingeneratorClassLoader($container);

        parent::build($container);

        $container->addCompilerPass(new ValidatorCompilerPass());
        $container->addCompilerPass(new FormCompilerPass());
    }
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)]
            );
        }
    }
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);
    }
245957
protected function loadExceptionListener(ContainerBuilder $container, array $config)
    {
        $definition = new Definition(
            'M6Web\Bundle\ApiExceptionBundle\EventListener\ExceptionListener',
            [
                new Reference('kernel'),
                new Reference($this->getAlias().'.manager.exception'),
                $config['match_all'],
                $config['default'],
                $config['stack_trace'],
            ]
        );

        $definition->setPublic(true);

        $definition->addTag(
            'kernel.event_listener',
            [
                'event' => 'kernel.exception',
                'method' => 'onKernelException',
                'priority' => '-100' // as the setResponse stop the exception propagation, this listener has to pass in last position
            ]
        );

        $container->setDefinition($this->getAlias().'.listener.exception', $definition);
    }
362999
public function process(ContainerBuilder $container)
    {
        $taggedServices = $container->findTaggedServiceIds($this->tagName);
        foreach ($taggedServices as $id => $tags) {

            $definition = $container->getDefinition($id);
            foreach ($tags as $tag) {

                $references = $this->getSortedDependencies(
                    $container,
                    $this->buildOptionsFromServiceTag($id, $tag)
                );

                $this->configureConsumer($definition, $tag, $references);
            }
        }
    }
729533
private function loadEnvironmentReader(ContainerBuilder $container)
    {
        $definition = new Definition('Behat\Behat\Context\Environment\Reader\ContextEnvironmentReader');
        $definition->addTag(EnvironmentExtension::READER_TAG, array('priority' => 50));
        $container->setDefinition(self::getEnvironmentReaderId(), $definition);
    }
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);
        }
    }
550234
protected function loadConfiguration(ContainerBuilder $container, array $config)
    {
        $container->setParameter('jb_fileuploader.endpoints', $config);
        $container->setParameter('jb_fileuploader.crop_route', $config['crop_route']);
    }
749423
protected function buildLoadableBundles(ContainerBuilder $container)
    {
        $bundles = $container->getParameter('kernel.bundles');
        foreach ($bundles as $bundle) {
            $reflectionClass = new \ReflectionClass($bundle);
            if ($reflectionClass->implementsInterface(LoadableBundle::class)) {
                (new $bundle())->load($container);
            }
        }
    }
574351
private static function errorHandler(ContainerInterface $container): ErrorHandlerInterface
    {
        if (!$container->has(ErrorHandlerInterface::class)) {
            return new ErrorHandler();
        }

        return $container->get(ErrorHandlerInterface::class);
    }