Commit ed556d19 authored by alexpott's avatar alexpott

Issue #1913162 by katbailey: Remove unused 'matcher' compiler pass.

parent 3bc754a6
......@@ -13,7 +13,6 @@
use Drupal\Core\DependencyInjection\Compiler\ModifyServiceDefinitionsPass;
use Drupal\Core\DependencyInjection\Compiler\RegisterKernelListenersPass;
use Drupal\Core\DependencyInjection\Compiler\RegisterAccessChecksPass;
use Drupal\Core\DependencyInjection\Compiler\RegisterMatchersPass;
use Drupal\Core\DependencyInjection\Compiler\RegisterPathProcessorsPass;
use Drupal\Core\DependencyInjection\Compiler\RegisterRouteFiltersPass;
use Drupal\Core\DependencyInjection\Compiler\RegisterRouteEnhancersPass;
......@@ -52,7 +51,6 @@ public function register(ContainerBuilder $container) {
$this->registerTwig($container);
$this->registerModuleHandler($container);
$container->addCompilerPass(new RegisterMatchersPass());
$container->addCompilerPass(new RegisterRouteFiltersPass());
// Add a compiler pass for registering event subscribers.
$container->addCompilerPass(new RegisterKernelListenersPass(), PassConfig::TYPE_AFTER_REMOVING);
......
<?php
/**
* @file
* Contains Drupal\Core\DependencyInjection\Compiler\RegisterMatchersPass.
*/
namespace Drupal\Core\DependencyInjection\Compiler;
use Symfony\Component\DependencyInjection\Reference;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
/**
* Adds services tagged 'chained_matcher' to the 'matcher' service.
*/
class RegisterMatchersPass implements CompilerPassInterface {
/**
* Adds services tagged 'chained_matcher' to the 'matcher' service.
*
* @param \Symfony\Component\DependencyInjection\ContainerBuilder $container
* The container to process.
*/
public function process(ContainerBuilder $container) {
if (!$container->hasDefinition('matcher')) {
return;
}
$matcher = $container->getDefinition('matcher');
foreach ($container->findTaggedServiceIds('chained_matcher') as $id => $attributes) {
$priority = isset($attributes[0]['priority']) ? $attributes[0]['priority'] : 0;
$matcher->addMethodCall('add', array(new Reference($id), $priority));
}
}
}
......@@ -2,7 +2,7 @@
/**
* @file
* Contains Drupal\Core\DependencyInjection\Compiler\RegisterNestedMatchersPass.
* Contains Drupal\Core\DependencyInjection\Compiler\RegisterRouteFiltersPass.
*/
namespace Drupal\Core\DependencyInjection\Compiler;
......@@ -12,12 +12,12 @@
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
/**
* Adds services tagged 'nested_matcher' to the tagged_matcher service.
* Adds services tagged 'router.matcher' to the matcher service.
*/
class RegisterRouteFiltersPass implements CompilerPassInterface {
/**
* Adds services tagged 'nested_matcher' to the tagged_matcher service.
* Adds services tagged 'router.matcher' to the matcher service.
*
* @param \Symfony\Component\DependencyInjection\ContainerBuilder $container
* The container to process.
......@@ -26,9 +26,9 @@ public function process(ContainerBuilder $container) {
if (!$container->hasDefinition('router.matcher')) {
return;
}
$nested = $container->getDefinition('router.matcher');
$matcher = $container->getDefinition('router.matcher');
foreach ($container->findTaggedServiceIds('route_filter') as $id => $attributes) {
$nested->addMethodCall('addRouteFilter', array(new Reference($id)));
$matcher->addMethodCall('addRouteFilter', array(new Reference($id)));
}
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment