@@ -28,7 +28,7 @@ class App
28
28
private $ opts = [];
29
29
30
30
/** @var string */
31
- private $ script = '' ;
31
+ private $ script ;
32
32
33
33
/** @var string */
34
34
private $ command = '' ;
@@ -68,7 +68,7 @@ public function __construct(array $argv = null)
68
68
* @param bool $exit
69
69
* @throws \InvalidArgumentException
70
70
*/
71
- public function run (bool $ exit = true )
71
+ public function run (bool $ exit = true ): void
72
72
{
73
73
if (isset ($ this ->args [0 ])) {
74
74
$ this ->command = $ this ->args [0 ];
@@ -82,7 +82,7 @@ public function run(bool $exit = true)
82
82
* @param bool $exit
83
83
* @throws \InvalidArgumentException
84
84
*/
85
- public function dispatch (bool $ exit = true )
85
+ public function dispatch (bool $ exit = true ): void
86
86
{
87
87
if (!$ command = $ this ->command ) {
88
88
$ this ->displayHelp ();
@@ -109,7 +109,7 @@ public function dispatch(bool $exit = true)
109
109
/**
110
110
* @param int $code
111
111
*/
112
- public function stop ($ code = 0 )
112
+ public function stop ($ code = 0 ): void
113
113
{
114
114
exit ((int )$ code );
115
115
}
@@ -172,7 +172,7 @@ protected function handleException(\Throwable $e): int
172
172
* @param string $description
173
173
* @throws \InvalidArgumentException
174
174
*/
175
- public function addCommand (string $ command , callable $ handler , string $ description = '' )
175
+ public function addCommand (string $ command , callable $ handler , string $ description = '' ): void
176
176
{
177
177
if (!$ command || !$ handler ) {
178
178
throw new \InvalidArgumentException ('Invalid arguments ' );
@@ -186,7 +186,7 @@ public function addCommand(string $command, callable $handler, string $descripti
186
186
* @param array $commands
187
187
* @throws \InvalidArgumentException
188
188
*/
189
- public function commands (array $ commands )
189
+ public function commands (array $ commands ): void
190
190
{
191
191
foreach ($ commands as $ command => $ handler ) {
192
192
$ des = '' ;
@@ -208,7 +208,7 @@ public function commands(array $commands)
208
208
/**
209
209
* @param string $err
210
210
*/
211
- public function displayHelp (string $ err = '' )
211
+ public function displayHelp (string $ err = '' ): void
212
212
{
213
213
if ($ err ) {
214
214
echo Color::render ("<red>ERROR</red>: $ err \n\n" );
@@ -263,7 +263,7 @@ public function getArgs(): array
263
263
/**
264
264
* @param array $args
265
265
*/
266
- public function setArgs (array $ args )
266
+ public function setArgs (array $ args ): void
267
267
{
268
268
$ this ->args = $ args ;
269
269
}
@@ -279,7 +279,7 @@ public function getOpts(): array
279
279
/**
280
280
* @param array $opts
281
281
*/
282
- public function setOpts (array $ opts )
282
+ public function setOpts (array $ opts ): void
283
283
{
284
284
$ this ->opts = $ opts ;
285
285
}
@@ -295,7 +295,7 @@ public function getScript(): string
295
295
/**
296
296
* @param string $script
297
297
*/
298
- public function setScript (string $ script )
298
+ public function setScript (string $ script ): void
299
299
{
300
300
$ this ->script = $ script ;
301
301
}
@@ -311,7 +311,7 @@ public function getCommand(): string
311
311
/**
312
312
* @param string $command
313
313
*/
314
- public function setCommand (string $ command )
314
+ public function setCommand (string $ command ): void
315
315
{
316
316
$ this ->command = $ command ;
317
317
}
0 commit comments