77
88class EECliCommand extends Command
99{
10-
1110 use CanAccessRestrictedClass;
1211
1312 public $ signature = 'eecli {args?*} ' ;
1413
15- public $ description = " Run ExpressionEngine commands through Coilpack " ;
14+ public $ description = ' Run ExpressionEngine commands through Coilpack ' ;
1615
1716 private $ cli ;
1817
1918 public function __construct ()
2019 {
2120 parent ::__construct ();
2221
23- if (($ _SERVER ['argv ' ][1 ] ?? '' ) != 'eecli ' ) {
22+ if (($ _SERVER ['argv ' ][1 ] ?? '' ) != 'eecli ' ) {
2423 return ;
2524 }
2625
@@ -29,10 +28,10 @@ public function __construct()
2928
3029 $ this ->setupCommand ($ _SERVER ['argv ' ][2 ] ?? 'list ' );
3130
32- foreach ($ _SERVER ['argv ' ] as $ arg ) {
31+ foreach ($ _SERVER ['argv ' ] as $ arg ) {
3332 // If we have a help flag we need to get out early so that it can be
3433 // handled by the ExpressionEngine Command and not by Symfony/Laravel
35- if ($ arg == '--help ' ) {
34+ if ($ arg == '--help ' ) {
3635 return $ this ->handle ();
3736 }
3837 }
@@ -42,7 +41,7 @@ protected function setupCommand($command)
4241 {
4342 $ availableCommands = $ this ->callRestrictedMethod ($ this ->cli , 'availableCommands ' );
4443
45- if (!array_key_exists ($ command , $ availableCommands )) {
44+ if (! array_key_exists ($ command , $ availableCommands )) {
4645 exit ("Command ' $ command' not found. " );
4746 }
4847
@@ -61,23 +60,22 @@ protected function setupCommand($command)
6160 $ this ->callRestrictedMethod ($ commandClass , 'loadOptions ' );
6261 // Convert ExpressionEngine Command's option syntax into Laravel's and update the signature
6362 $ options = $ this ->getRestrictedProperty ($ commandClass , 'commandOptions ' );
64- $ this ->signature = $ this ->signature . ' ' . implode (' ' , array_map (function ($ option ) {
65- if (strpos ($ option , 'verbose ' ) !== false ) {
63+ $ this ->signature = $ this ->signature . ' ' . implode (' ' , array_map (function ($ option ) {
64+ if (strpos ($ option , 'verbose ' ) !== false ) {
6665 return '' ;
6766 }
6867
6968 $ pieces = explode (', ' , $ option );
70- if (count ($ pieces ) == 2 ) {
71- $ option = substr ($ pieces [1 ], 0 , 1 ) . '| ' . $ pieces [0 ];
69+ if (count ($ pieces ) == 2 ) {
70+ $ option = substr ($ pieces [1 ], 0 , 1 ). '| ' . $ pieces [0 ];
7271 }
73- return "{-- " .$ option ."=} " ;
72+
73+ return '{-- ' .$ option .'=} ' ;
7474 }, array_keys ($ options )));
7575 }
7676
77-
7877 public function handle (): int
7978 {
8079 return $ this ->cli ->process ();
8180 }
82-
8381}
0 commit comments