From fbea81c9639bc0ecdaf723004262a9735c6ec310 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 | 3 +++ .../RemoveEmptyControllerArgumentLocatorsPassTest.php | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/Symfony/Component/HttpKernel/DependencyInjection/RemoveEmptyControllerArgumentLocatorsPass.php b/src/Symfony/Component/HttpKernel/DependencyInjection/RemoveEmptyControllerArgumentLocatorsPass.php index 79e67374b225..cc1109110910 100644 --- a/src/Symfony/Component/HttpKernel/DependencyInjection/RemoveEmptyControllerArgumentLocatorsPass.php +++ b/src/Symfony/Component/HttpKernel/DependencyInjection/RemoveEmptyControllerArgumentLocatorsPass.php @@ -51,6 +51,9 @@ public function process(ContainerBuilder $container) } } if (!$reason) { + // see Symfony\Component\HttpKernel\Controller\ContainerControllerResolver + $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 6c840aedca30..b5e55bdea9e9 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)) ); }