Removes private aliases from the ContainerBuilder.

@param ContainerBuilder $container
326100
public function process(ContainerBuilder $container)
    {
        $compiler = $container->getCompiler();
        $formatter = $compiler->getLoggingFormatter();

        foreach ($container->getAliases() as $id => $alias) {
            if ($alias->isPublic()) {
                continue;
            }

            $container->removeAlias($id);
            $compiler->addLogMessage($formatter->formatRemoveService($this, $id, 'private alias'));
        }
    }
1112815
private function getLockingStorageAliases(ContainerBuilder $container)
    {
        $taggedServices = $container->findTaggedServiceIds('task.lock.storage');

        $result = [];
        foreach ($taggedServices as $id => $tags) {
            foreach ($tags as $tag) {
                $result[$tag['alias']] = $id;
            }
        }

        return $result;
    }
684112
public function process(ContainerBuilder $container)
    {
        if ($container->hasDefinition($this->loggerTag)) {
            $logger = new Reference($this->loggerTag);

            $reportBugCommandDefinition = $container->getDefinition(ReportBugCommand::class);
            $reportBugCommandDefinition->addMethodCall('setLogger', [$logger]);
        }
    }
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();
    }
1052498
public function prepend(ContainerBuilder $container)
    {
        $prependConfig = $this->getExtendedConfig($container);

        if (!empty($prependConfig)) {
            $container->prependExtensionConfig($this->getAlias(), $prependConfig);
        }
    }
1281123
protected function fixSettings(ContainerBuilder $container)
    {
        $pool = $container->getDefinition('sonata.admin.manager.doctrine_phpcr');

        // @todo not very clean but don't know how to do that for now
        $settings = false;
        $methods = $pool->getMethodCalls();
        foreach ($methods as $pos => $calls) {
            if ('__hack_doctrine_phpcr__' == $calls[0]) {
                $settings = $calls[1];

                break;
            }
        }

        if ($settings) {
            unset($methods[$pos]);
        }

        $pool->setMethodCalls($methods);

        return $settings;
    }
283090
public function process(ContainerBuilder $container): void
    {
        if ($container->has('ezpublish.image_alias.imagine.cache_resolver')) {
            $container
                ->findDefinition('ezpublish.image_alias.imagine.cache_resolver')
                ->setClass(IORepositoryResolver::class);
        }
    }
210209
private function configurePlugins(ContainerBuilder $container, array $config)
    {
        if (!empty($config['authentication'])) {
            $this->configureAuthentication($container, $config['authentication']);
        }
        unset($config['authentication']);

        foreach ($config as $name => $pluginConfig) {
            $pluginId = 'httplug.plugin.'.$name;

            if ($this->isConfigEnabled($container, $pluginConfig)) {
                $def = $container->getDefinition($pluginId);
                $this->configurePluginByName($name, $def, $pluginConfig, $container, $pluginId);
            }
        }
    }
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');
    }
362167
public function build(ContainerBuilder $container)
    {
        parent::build($container);

        /*
         * Adds compiler passes.
         */
        foreach ($this->getCompilerPasses() as $compilerPass) {
            $container->addCompilerPass($compilerPass);
        }
    }
1241199
public function process(ContainerBuilder $container)
    {
        if (!$container->hasDefinition('thelia.translator')) {
            return;
        }

        $translator = $container->getDefinition('thelia.translator');

        foreach ($container->findTaggedServiceIds('translation.loader') as $id => $attributes) {
            $translator->addMethodCall('addLoader', array($attributes[0]['alias'], new Reference($id)));
            if (isset($attributes[0]['legacy-alias'])) {
                $translator->addMethodCall('addLoader', array($attributes[0]['legacy-alias'], new Reference($id)));
            }
        }
    }
1006443
public function process(ContainerBuilder $container): void
    {
        if (!$container->hasDefinition('twig.cache_warmer') || !$container->hasDefinition('twig.template_cache_warmer')) {
            return;
        }
        // disable cache warm-up as it breaks the inheritance
        $container->getDefinition('twig.cache_warmer')->clearTag('kernel.cache_warmer');
        $container->getDefinition('twig.template_cache_warmer')->clearTag('kernel.cache_warmer');
    }
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);
        }
    }
26343
public function build(ContainerBuilder $container)
    {
        $container->addCompilerPass(new CommandProcessorPass(), PassConfig::TYPE_BEFORE_REMOVING);
        $container->addCompilerPass(new PoolsPass());
        $container->addCompilerPass(new RegisterSerializerDriversPass());
        $container->addCompilerPass(new WorkerRunnersPass());
    }
1141418
public function process(ContainerBuilder $container)
    {
        if (!$container->hasDefinition(TabRegistry::class)) {
            return;
        }

        $tabRegistry = $container->getDefinition(TabRegistry::class);
        $tabGroupDefinition = new Definition(TabGroup::class, ['systeminfo']);
        $tabRegistry->addMethodCall('addTabGroup', [$tabGroupDefinition]);
    }
1055870
public function process(ContainerBuilder $container)
    {
        $taggedServices = $container->findTaggedServiceIds($this->tagName);
        foreach ($taggedServices as $id => $tags) {

            $reference = new Reference($id);
            foreach ($tags as $attr) {

                $tag = $this->getAttribute($id, $attr, 'tag');
                $method = $this->getAttribute($id, $attr, 'method');

                $this->injectInto($reference, $container, $tag, $method);
            }
        }
    }
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);
        }
    }