8000 bug #18925 [Console] Fix BC break introduced by #18101 (dunglas) · symfony/symfony@c7f1f78 · GitHub
[go: up one dir, main page]

Skip to content
10000

Commit c7f1f78

Browse files
committed
bug #18925 [Console] Fix BC break introduced by #18101 (dunglas)
This PR was squashed before being merged into the 3.1 branch (closes #18925). Discussion ---------- [Console] Fix BC break introduced by #18101 | Q | A | ------------- | --- | Branch? | 3.1 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | no | Fixed tickets | #18101 (comment) | License | MIT | Doc PR | n/a * [x] Fix tests Commits ------- 7a5a139 [Console] Fix BC break introduced by #18101
2 parents 44f5283 + 7a5a139 commit c7f1f78

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/AddConsoleCommandPass.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public function process(ContainerBuilder $container)
3838
throw new \InvalidArgumentException(sprintf('The service "%s" tagged "console.command" must be a subclass of "Symfony\\Component\\Console\\Command\\Command".', $id));
3939
}
4040
$container->setAlias($serviceId = 'console.command.'.strtolower(str_replace('\\', '_', $class)), $id);
41-
$serviceIds[] = $serviceId;
41+
$serviceIds[] = $definition->isPublic() ? $id : $serviceId;
4242
}
4343

4444
$container->setParameter('console.command.ids', $serviceIds);

src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Compiler/AddConsoleCommandPassTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,9 @@ public function testProcess($public)
4545
$this->assertTrue($container->hasDefinition($alias));
4646
}
4747

48+
$id = $public ? 'my-command' : 'console.command.symfony_bundle_frameworkbundle_tests_dependencyinjection_compiler_mycommand';
4849
$this->assertTrue($container->hasParameter('console.command.ids'));
49-
$this->assertSame(array('console.command.symfony_bundle_frameworkbundle_tests_dependencyinjection_compiler_mycommand'), $container->getParameter('console.command.ids'));
50+
$this->assertSame(array($id), $container->getParameter('console.command.ids'));
5051
}
5152

5253
public function visibilityProvider()

0 commit comments

Comments
 (0)
0