From 15570cd1b31ceffddc1b0d5c4ab49911d59a7167 Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Tue, 10 Mar 2020 16:57:32 +0100 Subject: [PATCH] Revert "minor #35559 [FrameworkBundle] remove mention of the old Controller class (nicolas-grekas)" This reverts commit 6bb64734894fe1a37f51ef499fdac37f101352b2, reversing changes made to 4cce23d9ca20e447239a42e57137e744a78f65f9. --- .../RemoveEmptyControllerArgumentLocatorsPass.php | 2 ++ .../RemoveEmptyControllerArgumentLocatorsPassTest.php | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Symfony/Component/HttpKernel/DependencyInjection/RemoveEmptyControllerArgumentLocatorsPass.php b/src/Symfony/Component/HttpKernel/DependencyInjection/RemoveEmptyControllerArgumentLocatorsPass.php index 79e67374b2253..73f5ff2a74a5b 100644 --- a/src/Symfony/Component/HttpKernel/DependencyInjection/RemoveEmptyControllerArgumentLocatorsPass.php +++ b/src/Symfony/Component/HttpKernel/DependencyInjection/RemoveEmptyControllerArgumentLocatorsPass.php @@ -51,6 +51,8 @@ public function process(ContainerBuilder $container) } } if (!$reason) { + $controllers[$id.':'.$action] = $argumentRef; + if ('__invoke' === $action) { $controllers[$id] = $argumentRef; } diff --git a/src/Symfony/Component/HttpKernel/Tests/DependencyInjection/RemoveEmptyControllerArgumentLocatorsPassTest.php b/src/Symfony/Component/HttpKernel/Tests/DependencyInjection/RemoveEmptyControllerArgumentLocatorsPassTest.php index 6c840aedca306..b5e55bdea9e97 100644 --- a/src/Symfony/Component/HttpKernel/Tests/DependencyInjection/RemoveEmptyControllerArgumentLocatorsPassTest.php +++ b/src/Symfony/Component/HttpKernel/Tests/DependencyInjection/RemoveEmptyControllerArgumentLocatorsPassTest.php @@ -49,7 +49,7 @@ public function testProcess() $controllers = $container->getDefinition((string) $resolver->getArgument(0))->getArgument(0); - $this->assertSame(['c1::fooAction'], array_keys($controllers)); + $this->assertSame(['c1::fooAction', 'c1:fooAction'], array_keys($controllers)); $this->assertSame(['bar'], array_keys($container->getDefinition((string) $controllers['c1::fooAction']->getValues()[0])->getArgument(0))); $expectedLog = [ @@ -73,7 +73,7 @@ public function testInvoke() (new RemoveEmptyControllerArgumentLocatorsPass())->process($container); $this->assertEquals( - ['invokable::__invoke', 'invokable'], + ['invokable::__invoke', 'invokable:__invoke', 'invokable'], array_keys($container->getDefinition((string) $resolver->getArgument(0))->getArgument(0)) ); }