
| Current Path : /var/www/html/store/web/core/lib/Drupal/Core/DependencyInjection/Compiler/ |
Linux ift1.ift-informatik.de 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64 |
| Current File : /var/www/html/store/web/core/lib/Drupal/Core/DependencyInjection/Compiler/ContextProvidersPass.php |
<?php
namespace Drupal\Core\DependencyInjection\Compiler;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
/**
* Adds the context provider service IDs to the context manager.
*/
class ContextProvidersPass implements CompilerPassInterface {
/**
* {@inheritdoc}
*
* Passes the service IDs of all context providers to the context repository.
*/
public function process(ContainerBuilder $container) {
$context_providers = [];
foreach (array_keys($container->findTaggedServiceIds('context_provider')) as $id) {
$context_providers[] = $id;
}
$definition = $container->getDefinition('context.repository');
$definition->addArgument($context_providers);
}
}