class ContextProvidersPass in Zircon Profile 8
Same name and namespace in other branches
- 8.0 core/lib/Drupal/Core/DependencyInjection/Compiler/ContextProvidersPass.php \Drupal\Core\DependencyInjection\Compiler\ContextProvidersPass
 
Adds the context provider service IDs to the context manager.
Hierarchy
- class \Drupal\Core\DependencyInjection\Compiler\ContextProvidersPass implements CompilerPassInterface
 
Expanded class hierarchy of ContextProvidersPass
1 file declares its use of ContextProvidersPass
- CoreServiceProvider.php in core/
lib/ Drupal/ Core/ CoreServiceProvider.php  - Contains \Drupal\Core\CoreServiceProvider.
 
File
- core/
lib/ Drupal/ Core/ DependencyInjection/ Compiler/ ContextProvidersPass.php, line 16  - Contains \Drupal\Core\DependencyInjection\Compiler\ContextProvidersPass.
 
Namespace
Drupal\Core\DependencyInjection\CompilerView source
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);
  }
}Members
| 
            Name | 
                  Modifiers | Type | Description | Overrides | 
|---|---|---|---|---|
| 
            ContextProvidersPass:: | 
                  public | function | 
            Passes the service IDs of all context providers to the context repository. Overrides CompilerPassInterface:: |