@@ -99,7 +99,7 @@ class App
9999 /**
100100 * Class constructor.
101101 *
102- * @param array $config
102+ * @param array $config
103103 * @param array|null $argv
104104 */
105105 public function __construct (array $ config = [], array $ argv = null )
@@ -186,7 +186,7 @@ protected function doHandle(): int
186186 }
187187
188188 if (!isset ($ this ->commands [$ command ])) {
189- $ this ->displayHelp ("The command ' { $ command} ' is not exists! " );
189+ $ this ->displayHelp ("The command ' $ command' is not exists! " );
190190 return 0 ;
191191 }
192192
@@ -201,15 +201,15 @@ protected function doHandle(): int
201201 $ status = $ this ->handleException ($ e );
202202 }
203203
204- return $ status ;
204+ return ( int ) $ status ;
205205 }
206206
207207 /**
208208 * @param int $code
209209 */
210210 public function stop (int $ code = 0 ): void
211211 {
212- exit (( int ) $ code );
212+ exit ($ code );
213213 }
214214
215215 /**
@@ -369,16 +369,17 @@ public function commands(array $commands): void
369369 public function displayHelp (string $ err = '' ): void
370370 {
371371 if ($ err ) {
372- Color ::println ("<red>ERROR</red>: $ err \n" );
372+ Cli ::println ("<red>ERROR</red>: $ err \n" );
373373 }
374374
375375 // help
376- $ desc = ucfirst ($ this ->metas ['desc ' ]);
376+ $ desc = ucfirst ($ this ->metas ['desc ' ]);
377377 if ($ ver = $ this ->metas ['version ' ]) {
378378 $ desc .= "(<red>v $ ver</red>) " ;
379379 }
380380
381- $ usage = "<cyan> {$ this ->script } COMMAND -h</cyan> " ;
381+ $ script = $ this ->script ;
382+ $ usage = "<cyan> $ script COMMAND -h</cyan> " ;
382383
383384 $ help = "$ desc \n\n<comment>Usage:</comment> $ usage \n<comment>Commands:</comment> \n" ;
384385 $ data = $ this ->messages ;
@@ -390,9 +391,9 @@ public function displayHelp(string $err = ''): void
390391 $ help .= " <green> $ command</green> $ desc \n" ;
391392 }
392393
393- $ help .= "\nFor command usage please run: <cyan> { $ this -> script } COMMAND -h</cyan> " ;
394+ $ help .= "\nFor command usage please run: <cyan> $ script COMMAND -h</cyan> " ;
394395
395- Color ::println ($ help );
396+ Cli ::println ($ help );
396397 }
397398
398399 /**
@@ -435,7 +436,7 @@ public function displayCommandHelp(string $name): void
435436 ]);
436437 }
437438
438- Color ::println ($ help );
439+ Cli ::println ($ help );
439440 }
440441
441442 /**
0 commit comments