From 215ad1f93d4e38e6d27ba71a226ee3849c69bed7 Mon Sep 17 00:00:00 2001 From: Douglas Hammond Date: Mon, 1 Jun 2020 10:45:15 -0400 Subject: [PATCH] [DependencyInjection] Apply ExpressionLanguageProviderPass to router.default --- .../Compiler/AddExpressionLanguageProvidersPass.php | 4 ++-- .../AddExpressionLanguageProvidersPassTest.php | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/AddExpressionLanguageProvidersPass.php b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/AddExpressionLanguageProvidersPass.php index 47195b48300f..3e2f2768edc1 100644 --- a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/AddExpressionLanguageProvidersPass.php +++ b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/AddExpressionLanguageProvidersPass.php @@ -28,8 +28,8 @@ class AddExpressionLanguageProvidersPass implements CompilerPassInterface public function process(ContainerBuilder $container) { // routing - if ($container->has('router')) { - $definition = $container->findDefinition('router'); + if ($container->has('router.default')) { + $definition = $container->findDefinition('router.default'); foreach ($container->findTaggedServiceIds('routing.expression_language_provider', true) as $id => $attributes) { $definition->addMethodCall('addExpressionLanguageProvider', [new Reference($id)]); } diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Compiler/AddExpressionLanguageProvidersPassTest.php b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Compiler/AddExpressionLanguageProvidersPassTest.php index 95ed74f8b9fc..1207a4820d10 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Compiler/AddExpressionLanguageProvidersPassTest.php +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Compiler/AddExpressionLanguageProvidersPassTest.php @@ -22,16 +22,16 @@ class AddExpressionLanguageProvidersPassTest extends TestCase public function testProcessForRouter() { $container = new ContainerBuilder(); - $container->addCompilerPass(new AddExpressionLanguageProvidersPass(false)); + $container->addCompilerPass(new AddExpressionLanguageProvidersPass()); $definition = new Definition('\stdClass'); $definition->addTag('routing.expression_language_provider'); $container->setDefinition('some_routing_provider', $definition->setPublic(true)); - $container->register('router', '\stdClass')->setPublic(true); + $container->register('router.default', '\stdClass')->setPublic(true); $container->compile(); - $router = $container->getDefinition('router'); + $router = $container->getDefinition('router.default'); $calls = $router->getMethodCalls(); $this->assertCount(1, $calls); $this->assertEquals('addExpressionLanguageProvider', $calls[0][0]); @@ -41,14 +41,14 @@ public function testProcessForRouter() public function testProcessForRouterAlias() { $container = new ContainerBuilder(); - $container->addCompilerPass(new AddExpressionLanguageProvidersPass(false)); + $container->addCompilerPass(new AddExpressionLanguageProvidersPass()); $definition = new Definition('\stdClass'); $definition->addTag('routing.expression_language_provider'); $container->setDefinition('some_routing_provider', $definition->setPublic(true)); $container->register('my_router', '\stdClass')->setPublic(true); - $container->setAlias('router', 'my_router'); + $container->setAlias('router.default', 'my_router'); $container->compile(); $router = $container->getDefinition('my_router');