@@ -28,7 +28,7 @@ class App
2828 private $ opts = [];
2929
3030 /** @var string */
31- private $ script = '' ;
31+ private $ script ;
3232
3333 /** @var string */
3434 private $ command = '' ;
@@ -68,7 +68,7 @@ public function __construct(array $argv = null)
6868 * @param bool $exit
6969 * @throws \InvalidArgumentException
7070 */
71- public function run (bool $ exit = true )
71+ public function run (bool $ exit = true ): void
7272 {
7373 if (isset ($ this ->args [0 ])) {
7474 $ this ->command = $ this ->args [0 ];
@@ -82,7 +82,7 @@ public function run(bool $exit = true)
8282 * @param bool $exit
8383 * @throws \InvalidArgumentException
8484 */
85- public function dispatch (bool $ exit = true )
85+ public function dispatch (bool $ exit = true ): void
8686 {
8787 if (!$ command = $ this ->command ) {
8888 $ this ->displayHelp ();
@@ -109,7 +109,7 @@ public function dispatch(bool $exit = true)
109109 /**
110110 * @param int $code
111111 */
112- public function stop ($ code = 0 )
112+ public function stop ($ code = 0 ): void
113113 {
114114 exit ((int )$ code );
115115 }
@@ -172,7 +172,7 @@ protected function handleException(\Throwable $e): int
172172 * @param string $description
173173 * @throws \InvalidArgumentException
174174 */
175- public function addCommand (string $ command , callable $ handler , string $ description = '' )
175+ public function addCommand (string $ command , callable $ handler , string $ description = '' ): void
176176 {
177177 if (!$ command || !$ handler ) {
178178 throw new \InvalidArgumentException ('Invalid arguments ' );
@@ -186,7 +186,7 @@ public function addCommand(string $command, callable $handler, string $descripti
186186 * @param array $commands
187187 * @throws \InvalidArgumentException
188188 */
189- public function commands (array $ commands )
189+ public function commands (array $ commands ): void
190190 {
191191 foreach ($ commands as $ command => $ handler ) {
192192 $ des = '' ;
@@ -208,7 +208,7 @@ public function commands(array $commands)
208208 /**
209209 * @param string $err
210210 */
211- public function displayHelp (string $ err = '' )
211+ public function displayHelp (string $ err = '' ): void
212212 {
213213 if ($ err ) {
214214 echo Color::render ("<red>ERROR</red>: $ err \n\n" );
@@ -263,7 +263,7 @@ public function getArgs(): array
263263 /**
264264 * @param array $args
265265 */
266- public function setArgs (array $ args )
266+ public function setArgs (array $ args ): void
267267 {
268268 $ this ->args = $ args ;
269269 }
@@ -279,7 +279,7 @@ public function getOpts(): array
279279 /**
280280 * @param array $opts
281281 */
282- public function setOpts (array $ opts )
282+ public function setOpts (array $ opts ): void
283283 {
284284 $ this ->opts = $ opts ;
285285 }
@@ -295,7 +295,7 @@ public function getScript(): string
295295 /**
296296 * @param string $script
297297 */
298- public function setScript (string $ script )
298+ public function setScript (string $ script ): void
299299 {
300300 $ this ->script = $ script ;
301301 }
@@ -311,7 +311,7 @@ public function getCommand(): string
311311 /**
312312 * @param string $command
313313 */
314- public function setCommand (string $ command )
314+ public function setCommand (string $ command ): void
315315 {
316316 $ this ->command = $ command ;
317317 }
0 commit comments