@@ -99,7 +99,7 @@ class App
99
99
/**
100
100
* Class constructor.
101
101
*
102
- * @param array $config
102
+ * @param array $config
103
103
* @param array|null $argv
104
104
*/
105
105
public function __construct (array $ config = [], array $ argv = null )
@@ -186,7 +186,7 @@ protected function doHandle(): int
186
186
}
187
187
188
188
if (!isset ($ this ->commands [$ command ])) {
189
- $ this ->displayHelp ("The command ' { $ command} ' is not exists! " );
189
+ $ this ->displayHelp ("The command ' $ command' is not exists! " );
190
190
return 0 ;
191
191
}
192
192
@@ -201,15 +201,15 @@ protected function doHandle(): int
201
201
$ status = $ this ->handleException ($ e );
202
202
}
203
203
204
- return $ status ;
204
+ return ( int ) $ status ;
205
205
}
206
206
207
207
/**
208
208
* @param int $code
209
209
*/
210
210
public function stop (int $ code = 0 ): void
211
211
{
212
- exit (( int ) $ code );
212
+ exit ($ code );
213
213
}
214
214
215
215
/**
@@ -369,16 +369,17 @@ public function commands(array $commands): void
369
369
public function displayHelp (string $ err = '' ): void
370
370
{
371
371
if ($ err ) {
372
- Color ::println ("<red>ERROR</red>: $ err \n" );
372
+ Cli ::println ("<red>ERROR</red>: $ err \n" );
373
373
}
374
374
375
375
// help
376
- $ desc = ucfirst ($ this ->metas ['desc ' ]);
376
+ $ desc = ucfirst ($ this ->metas ['desc ' ]);
377
377
if ($ ver = $ this ->metas ['version ' ]) {
378
378
$ desc .= "(<red>v $ ver</red>) " ;
379
379
}
380
380
381
- $ usage = "<cyan> {$ this ->script } COMMAND -h</cyan> " ;
381
+ $ script = $ this ->script ;
382
+ $ usage = "<cyan> $ script COMMAND -h</cyan> " ;
382
383
383
384
$ help = "$ desc \n\n<comment>Usage:</comment> $ usage \n<comment>Commands:</comment> \n" ;
384
385
$ data = $ this ->messages ;
@@ -390,9 +391,9 @@ public function displayHelp(string $err = ''): void
390
391
$ help .= " <green> $ command</green> $ desc \n" ;
391
392
}
392
393
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> " ;
394
395
395
- Color ::println ($ help );
396
+ Cli ::println ($ help );
396
397
}
397
398
398
399
/**
@@ -435,7 +436,7 @@ public function displayCommandHelp(string $name): void
435
436
]);
436
437
}
437
438
438
- Color ::println ($ help );
439
+ Cli ::println ($ help );
439
440
}
440
441
441
442
/**
0 commit comments