From 0945f27e81ace7753ca66953eabebef4363a5985 Mon Sep 17 00:00:00 2001 From: Ruud Kamphuis Date: Sun, 28 Apr 2019 12:45:56 +0200 Subject: [PATCH] Made `debug:container` and `debug:autowiring` ignore starting backslash in service id --- .../Bundle/FrameworkBundle/Command/ContainerDebugCommand.php | 2 ++ .../Tests/Functional/ContainerDebugCommandTest.php | 1 + 2 files changed, 3 insertions(+) diff --git a/src/Symfony/Bundle/FrameworkBundle/Command/ContainerDebugCommand.php b/src/Symfony/Bundle/FrameworkBundle/Command/ContainerDebugCommand.php index 9b5193d63bce..9debddcad771 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Command/ContainerDebugCommand.php +++ b/src/Symfony/Bundle/FrameworkBundle/Command/ContainerDebugCommand.php @@ -220,6 +220,8 @@ protected function getContainerBuilder() private function findProperServiceName(InputInterface $input, SymfonyStyle $io, ContainerBuilder $builder, string $name, bool $showHidden) { + $name = ltrim($name, '\\'); + if ($builder->has($name) || !$input->isInteractive()) { return $name; } diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/ContainerDebugCommandTest.php b/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/ContainerDebugCommandTest.php index ee13386a4b76..61ffa68aed44 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/ContainerDebugCommandTest.php +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/ContainerDebugCommandTest.php @@ -85,6 +85,7 @@ public function provideIgnoreBackslashWhenFindingService() return [ [BackslashClass::class], ['FixturesBackslashClass'], + ['\\'.BackslashClass::class], ]; } }