From 3c6043ecdd65b19476bcfed1e6643d791a887f9d Mon Sep 17 00:00:00 2001 From: Oleg Voronkovich Date: Mon, 8 Feb 2016 17:06:11 +0300 Subject: [PATCH] Improve debug:container command --- .../Bundle/FrameworkBundle/Command/ContainerDebugCommand.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Symfony/Bundle/FrameworkBundle/Command/ContainerDebugCommand.php b/src/Symfony/Bundle/FrameworkBundle/Command/ContainerDebugCommand.php index f88ecd6cd4530..6e5c7d3981c5f 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Command/ContainerDebugCommand.php +++ b/src/Symfony/Bundle/FrameworkBundle/Command/ContainerDebugCommand.php @@ -192,7 +192,9 @@ private function findProperServiceName(InputInterface $input, SymfonyStyle $io, throw new \InvalidArgumentException(sprintf('No services found that match "%s".', $name)); } - return $io->choice('Select one of the following services to display its information', $matchingServices); + $default = 1 === count($matchingServices) ? $matchingServices[0] : null; + + return $io->choice('Select one of the following services to display its information', $matchingServices, $default); } private function findServiceIdsContaining(ContainerBuilder $builder, $name)