File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change 16
16
use Symfony \Component \Console \Application as BaseApplication ;
17
17
use Symfony \Component \Console \Command \Command ;
18
18
use Symfony \Component \Console \Input \InputDefinition ;
19
+ use Symfony \Component \Console \Input \InputInterface ;
19
20
use Symfony \Component \Console \Input \InputOption ;
20
21
21
22
use function count ;
22
23
use function getcwd ;
23
24
use function is_array ;
25
+ use function is_string ;
24
26
use function iterator_to_array ;
25
27
26
28
final class Application extends BaseApplication
@@ -63,4 +65,22 @@ protected function getDefaultInputDefinition(): InputDefinition
63
65
64
66
return $ definition ;
65
67
}
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
+ }
66
86
}
You can’t perform that action at this time.
0 commit comments