class RegisterRouteFiltersPass

Adds services tagged 'nested_matcher' to the tagged_matcher service.

Hierarchy

Expanded class hierarchy of RegisterRouteFiltersPass

1 file declares its use of RegisterRouteFiltersPass
CoreBundle.php in drupal/core/lib/Drupal/Core/CoreBundle.php
Definition of Drupal\Core\CoreBundle.

File

drupal/core/lib/Drupal/Core/DependencyInjection/Compiler/RegisterRouteFiltersPass.php, line 17
Contains Drupal\Core\DependencyInjection\Compiler\RegisterNestedMatchersPass.

Namespace

Drupal\Core\DependencyInjection\Compiler
View source
class RegisterRouteFiltersPass implements CompilerPassInterface {

  /**
   * Adds services tagged 'nested_matcher' to the tagged_matcher service.
   *
   * @param \Symfony\Component\DependencyInjection\ContainerBuilder $container
   *   The container to process.
   */
  public function process(ContainerBuilder $container) {
    if (!$container
      ->hasDefinition('router.matcher')) {
      return;
    }
    $nested = $container
      ->getDefinition('router.matcher');
    foreach ($container
      ->findTaggedServiceIds('route_filter') as $id => $attributes) {
      $nested
        ->addMethodCall('addRouteFilter', array(
        new Reference($id),
      ));
    }
  }

}

Members

Namesort descending Modifiers Type Description Overrides
RegisterRouteFiltersPass::process public function Adds services tagged 'nested_matcher' to the tagged_matcher service. Overrides CompilerPassInterface::process