File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed
Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -157,6 +157,7 @@ public function beforeCompile(): void
157157 }
158158 }
159159
160+ $ aliases = [];
160161 // Try to detect command name from Command::getDefaultName()
161162 if ($ commandName === null ) {
162163 $ commandName = call_user_func ([$ service ->getType (), 'getDefaultName ' ]); // @phpstan-ignore-line
@@ -168,10 +169,19 @@ public function beforeCompile(): void
168169 )
169170 );
170171 }
172+ $ aliases = explode ('| ' , $ commandName );
173+ $ commandName = array_shift ($ aliases );
174+ if ($ commandName === '' ) {
175+ $ commandName = array_shift ($ aliases );
176+ }
171177 }
172178
173179 // Append service to command map
174180 $ commandMap [$ commandName ] = $ serviceName ;
181+
182+ foreach ($ aliases as $ alias ) {
183+ $ commandMap [$ alias ] = $ serviceName ;
184+ }
175185 }
176186
177187 /** @var ServiceDefinition $commandLoaderDef */
You can’t perform that action at this time.
0 commit comments