You are here

public function RegisterLazyRouteEnhancers::process in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 core/lib/Drupal/Core/DependencyInjection/Compiler/RegisterLazyRouteEnhancers.php \Drupal\Core\DependencyInjection\Compiler\RegisterLazyRouteEnhancers::process()

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

Parameters

ContainerBuilder $container:

Overrides CompilerPassInterface::process

File

core/lib/Drupal/Core/DependencyInjection/Compiler/RegisterLazyRouteEnhancers.php, line 22
Contains \Drupal\Core\DependencyInjection\Compiler\RegisterLazyRouteEnhancers.

Class

RegisterLazyRouteEnhancers
Registers all lazy route enhancers onto the lazy route enhancers.

Namespace

Drupal\Core\DependencyInjection\Compiler

Code

public function process(ContainerBuilder $container) {
  if (!$container
    ->hasDefinition('route_enhancer.lazy_collector')) {
    return;
  }
  $service_ids = [];
  foreach ($container
    ->findTaggedServiceIds('route_enhancer') as $id => $attributes) {
    $service_ids[$id] = $id;
  }
  $container
    ->getDefinition('route_enhancer.lazy_collector')
    ->addArgument($service_ids);
}