File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1616use Symfony \Component \Console \Application as BaseApplication ;
1717use Symfony \Component \Console \Command \Command ;
1818use Symfony \Component \Console \Input \InputDefinition ;
19+ use Symfony \Component \Console \Input \InputInterface ;
1920use Symfony \Component \Console \Input \InputOption ;
2021
2122use function count ;
2223use function getcwd ;
2324use function is_array ;
25+ use function is_string ;
2426use function iterator_to_array ;
2527
2628final class Application extends BaseApplication
@@ -63,4 +65,22 @@ protected function getDefaultInputDefinition(): InputDefinition
6365
6466 return $ definition ;
6567 }
68+
69+ protected function getCommandName (InputInterface $ input ): string |null
70+ {
71+ if ($ input ->hasArgument ('command ' ) === false ) {
72+ return parent ::getCommandName ($ input );
73+ }
74+
75+ $ command = $ input ->getArgument ('command ' );
76+ if ($ command === null ) {
77+ return 'run ' ;
78+ }
79+
80+ if (is_string ($ command )) {
81+ return $ command ;
82+ }
83+
84+ return null ;
85+ }
6686}
You can’t perform that action at this time.
0 commit comments