@param YamlFileLoader $loader
@param ContainerBuilder $container
@param array $data
@param string $defaultConnectionHandler

@throws \Exception
193416
private function buildAndroid(YamlFileLoader $loader, ContainerBuilder $container, array $data, string $defaultConnectionHandler = null)
    {
        if ($data['connection_handler'] !== null) {
            $connectionHandler = $data['connection_handler'];
        } elseif ($defaultConnectionHandler !== null) {
            $connectionHandler = $defaultConnectionHandler;
        } else {
            $connectionHandler = 'isset_bv_push_notification.android.connection.handler';
            $loader->load('android.yml');
        }

        $definition = $container->register('isset_bv_push_notification.android.notifier', AndroidNotifier::class);
        $definition->addArgument(new Reference($connectionHandler));
        $definition->addTag('isset_bv_push_notification.notifier');

        foreach ($data['connections'] as $type => $connection) {
            $definition = $container->register('isset_bv_push_notification.android.connection.' . $type, AndroidConnection::class);
            $definition->addArgument($type);
            $definition->addArgument($connection['url']);
            $definition->addArgument($connection['api_key']);
            $definition->addArgument($connection['timeout']);
            $definition->addArgument($connection['dry_run']);
            $definition->addArgument($connection['default']);
            $definition->addTag('isset_bv_push_notification.android.connection');
        }
    }
184146
private function replaceDefaultStrategy(ContainerBuilder $container)
    {
        if (!$container->has('assets._default_package')) {
            throw new Exception('Default package does not exist.');
        }

        $defaultPackage = $container->getDefinition('assets._default_package');

        $class = $this->getPackageClass($defaultPackage, $container);

        if ($class === null) {
            throw new Exception(
                sprintf('Unable to resolve the class of the service "%s"', 'assets._default_package')
            );
        }

        $index = $this->getIndexForVersionStrategyArgument($class);

        $defaultPackage->replaceArgument(
            $index,
            new Reference('irozgar_gulp_rev_versions.asset.gulp_rev_version_strategy')
        );
    }
17482
public function loadOrmProvider($config, XmlFileLoader $loader, ContainerBuilder $container)
    {
        $container->setParameter($this->getAlias() . '.persistence.orm.manager_name', $config['manager_name']);
        $container->setParameter($this->getAlias() . '.backend_type_orm', true);
        $loader->load('persistence-orm.xml');
    }
42280
private function loadServices(Loader\YamlFileLoader $loader)
    {
        foreach (array('security_key', 'authentication', 'security', 'annotation') as $file) {
            $loader->load(sprintf('%s.yml', $file));
        }
    }
635424
public function buildLoader(ContainerBuilder $container)
    {
        return new YamlFileLoader($container, new FileLocator($this->dir . $this->prefix));
    }
380587
public function registerLoader($alias, $loader)
    {
        if ($this->hasLoader($alias)) {
            throw new \RuntimeException(sprintf('Alias "%s" already used by another form loader', $alias));
        }

        $this->loaders[$alias] = $loader;
    }
754956
private function handleRouting(array $config, ContainerBuilder $container, FileLoader $loader)
    {
        $loader->load('routing.yml');
        $container->setAlias('router', 'ezpublish.chain_router');

        if (isset($config['router']['default_router']['non_siteaccess_aware_routes'])) {
            $container->setParameter(
                'ezpublish.default_router.non_siteaccess_aware_routes',
                array_merge(
                    $container->getParameter('ezpublish.default_router.non_siteaccess_aware_routes'),
                    $config['router']['default_router']['non_siteaccess_aware_routes']
                )
            );
        }
    }
1260198
private function loadContainerBuilder()
    {
        if ($this->containerBuilder !== null) {
            return;
        }
        $container = $this->kernel->getContainer();
        if (!$this->getKernel()->isDebug()
            || !$container->hasParameter('debug.container.dump')
            || !file_exists($cachedFile = $container->getParameter('debug.container.dump'))
        ) {
            $this->containerBuilder = false;
            return;
        }

        $containerBuilder = new ContainerBuilder();

        $loader = new XmlFileLoader($containerBuilder, new FileLocator());
        $loader->load($cachedFile);

        $this->containerBuilder = $containerBuilder;
    }
769826
public function load(array $configs, ContainerBuilder $containerBuilder)
    {
        // This parameter is unused, but not optional. This line will avoid a static analysis warning this.
        $configs;

        $loader = new YamlFileLoader($containerBuilder, new FileLocator(__DIR__ . '/../../config'));
        $loader->load('services.yml');
    }
243184
protected function dbalLoad(array $config, ContainerBuilder $container)
    {
        $loader = new XmlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config'));
        $loader->load('dbal.xml');

        if (empty($config['default_connection'])) {
            $keys                         = array_keys($config['connections']);
            $config['default_connection'] = reset($keys);
        }

        $this->defaultConnection = $config['default_connection'];

        $container->setAlias('database_connection', sprintf('doctrine.dbal.%s_connection', $this->defaultConnection));
        $container->getAlias('database_connection')->setPublic(true);
        $container->setAlias('doctrine.dbal.event_manager', new Alias(sprintf('doctrine.dbal.%s_connection.event_manager', $this->defaultConnection), false));

        $container->setParameter('doctrine.dbal.connection_factory.types', $config['types']);

        $connections = [];

        foreach (array_keys($config['connections']) as $name) {
            $connections[$name] = sprintf('doctrine.dbal.%s_connection', $name);
        }

        $container->setParameter('doctrine.connections', $connections);
        $container->setParameter('doctrine.default_connection', $this->defaultConnection);

        foreach ($config['connections'] as $name => $connection) {
            $this->loadDbalConnection($name, $connection, $container);
        }
    }
435502
public function load(array $configs, ContainerBuilder $container)
    {
        $configuration = $this->getConfiguration($configs, $container);
        $config = $this->processConfiguration($configuration, $configs);

        $loader = new XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
        $loader->load('profiler.xml');

        if ($config['toolbar'] || $config['intercept_redirects']) {
            $loader->load('toolbar.xml');
            $container->getDefinition('web_profiler.debug_toolbar')->replaceArgument(4, $config['excluded_ajax_paths']);
            $container->setParameter('web_profiler.debug_toolbar.intercept_redirects', $config['intercept_redirects']);
            $container->setParameter('web_profiler.debug_toolbar.mode', $config['toolbar'] ? WebDebugToolbarListener::ENABLED : WebDebugToolbarListener::DISABLED);
        }

        if (Kernel::VERSION_ID >= 40008 || (Kernel::VERSION_ID >= 30408 && Kernel::VERSION_ID < 40000)) {
            $container->getDefinition('debug.file_link_formatter')
                ->replaceArgument(3, new ServiceClosureArgument(new Reference('debug.file_link_formatter.url_format')));
        }
    }
968203
public function load(array $configs, ContainerBuilder $container): void
    {
        $loader = new YamlFileLoader($container, new FileLocator());
        $loader->load(__DIR__ . '/../service_bus.yaml');

        /**
         * @var string $key
         * @var mixed  $value
         *
         * @psalm-suppress MixedAssignment Cannot assign $value to a mixed type
         */
        foreach ($configs as $key => $value)
        {
            $container->setParameter($key, $value);
        }
    }
598865
private function buildApple(YamlFileLoader $loader, ContainerBuilder $container, array $data, string $defaultConnectionHandler = null)
    {
        if ($data['connection_handler'] !== null) {
            $connectionHandler = $data['connection_handler'];
        } elseif ($defaultConnectionHandler !== null) {
            $connectionHandler = $defaultConnectionHandler;
        } else {
            $connectionHandler = 'isset_bv_push_notification.apple.connection.handler';
            $loader->load('apple.yml');
        }

        $definition = $container->register('isset_bv_push_notification.apple.notifier', AppleNotifier::class);
        $definition->addArgument(new Reference($connectionHandler));
        $definition->addTag('isset_bv_push_notification.notifier');
        foreach ($data['connections'] as $type => $connection) {
            $definition = $container->register('isset_bv_push_notification.apple.connection.' . $type, AppleConnection::class);
            $definition->addArgument($type);
            $definition->addArgument($connection['url']);
            $definition->addArgument($connection['key_location']);
            $definition->addArgument($connection['key_password_phrase'] ?? null);
            $definition->addArgument($connection['default']);
            $definition->addTag('isset_bv_push_notification.apple.connection');
        }
    }
75723
public function load(array $configs, ContainerBuilder $container): void
    {
        $configuration = new Req2CmdConfiguration();
        $config = $this->processConfiguration($configuration, $configs);

        $loader = new XmlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config'));

        $loader->load('actions.xml');
        $loader->load('extractors.xml');
        $loader->load('listeners.xml');
        $loader->load('param_mappers.xml');
        $loader->load('command_bus.xml');
        $loader->load('serializer.xml');

        $this->configureExtractors($config, $container);
        $this->configureCommandBus($config, $container);
        $this->configureEventListeners($config, $container);
    }
769095
protected function loadRepository($loader, ContainerBuilder $container, array $config)
    {
        if (isset($config['repository']['type'])) {
            if ($config['repository']['type'] == 'yaml') {
                if (!isset($config['repository']['repo']['filename'])) {
                    throw new InvalidConfigurationException(
                        'You must define filename parameter for repo yaml repository'
                    );
                }
                $container->setParameter(
                    'snide_travinizer.repo_repository.filename',
                    $config['repository']['repo']['filename']
                );
            }

            $loader->load('repository/' . strtr($config['repository']['type'], '_', '/') . '.xml');
        } else {
            throw new InvalidConfigurationException('You must define repository type parameter');
        }

        if (isset($config['repository']['class'])) {
            $container->setParameter('snide_travinizer.repo_repository.class', $config['repository']['class']);
        }
    }
1370348
private function processObjectManagerConfigurations(array $configs, ContainerBuilder $container, LoaderInterface $loader, array &$loaded, $doctrineSubscriberTag)
    {
        $usedManagers = array();

        $listenerPriorities = array(
            'translatable' => -10,
            'loggable' => 5,
            'uploadable' => -5,
        );

        foreach ($configs as $name => $listeners) {
            foreach ($listeners as $ext => $enabled) {
                if (!$enabled) {
                    continue;
                }

                if (!isset($loaded[$ext])) {
                    $loader->load($ext.'.xml');
                    $loaded[$ext] = true;
                }

                $attributes = array('connection' => $name);

                if (isset($listenerPriorities[$ext])) {
                    $attributes['priority'] = $listenerPriorities[$ext];
                }

                $definition = $container->getDefinition(sprintf('stof_doctrine_extensions.listener.%s', $ext));
                $definition->addTag($doctrineSubscriberTag, $attributes);

                $usedManagers[$name] = true;
            }
        }

        return array_keys($usedManagers);
    }
103880
protected function loadConfigurationFile(array $config, XmlFileLoader $loader)
    {
        foreach ($config as $filename) {
            if (file_exists($file = sprintf('%s/%s.xml', $this->getConfigurationDirectory(), $filename))) {
                $loader->load($file);
            }
        }
    }