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

@param ContainerBuilder $container

@api
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)]);
        }
    }
297857
public function process(ContainerBuilder $container)
    {
        if (
            !$container->hasDefinition(self::VIEW_BUILDER_REGISTRY)
            || !$container->hasDefinition(self::VIEW_BUILDER_CONTENT_TRANSLATE)
        ) {
            return;
        }

        $registry = $container->findDefinition(self::VIEW_BUILDER_REGISTRY);

        $viewBuilders = [
            $container->getDefinition(self::VIEW_BUILDER_CONTENT_TRANSLATE),
        ];

        $registry->addMethodCall('addToRegistry', [$viewBuilders]);
    }
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]);
        }
    }
622708
public function build(ContainerBuilder $container)
    {
        parent::build($container);

        $container->addCompilerPass(
            new GeneratorHashCompilerPass(),
            PassConfig::TYPE_BEFORE_OPTIMIZATION,
            50
        );
    }
521863
public function build(ContainerBuilder $container)
    {
        parent::build($container);

        /**
         * Adds compiler pass.
         */
        $container
            ->addCompilerPass(new MappingCompilerPass())
            ->addCompilerPass(new ContextCompilerPass())
            ->addCompilerPass(new ExpressionLanguageCompilerPass());
    }
165706
public function process(ContainerBuilder $container)
    {
        if (!$container->hasParameter($this->enabledParameter)) {
            return;
        }

        $chainDriverDefService = $this->getChainDriverServiceName($container);
        $chainDriverDef = $container->getDefinition($chainDriverDefService);

        foreach ($this->namespaces as $namespace) {
            $chainDriverDef->addMethodCall('addDriver', [$this->driver, $namespace]);
        }
    }
596920
public function process(ContainerBuilder $container)
    {
        foreach ($container->findTaggedServiceIds($this->baseTag) as $id => $services) {
            foreach ((array) $services as $service) {
                $this->findAndReplaceTaggedServices($id, $service, $container);
            }
        }
    }
362999
public function process(ContainerBuilder $container)
    {
        $taggedServices = $container->findTaggedServiceIds($this->tagName);
        foreach ($taggedServices as $id => $tags) {

            $definition = $container->getDefinition($id);
            foreach ($tags as $tag) {

                $references = $this->getSortedDependencies(
                    $container,
                    $this->buildOptionsFromServiceTag($id, $tag)
                );

                $this->configureConsumer($definition, $tag, $references);
            }
        }
    }
663406
public function process(ContainerBuilder $container)
    {
        foreach ($container->getDefinitions() as $definition) {
            $interfaces = class_implements($definition->getClass());
            foreach ($interfaces as $interface) {
                if (substr($interface, -14) === 'AwareInterface') {
                    $camelCasedServiceId = substr($interface, strrpos($interface, '\\') + 1, -14);
                    $serviceId = Container::underscore($camelCasedServiceId);

                    if ($container->has($serviceId)) {
                        $setterMethod = 'set'.$camelCasedServiceId;

                        $definition->addMethodCall($setterMethod, array(new Reference($serviceId)));
                    }
                }
            }
        }
    }
1321203
public function process(ContainerBuilder $container)
    {
        $parameterBag = $container->getParameterBag();

        $parameterReplacer = $container->get(ServiceNames::PARAMETER_REPLACER);

        $parameterReplacer->processParameterBag($parameterBag, $container);
    }
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);
        }
    }
1282693
public function prepend(ContainerBuilder $container)
    {
        $config = [];
        $configuration = $this->getConfigurationInstance();
        if ($configuration instanceof ConfigurationInterface) {
            $config = $container->getExtensionConfig($this->getAlias());

            $config = $this->processConfiguration($configuration, $config);
            $config = $container->getParameterBag()->resolveValue($config);
        }

        $this->applyMappingParametrization($config, $container);
        $this->applyParametrizedValues($config, $container);
        $this->overrideEntities($container);
        $this->preLoad($config, $container);
    }
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]);
    }
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);
        }
    }
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()));
            }
        }
    }
246536
public function build(ContainerBuilder $container)
    {
        parent::build($container);

        $container->addCompilerPass(
            new DependencyInjection\Compiler\EventPropagationPass(),
            PassConfig::TYPE_BEFORE_OPTIMIZATION
        );
    }
979932
public function process(ContainerBuilder $container)
    {
        $this->container = $container;
        $this->signalingException = new RuntimeException('Invalid reference.');

        try {
            $this->processValue($container->getDefinitions(), 1);
        } finally {
            $this->container = $this->signalingException = null;
        }
    }