You can modify the container here before it is dumped to PHP code.

@param ContainerBuilder $container

@api
11593
public function process(ContainerBuilder $container)
    {
        if (
            $container->hasDefinition("nelmio_api_doc.parser.jms_metadata_parser") &&
            (
                $container->getAlias("fos_rest.serializer") == "tpg_extjs.orm_serializer" ||
                $container->getAlias("fos_rest.serializer") == "tpg_extjs.odm_serializer" ||
                $container->getAlias("fos_rest.serializer") == "tpg_extjs.serializer"
            )
        ) {
            $container
                ->getDefinition("nelmio_api_doc.parser.jms_metadata_parser")
                ->replaceArgument(1, new Reference("tpg_extjs.naming_strategy"));
        }
    }
964313
public function process(ContainerBuilder $container)
    {
        $compiler = $container->getCompiler();
        $formatter = $compiler->getLoggingFormatter();

        foreach ($container->getDefinitions() as $id => $definition) {
            if ($definition->isAbstract()) {
                $container->removeDefinition($id);
                $compiler->addLogMessage($formatter->formatRemoveService($this, $id, 'abstract'));
            }
        }
    }
431093
public function process(ContainerBuilder $container)
    {
        if (!$container->hasDefinition(static::TASK_REGISTRY)) {
            return;
        }

        $registry = $container->getDefinition(static::TASK_REGISTRY);

        foreach ($container->findTaggedServiceIds(static::TASK_TAG) as $id => $tag) {
            $registry->addMethodCall("addTask", [new Reference($id)]);
        }
    }
653685
public function prepend(ContainerBuilder $container)
    {
        $configs = $container->getExtensionConfig($this->getAlias());
        $config = $this->processConfiguration(new Configuration(), $configs);

        $bundles = $container->getParameter('kernel.bundles');

        // Publish assetic assets if desired
        if ($config['assets']['publish'] && isset($bundles['AsseticBundle'])) {
            $container->prependExtensionConfig('assetic', array('assets' => $this->getAssets($config)));
        }
    }
178182
public function process(ContainerBuilder $container)
    {
        if (!$container->has($this->serviceId)) {
            return;
        }
        $definition = $container->findDefinition($this->serviceId);
        $handlers = array();
        $this->collectServiceIds(
            $container,
            $this->tag,
            $this->keyAttribute,
            function ($key, $serviceId, array $tagAttributes) use (&$handlers) {
                if (isset($tagAttributes['method'])) {
                    $callable = [$serviceId, $tagAttributes['method']];
                } else {
                    $callable = $serviceId;
                }
                $handlers[ltrim($key, '\\')] = $callable;
            }
        );
        $definition->replaceArgument(0, $handlers);
    }
6099
public function process(ContainerBuilder $container)
    {
        if (!$container->hasDefinition(TaggedServices::class)) {
            return;
        }

        $manager = $container->getDefinition(TaggedServices::class);

        $definitions = $container->getDefinitions();
        foreach ($definitions as $id => $definition) {
            foreach ($definition->getTags() as $tagName => $tagAttributes) {
                $manager->addMethodCall(
                    'addSpecification',
                    [$id, $tagName, $tagAttributes[0]]
                );
            }
        }
    }
857663
public function build(ContainerBuilder $container)
    {
        $this->initAdmingeneratorClassLoader($container);

        parent::build($container);

        $container->addCompilerPass(new ValidatorCompilerPass());
        $container->addCompilerPass(new FormCompilerPass());
    }
1338139
public function process(ContainerBuilder $container)
    {
        $filters = $container->findTaggedServiceIds(self::TAG_EVENTS_FILTER);
        $filtersRepoDef = $container->getDefinition('smartesb.registry.event_filters');

        foreach ($filters as $serviceName => $tags) {
            $filtersRepoDef->addMethodCall('addDeferringFilter', [new Reference($serviceName)]);
        }
    }
340604
public function build(ContainerBuilder $container)
    {
        parent::build($container);

        $container->addCompilerPass(new VersionCompilerPass(new PrettyVersions()));
        $container->addCompilerPass(new EnvParametersCompilerPass());
        $container->addCompilerPass(new RouteLoaderCompilerPass());
        $container->addCompilerPass(new HttpClientOptionsCompilerPass());
    }
787392
public function process(ContainerBuilder $container)
    {
        if (!$container->has('support_tools.system_info.output_registry')) {
            return;
        }

        $outputFormattersTagged = $container->findTaggedServiceIds('support_tools.system_info.output_format');

        $outputFormatters = [];
        foreach ($outputFormattersTagged as $id => $tags) {
            foreach ($tags as $attributes) {
                $outputFormatters[$attributes['format']] = new Reference($id);
            }
        }

        $outputFormatRegistryDef = $container->findDefinition('support_tools.system_info.output_registry');
        $outputFormatRegistryDef->setArguments([$outputFormatters]);
    }
1255770
public function build(ContainerBuilder $container): void
    {
        parent::build($container);

        $container->addCompilerPass(new AddMenuVotersPass());
        $container->addCompilerPass(new ReplaceMenuMatcherPass());
        $container->addCompilerPass(new ConfigureAmazonMetaPass());
    }
1057065
public function build(ContainerBuilder $container)
    {
        parent::build($container);

        $container->registerExtension(new CoralCoreExtension());

        $container->addCompilerPass(new ConnectorCompilerPass);
    }
23024
public function prepend(ContainerBuilder $container)
    {
        $this->prependViews($container);
        $this->prependImageVariations($container);
        $this->prependUniversalDiscoveryWidget($container);
        $this->prependEzDesignConfiguration($container);
        $this->prependAdminUiFormsConfiguration($container);
        $this->prependBazingaJsTranslationConfiguration($container);
    }
158242
public function process(ContainerBuilder $container)
    {
        if (!$container->hasDefinition('stack_factory')) {
            return;
        }

        $stackFactory = $container->getDefinition('stack_factory');
        $stackPriority = [];

        foreach ($container->findTaggedServiceIds('stack_middleware') as $id => $attributes) {
            $priority = isset($attributes[0]['priority']) ? $attributes[0]['priority'] : 0;
            $stackPriority[$priority][] = $this->retrieveArguments($container, $id);
        }

        if (false === empty($stackPriority)) {
            $this->addMiddlewares($stackFactory, $stackPriority);
        }
    }
14660
public function process(ContainerBuilder $container)
    {
        $this->setServiceAlias( $container, HeliopsisEzFormsExtension::FACADE_SERVICE_ID );
        $this->setServiceAlias( $container, HeliopsisEzFormsExtension::FORM_PROVIDER_SERVICE_ID );
        $this->setServiceAlias( $container, HeliopsisEzFormsExtension::HANDLER_PROVIDER_SERVICE_ID );
        $this->setServiceAlias( $container, HeliopsisEzFormsExtension::RESPONSE_PROVIDER_SERVICE_ID );
    }
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)]
            );
        }
    }
604930
public function prepend(ContainerBuilder $container)
    {
        $container->prependExtensionConfig('framework', [
            'translator' => [
                'paths' => [
                    dirname(dirname((new \ReflectionClass(LazyChainProvider::class))->getFileName())).'/Resources/translations',
                ],
            ],
        ]);
    }