From 8b497babeff4f3ede83ff4ecee2809477547bb86 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Dunglas?= Date: Tue, 31 May 2016 18:12:47 +0200 Subject: [PATCH 1/2] Fix BC break introduced by #18101 --- .../DependencyInjection/Compiler/AddConsoleCommandPass.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/AddConsoleCommandPass.php b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/AddConsoleCommandPass.php index 09e8948ded0f3..6c20c83af106f 100644 --- a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/AddConsoleCommandPass.php +++ b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/AddConsoleCommandPass.php @@ -38,7 +38,7 @@ public function process(ContainerBuilder $container) throw new \InvalidArgumentException(sprintf('The service "%s" tagged "console.command" must be a subclass of "Symfony\\Component\\Console\\Command\\Command".', $id)); } $container->setAlias($serviceId = 'console.command.'.strtolower(str_replace('\\', '_', $class)), $id); - $serviceIds[] = $serviceId; + $serviceIds[] = $definition->isPublic() ? $id : $serviceId; } $container->setParameter('console.command.ids', $serviceIds); From 05fbad771f9097104a1359d6b9396858de6c45a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Dunglas?= Date: Tue, 31 May 2016 19:00:48 +0200 Subject: [PATCH 2/2] Fix tests --- .../DependencyInjection/Compiler/AddConsoleCommandPassTest.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Compiler/AddConsoleCommandPassTest.php b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Compiler/AddConsoleCommandPassTest.php index 72902c99cd4d0..d488405544d32 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Compiler/AddConsoleCommandPassTest.php +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Compiler/AddConsoleCommandPassTest.php @@ -45,8 +45,9 @@ public function testProcess($public) $this->assertTrue($container->hasDefinition($alias)); } + $id = $public ? 'my-command' : 'console.command.symfony_bundle_frameworkbundle_tests_dependencyinjection_compiler_mycommand'; $this->assertTrue($container->hasParameter('console.command.ids')); - $this->assertSame(array('console.command.symfony_bundle_frameworkbundle_tests_dependencyinjection_compiler_mycommand'), $container->getParameter('console.command.ids')); + $this->assertSame(array($id), $container->getParameter('console.command.ids')); } public function visibilityProvider()