{@inheritdoc}

@param ContainerBuilder $container

@throws \LogicException
@throws \ServiceBus\Common\Exceptions\FileSystemException

@return void
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);
        }
    }
609216
public function prepend(ContainerBuilder $container)
    {
        $this->declareReportAsCustomizable($container);
        $this->declareRouting($container);
        $this->prependRoleHierarchy($container);
    }
1186006
public function process(ContainerBuilder $container)
    {
        $taggedServices = $container->findTaggedServiceIds('chameleon_system_shop.payment_config_provider');

        $loaderDefinition = $container->getDefinition('chameleon_system_shop.payment.config_loader');

        foreach ($taggedServices as $serviceId => $attributes) {
            $systemName = null;
            foreach ($attributes as $tag) {
                foreach ($tag as $key => $value) {
                    if ('system_name' === $key) {
                        $systemName = $value;
                    }
                }
            }
            if (null === $systemName) {
                throw new LogicException(
                    "Services tagged with chameleon_system_shop.payment_config_provider need to provide a system_name attribute. This service doesn't have such an attribute: ".$serviceId
                );
            }

            $loaderDefinition->addMethodCall('addConfigProvider', array($systemName, new Reference($serviceId)));
        }
    }
952248
public function inject(ContainerBuilder $container)
    {
        foreach ($this->schema as $parameter) {

            $value = $parameter['default'];

            if ($this->parametersStorage->has($parameter['key'])) {
                $value = $this->parametersStorage->get($parameter['key']);
            }

            $container->setParameter($this->getParametersName($parameter['key']), $this->protectParameterValue($value));
        }
    }
777066
public function process(ContainerBuilder $container)
    {
        if (!$container->hasDefinition($this->subjectService)) {
            return;
        }

        $subjects = $this->findTaggedServices($container, $this->subjectTag, SubjectInterface::class, 'support', false);

        $subjectDefinition = $container->getDefinition($this->subjectService);
        $subjectDefinition->replaceArgument(0, $subjects);
    }
955849
public function build(ContainerBuilder $container)
    {
        parent::build($container);

        /** @var SecurityExtension $extension */
        $extension = $container->getExtension('security');
        $extension->addSecurityListenerFactory(new JoomlaFactory());

        $container->addCompilerPass(new DoctrineCompilerPass());
        $container->addCompilerPass(new OverrideCompilerPass());
        $container->addCompilerPass(new RoutingCompilerPass());
        $container->addCompilerPass(new ModuleCompilerPass());
        $container->addCompilerPass(new AdminMenuCompilerPass());
    }
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);
        }
    }
1255770
public function build(ContainerBuilder $container): void
    {
        parent::build($container);

        $container->addCompilerPass(new AddMenuVotersPass());
        $container->addCompilerPass(new ReplaceMenuMatcherPass());
        $container->addCompilerPass(new ConfigureAmazonMetaPass());
    }
669051
private function validateKinesisTransport(ContainerBuilder $container): void
    {
        if (!$container->hasDefinition('gdbots_pbjx.transport.kinesis_router')) {
            throw new \LogicException(
                'The service "gdbots_pbjx.transport.kinesis" has a dependency on a non-existent ' .
                'service "gdbots_pbjx.transport.kinesis_router". You must define this in your app ' .
                'since it requires stream names and partition logic. See \Gdbots\Pbjx\PartitionableRouter.'
            );
        }

        if (!$container->hasDefinition('aws.kinesis')) {
            throw new \LogicException(
                'The service "gdbots_pbjx.transport.kinesis" has a dependency on a non-existent ' .
                'service "aws.kinesis". This expects the Kinesis Client that comes from ' .
                'composer package "aws/aws-sdk-php-symfony": "^1.0".'
            );
        }
    }
1334978
public function process(ContainerBuilder $container)
    {
        $configs = $container->getExtensionConfig('nova_ezseo');

        //@todo: How to do that by SiteAccess
        if (isset($configs[0]['system']['default']['custom_fallback_service'])) {
            $fallbackService = $configs[0]['system']['default']['custom_fallback_service'];
            if ($fallbackService !== null) {
                $container->getDefinition('novactive.novaseobundle.twig_extension')->addMethodCall(
                    "setCustomFallbackService",
                    [new Reference($fallbackService)]
                );
            }
        }
    }
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();
    }
575012
public function process(ContainerBuilder $container)
    {
        if (!$container->hasDefinition('joomla.factory.database.driver.doctrine')) {
            return;
        }

        $doctrineFactory = $container->getDefinition('joomla.factory.database.driver.doctrine');
        $taggedServices = $container->findTaggedServiceIds('joomla.database');

        foreach (array_keys($taggedServices) as $id) {
            $platformDefinition = $container->getDefinition($id);
            $doctrineFactory->addMethodCall('addDatabasePlatform', [ $platformDefinition->getClass() ]);
        }

    }
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);
        }
    }
243951
public function process(ContainerBuilder $container)
    {
        $builderDefinition = $container->getDefinition(ItemBuilder::class);
        $factories = $container->findTaggedServiceIds('expansion.menu.item.factory');

        foreach ($factories as $id => $tags) {
            $builderDefinition->addMethodCall(
                "addItemFactory",
                [new Reference($id)]
            );
        }
    }
1004935
public function process(ContainerBuilder $container)
    {
        $this->buildApple($container);
        $this->buildAndroid($container);
        $this->buildWindows($container);
    }
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()));
            }
        }
    }
815573
public function process(ContainerBuilder $container)
    {
        if (!$container->hasDefinition('joomla.component.module.module_manager')) {
            return;
        }

        $moduleManagerDefinition = $container->getDefinition('joomla.component.module.module_manager');
        $taggedServices = $container->findTaggedServiceIds('joomla.module');

        foreach (array_keys($taggedServices) as $id) {
            $moduleDefinition = $container->getDefinition($id);
            $reflection = new \ReflectionClass($moduleDefinition->getClass());

            if (!$reflection->implementsInterface(ModuleRendererInterface::class)) {
                throw new \InvalidArgumentException(sprintf(
                    'Module service class %s does not implement %s',
                    $id,
                    ModuleRendererInterface::class
                ));
            }

            $moduleDefinition->addMethodCall('setFormFactory', [ new Reference('form.factory') ]);
            $moduleDefinition->addMethodCall('setTwigEnvironment', [ new Reference('twig') ]);
            $moduleDefinition->setScope(ContainerInterface::SCOPE_PROTOTYPE);
            $moduleManagerDefinition->addMethodCall('addModuleService', [ $id ]);
        }
    }