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)) ); }