DependencyInjection/Compiler/ThemeProviderPass.php
public function process(ContainerBuilder $container)
    {
        // Register $provider for Doctrine ORM or ODM, fallback to lazy provider otherwise
        $themeProviderFactoryDefinition = $container->findDefinition(ThemeProviderFactory::class);

        if ($container->hasDefinition(DoctrineOrmSettingsProvider::class)) {
            $themeProviderFactoryDefinition->setArgument('$provider',
                new Reference(DoctrineOrmSettingsProvider::class));
        } elseif ($container->hasDefinition(DoctrineOdmSettingsProvider::class)) {
            $themeProviderFactoryDefinition->setArgument('$provider',
                new Reference(DoctrineOdmSettingsProvider::class));
        } else {
            $themeProviderFactoryDefinition->setArgument('$provider',
                new Reference('settings_manager.provider.config'));
        }
    }
public function process(ContainerBuilder $container)
    {
        // Register $provider for Doctrine ORM or ODM, fallback to lazy provider otherwise
        $themeProviderFactoryDefinition = $container->findDefinition(ThemeProviderFactory::class);

        if ($container->hasDefinition(DoctrineOrmSettingsProvider::class)) {
            $themeProviderFactoryDefinition->setArgument('$provider',
                new Reference(DoctrineOrmSettingsProvider::class));
        } elseif ($container->hasDefinition(DoctrineOdmSettingsProvider::class)) {
            $themeProviderFactoryDefinition->setArgument('$provider',
                new Reference(DoctrineOdmSettingsProvider::class));
        } else {
            $themeProviderFactoryDefinition->setArgument('$provider',
                new Reference('settings_manager.provider.config'));
        }
    }
You can modify the container here before it is dumped to PHP code.

@param ContainerBuilder $container