@@ -201,19 +201,25 @@ protected function describeApplication(Application $application, array $options
201
201
$ commands = $ description ->getCommands ();
202
202
203
203
foreach ($ description ->getNamespaces () as $ namespace ) {
204
+ $ namespace ['commands ' ] = array_filter ($ namespace ['commands ' ], function ($ name ) use ($ commands ) {
205
+ return isset ($ commands [$ name ]);
206
+ });
207
+
208
+ if (!$ namespace ['commands ' ]) {
209
+ continue ;
210
+ }
211
+
204
212
if (!$ describedNamespace && ApplicationDescription::GLOBAL_NAMESPACE !== $ namespace ['id ' ]) {
205
213
$ this ->writeText ("\n" );
206
214
$ this ->writeText (' <comment> ' .$ namespace ['id ' ].'</comment> ' , $ options );
207
215
}
208
216
209
217
foreach ($ namespace ['commands ' ] as $ name ) {
210
- if (isset ($ commands [$ name ])) {
211
- $ this ->writeText ("\n" );
212
- $ spacingWidth = $ width - strlen ($ name );
213
- $ command = $ commands [$ name ];
214
- $ commandAliases = $ this ->getCommandAliasesText ($ command );
215
- $ this ->writeText (sprintf (' <info>%s</info>%s%s ' , $ name , str_repeat (' ' , $ spacingWidth ), $ commandAliases .$ command ->getDescription ()), $ options );
216
- }
218
+ $ this ->writeText ("\n" );
219
+ $ spacingWidth = $ width - strlen ($ name );
220
+ $ command = $ commands [$ name ];
221
+ $ commandAliases = $ this ->getCommandAliasesText ($ command );
222
+ $ this ->writeText (sprintf (' <info>%s</info>%s%s ' , $ name , str_repeat (' ' , $ spacingWidth ), $ commandAliases .$ command ->getDescription ()), $ options );
217
223
}
218
224
}
219
225
@@ -234,9 +240,9 @@ private function writeText($content, array $options = array())
234
240
235
241
/**
236
242
* Formats command aliases to show them in the command description.
237
- *
243
+ *
238
244
* @param Command $command
239
- *
245
+ *
240
246
* @return string
241
247
*/
242
248
private function getCommandAliasesText ($ command )
0 commit comments