@param ContainerBuilder $container

@throws \Symfony\Component\DependencyInjection\Exception\ParameterNotFoundException

@return string
502433
protected function getChainDriverServiceName(ContainerBuilder $container)
    {
        foreach (['ekino_wordpress.model_manager_name', $this->fallbackManagerParameter] as $param) {
            if ($container->hasParameter($param)) {
                $name = $container->getParameter($param);
                if ($name) {
                    return sprintf($this->driverPattern, $name);
                }
            }
        }

        throw new ParameterNotFoundException('None of the managerParameters resulted in a valid name');
    }
274610
private function injectParameters(ContainerBuilder $containerBuilder): void
    {
        $parameters = [
            'service_bus.logger.graylog.udp_host'  => $this->host,
            'service_bus.logger.graylog.udp_port'  => $this->port,
            'service_bus.logger.graylog.gzip'      => $this->gzipMessage,
            'service_bus.logger.graylog.log_level' => $this->logLevel,
        ];
        foreach ($parameters as $key => $value)
        {
            $containerBuilder->setParameter($key, $value);
        }
    }
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()));
            }
        }
    }
183960
public function process(ContainerBuilder $container)
    {
        if ($container->hasAlias('api_platform.name_converter') || !$container->hasDefinition('serializer.name_converter.metadata_aware')) {
            return;
        }

        $definition = $container->getDefinition('serializer.name_converter.metadata_aware');

        if (1 >= \count($definition->getArguments()) || null === $definition->getArgument(1)) {
            return;
        }

        $container->setAlias('api_platform.name_converter', 'serializer.name_converter.metadata_aware');
    }
526361
protected function getRealClassName(ContainerBuilder $container, $classname)
    {
        return 0 === strpos($classname, '%') ? $container->getParameter(trim($classname, '%')) : $classname;
    }
1284946
private static function buildDumper(ContainerBuilder $container)
    {
        $dumper = new PhpDumper($container);
        if (class_exists(PhpDumper::class)) {
            $dumper->setProxyDumper(new ProxyDumper);
        }

        return $dumper;
    }
1138176
protected function criteriaToParameters(ContainerInterface $Container)
    {
        /*
         * @var CriteriumInterface $Criterium
         */
        $parameters = [];
        foreach ($Container->getCriteria()->getCriteriumCollection() as $Criterium) {
            $SqlPart = $Criterium->getSqlPart();
            $parameters[] = $SqlPart->getParameters();
        }

        return $parameters;
    }
1238978
public function prepend(ContainerBuilder $container)
    {
        $bundles = $container->getParameter('kernel.bundles');

        if (!isset($bundles['JMSDiExtraBundle'])) {
            return;
        }

        $configs = $container->getExtensionConfig($this->getAlias());
        $config = $this->processConfiguration(new Configuration(), $configs);
        if (!$config['options']['enable_jms_di_extra_autoregistration']) {
            return;
        }

        $sonataAdminPattern = 'Sonata\AdminBundle\Annotation';
        $annotationPatternsConfigured = false;

        $diExtraConfigs = $container->getExtensionConfig('jms_di_extra');
        foreach ($diExtraConfigs as $diExtraConfig) {
            if (isset($diExtraConfig['annotation_patterns'])) {
                // don't add our own pattern if user has already done so
                if (false !== array_search($sonataAdminPattern, $diExtraConfig['annotation_patterns'], true)) {
                    return;
                }
                $annotationPatternsConfigured = true;

                break;
            }
        }

        @trigger_error(
            'Automatic registration of annotations is deprecated since 3.14, to be removed in 4.0.',
            E_USER_DEPRECATED
        );

        if ($annotationPatternsConfigured) {
            $annotationPatterns = [$sonataAdminPattern];
        } else {
            // get annotation_patterns default from DiExtraBundle configuration
            $diExtraConfigDefinition = new JMSDiExtraBundleDependencyInjectionConfiguration();
            // FIXME: this will break if DiExtraBundle adds any mandatory configuration
            $diExtraConfig = $this->processConfiguration($diExtraConfigDefinition, []);

            $annotationPatterns = $diExtraConfig['annotation_patterns'];
            $annotationPatterns[] = $sonataAdminPattern;
        }

        $container->prependExtensionConfig(
            'jms_di_extra',
            [
                'annotation_patterns' => $annotationPatterns,
            ]
        );
    }
727264
public function process(ContainerBuilder $container)
    {
        try {
            $factory = $container->findDefinition('draw.doctrine.repository.factory');
        } catch (ServiceNotFoundException $e) {
            //The configuration draw.use_doctrine_repository_factory is probably set to false
            return;
        }

        $repositories = [];
        foreach ($container->findTaggedServiceIds('draw.doctrine.repository') as $id => $params) {
            foreach ($params as $param) {
                $repositories[$param['class']] = $id;
                $repository = $container->findDefinition($id);
                $repository->replaceArgument(0, new Reference('doctrine.orm.default_entity_manager'));
                $definition = new Definition();
                $definition->setClass('Doctrine\ORM\Mapping\ClassMetadata');
                $definition->setFactory(['doctrine.orm.default_entity_manager', 'getClassMetadata']);
                $definition->setArguments([$param['class']]);
                $repository->replaceArgument(1, $definition);
            }
        }
        $factory->replaceArgument(0, $repositories);
        $container->findDefinition('doctrine.orm.configuration')->addMethodCall('setRepositoryFactory', [$factory]);
    }
640260
public function process(ContainerBuilder $container)
    {
        $this->container = $container;

        // If disabled, continue
        if (!$this->container->hasParameter('cache.doctrine')) {
            return;
        }

        if (!$this->hasDoctrine()) {
            throw new \Exception(
                'Not able to find any doctrine caches to implement. Ensure you have Doctrine ORM or ODM'
            );
        }

        $this->enableDoctrineSupport($this->container->getParameter('cache.doctrine'));
    }
203292
public function process(ContainerBuilder $container)
    {
        $bundles = $container->getParameter('kernel.bundles');

        try
        {
            if(true !== $container->getParameter('avanzu_admin_theme.use_twig')) {
                return;
            }
        }
        // Parameter avanzu_admin_theme.use_twig not found in config
        catch(ParameterNotFoundException $e)
        {
            return;
        }

        if (!isset($bundles['TwigBundle'])) {
            return;
        }

        $param = $container->getParameter('twig.form.resources');

        if(!is_array($param)) {
            $param = [];
        }

        array_push($param, 'AvanzuAdminThemeBundle:layout:form-theme.html.twig');

        $container->setParameter('twig.form.resources', $param);

        $twigDefinition = $container->getDefinition('twig');

        $twigDefinition->addMethodCall('addGlobal', [
                'avanzu_admin_context',
                new Reference('avanzu_admin_theme.context_helper'),
            ]
        );
    }
635424
public function buildLoader(ContainerBuilder $container)
    {
        return new YamlFileLoader($container, new FileLocator($this->dir . $this->prefix));
    }
1212049
public function process(ContainerBuilder $container)
    {
        $container->setAlias('router', 'joomla.router');

        $definition = $container->getDefinition('joomla.router');

        $taggedServices = $container->findTaggedServiceIds(
            'joomla.router'
        );

        $interface = RouterInterface::class;

        $sortedRouters = [];

        foreach ($taggedServices as $id => $tagAttributes) {
            $tagDefinition = $container->getDefinition($id);
            $tagClass = $container->getParameterBag()->resolveValue($tagDefinition->getClass());
            $tagClass = new \ReflectionClass($tagClass);

            if (!$tagClass->implementsInterface($interface)) {
                throw new \LogicException(
                    sprintf("Class of service %s does not implement interface %s", $id, $interface)
                );
            }

            $tagAttributes = current($tagAttributes);

            $priority = 0;
            if (isset($tagAttributes['priority'])) {
                $priority = $tagAttributes['priority'];
            }

            $sortedRouters[] = [$priority, new Reference($id)];
        }

        usort(
            $sortedRouters,
            function ($serviceA, $serviceB) {
                if ($serviceA[0] == $serviceB[0]) {
                    return 0;
                }

                return ($serviceA[0] < $serviceB[0]) ? 1 : -1;
            }
        );

        $sortedRouters = array_reverse($sortedRouters);

        foreach ($sortedRouters as $service) {
            $definition->addMethodCall(
                'addRouter',
                [$service[1]]
            );
        }

        $container->setParameter('router.options.generator_class', UrlGenerator::class);
        $container->setParameter('router.options.generator_base_class', UrlGenerator::class);
    }
399602
public function build(ContainerBuilder $container)
    {
        parent::build($container);

        $container->addCompilerPass(
            new DocumentMapCompilerPass(),
            PassConfig::TYPE_BEFORE_OPTIMIZATION,
            100
        );
        $container->addCompilerPass(
            new ExtRefMappingCompilerPass(),
            PassConfig::TYPE_BEFORE_OPTIMIZATION,
            5
        );
        $container->addCompilerPass(
            new ExtRefFieldsCompilerPass(),
            PassConfig::TYPE_BEFORE_OPTIMIZATION,
            5
        );
        $container->addCompilerPass(
            new RqlFieldsCompilerPass(),
            PassConfig::TYPE_BEFORE_OPTIMIZATION,
            5
        );
        $container->addCompilerPass(
            new TranslatableFieldsCompilerPass(),
            PassConfig::TYPE_BEFORE_OPTIMIZATION,
            5
        );
        $container->addCompilerPass(
            new DocumentFieldNamesCompilerPass(),
            PassConfig::TYPE_BEFORE_OPTIMIZATION,
            5
        );
        $container->addCompilerPass(
            new ReadOnlyFieldsCompilerPass(),
            PassConfig::TYPE_BEFORE_OPTIMIZATION,
            5
        );
        $container->addCompilerPass(
            new RestrictionFieldsCompilerPass(),
            PassConfig::TYPE_BEFORE_OPTIMIZATION,
            5
        );
        $container->addCompilerPass(
            new RecordOriginExceptionFieldsCompilerPass(),
            PassConfig::TYPE_BEFORE_OPTIMIZATION,
            5
        );
        $container->addCompilerPass(
            new SolrDefinitionCompilerPass(),
            PassConfig::TYPE_BEFORE_OPTIMIZATION,
            5
        );
    }
681391
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())
            );

            $calls = array();
            foreach ($definition->getMethodCalls() as $call) {
                try {
                    $calls[] = array($call[0], $this->processArguments($call[1], true));
                } catch (RuntimeException $e) {
                    // this call is simply removed
                }
            }
            $definition->setMethodCalls($calls);

            $properties = array();
            foreach ($definition->getProperties() as $name => $value) {
                try {
                    $value = $this->processArguments(array($value), true);
                    $properties[$name] = reset($value);
                } catch (RuntimeException $e) {
                    // ignore property
                }
            }
            $definition->setProperties($properties);
        }
    }
399361
public function loadParameters(ContainerBuilder $container)
    {
        // the blast.yml
        if (file_exists($this->dir . $this->prefix . $this->file . $this->suffix)) {
            $this->mergeParameter('blast', $container, $this->dir . $this->prefix);
        }

        return $this;
    }
930392
public function build(ContainerBuilder $container)
    {
        parent::build($container);
        $container->addCompilerPass(new ApplicationConfigProviderPass());
        $container->addCompilerPass(new TranslationDomainsExtensionsPass());
        $container->addCompilerPass(new ValueObjectVisitorPass());
    }