@@ -47,7 +47,7 @@ class ContainerDebugCommand extends Command
4747 protected function configure ()
4848 {
4949 $ this
50- ->setDefinition (array (
50+ ->setDefinition ([
5151 new InputArgument ('name ' , InputArgument::OPTIONAL , 'A service name (foo) ' ),
5252 new InputOption ('show-private ' , null , InputOption::VALUE_NONE , 'Used to show public *and* private services (deprecated) ' ),
5353 new InputOption ('show-arguments ' , null , InputOption::VALUE_NONE , 'Used to show arguments in services ' ),
@@ -59,7 +59,7 @@ protected function configure()
5959 new InputOption ('types ' , null , InputOption::VALUE_NONE , 'Displays types (classes/interfaces) available in the container ' ),
6060 new InputOption ('format ' , null , InputOption::VALUE_REQUIRED , 'The output format (txt, xml, json, or md) ' , 'txt ' ),
6161 new InputOption ('raw ' , null , InputOption::VALUE_NONE , 'To output raw description ' ),
62- ) )
62+ ] )
6363 ->setDescription ('Displays current services for an application ' )
6464 ->setHelp (<<<'EOF'
6565The <info>%command.name%</info> command displays all configured <comment>public</comment> services:
@@ -116,26 +116,26 @@ protected function execute(InputInterface $input, OutputInterface $output)
116116 $ object = $ this ->getContainerBuilder ();
117117
118118 if ($ input ->getOption ('types ' )) {
119- $ options = array () ;
120- $ options ['filter ' ] = array ( $ this , 'filterToServiceTypes ' ) ;
119+ $ options = [] ;
120+ $ options ['filter ' ] = [ $ this , 'filterToServiceTypes ' ] ;
121121 } elseif ($ input ->getOption ('parameters ' )) {
122- $ parameters = array () ;
122+ $ parameters = [] ;
123123 foreach ($ object ->getParameterBag ()->all () as $ k => $ v ) {
124124 $ parameters [$ k ] = $ object ->resolveEnvPlaceholders ($ v );
125125 }
126126 $ object = new ParameterBag ($ parameters );
127- $ options = array () ;
127+ $ options = [] ;
128128 } elseif ($ parameter = $ input ->getOption ('parameter ' )) {
129- $ options = array ( 'parameter ' => $ parameter) ;
129+ $ options = [ 'parameter ' => $ parameter] ;
130130 } elseif ($ input ->getOption ('tags ' )) {
131- $ options = array ( 'group_by ' => 'tags ' ) ;
131+ $ options = [ 'group_by ' => 'tags ' ] ;
132132 } elseif ($ tag = $ input ->getOption ('tag ' )) {
133- $ options = array ( 'tag ' => $ tag) ;
133+ $ options = [ 'tag ' => $ tag] ;
134134 } elseif ($ name = $ input ->getArgument ('name ' )) {
135135 $ name = $ this ->findProperServiceName ($ input , $ errorIo , $ object , $ name , $ input ->getOption ('show-hidden ' ));
136- $ options = array ( 'id ' => $ name) ;
136+ $ options = [ 'id ' => $ name] ;
137137 } else {
138- $ options = array () ;
138+ $ options = [] ;
139139 }
140140
141141 $ helper = new DescriptorHelper ();
@@ -164,7 +164,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
164164 */
165165 protected function validateInput (InputInterface $ input )
166166 {
167- $ options = array ( 'tags ' , 'tag ' , 'parameters ' , 'parameter ' ) ;
167+ $ options = [ 'tags ' , 'tag ' , 'parameters ' , 'parameter ' ] ;
168168
169169 $ optionsCount = 0 ;
170170 foreach ($ options as $ option ) {
@@ -199,7 +199,7 @@ protected function getContainerBuilder()
199199 if (!$ kernel ->isDebug () || !(new ConfigCache ($ kernel ->getContainer ()->getParameter ('debug.container.dump ' ), true ))->isFresh ()) {
200200 $ buildContainer = \Closure::bind (function () { return $ this ->buildContainer (); }, $ kernel , \get_class ($ kernel ));
201201 $ container = $ buildContainer ();
202- $ container ->getCompilerPassConfig ()->setRemovingPasses (array () );
202+ $ container ->getCompilerPassConfig ()->setRemovingPasses ([] );
203203 $ container ->compile ();
204204 } else {
205205 (new XmlFileLoader ($ container = new ContainerBuilder (), new FileLocator ()))->load ($ kernel ->getContainer ()->getParameter ('debug.container.dump ' ));
@@ -227,7 +227,7 @@ private function findProperServiceName(InputInterface $input, SymfonyStyle $io,
227227 private function findServiceIdsContaining (ContainerBuilder $ builder , string $ name , bool $ showHidden )
228228 {
229229 $ serviceIds = $ builder ->getServiceIds ();
230- $ foundServiceIds = array () ;
230+ $ foundServiceIds = [] ;
231231 foreach ($ serviceIds as $ serviceId ) {
232232 if (!$ showHidden && 0 === strpos ($ serviceId , '. ' )) {
233233 continue ;
0 commit comments