@@ -41,7 +41,7 @@ protected static function commandAliases(): array
4141 ];
4242 }
4343
44- protected function init ()
44+ protected function init (): void
4545 {
4646 parent ::init ();
4747
@@ -73,15 +73,15 @@ protected function afterExecute(): void
7373 * @example example text one
7474 * the second line example
7575 */
76- public function testCommand ()
76+ public function testCommand (): void
7777 {
7878 $ this ->write ('hello, welcome!! this is ' . __METHOD__ );
7979 }
8080
8181 /**
8282 * this is a disabled command. please see 'disabledCommands()'
8383 */
84- public function disabledCommand ()
84+ public function disabledCommand (): void
8585 {
8686 $ this ->write ('hello, welcome!! this is ' . __METHOD__ );
8787 }
@@ -90,7 +90,7 @@ public function disabledCommand()
9090 * command `defArgCommand` config
9191 * @throws \LogicException
9292 */
93- protected function defArgConfigure ()
93+ protected function defArgConfigure (): void
9494 {
9595 $ this ->createDefinition ()
9696 ->setDescription ('the command arg/opt config use defined configure, it like symfony console: argument define by position ' )
@@ -102,7 +102,7 @@ protected function defArgConfigure()
102102 /**
103103 * the command arg/opt config use defined configure, it like symfony console: argument define by position
104104 */
105- public function defArgCommand ()
105+ public function defArgCommand (): void
106106 {
107107 $ this ->output ->dump ($ this ->input ->getArgs (), $ this ->input ->getOpts (), $ this ->input ->getBoolOpt ('y ' ));
108108 }
@@ -111,23 +111,23 @@ public function defArgCommand()
111111 * a command for test throw exception
112112 * @throws \RuntimeException
113113 */
114- public function exCommand ()
114+ public function exCommand (): void
115115 {
116116 throw new \RuntimeException ('oo, this is a runtime exception! ' );
117117 }
118118
119119 /**
120120 * a command for test trigger error
121121 */
122- public function errorCommand ()
122+ public function errorCommand (): void
123123 {
124124 \trigger_error ('oo, this is a runtime error! ' , E_USER_ERROR );
125125 }
126126
127127 /**
128128 * will run other command in the command.
129129 */
130- public function subRunCommand ()
130+ public function subRunCommand (): void
131131 {
132132 $ this ->writeln ('hello this is: ' . __METHOD__ );
133133
@@ -137,15 +137,15 @@ public function subRunCommand()
137137 /**
138138 * dump current env information
139139 */
140- public function dumpEnvCommand ()
140+ public function dumpEnvCommand (): void
141141 {
142142 $ this ->output ->aList ($ _SERVER , '$_SERVER data ' );
143143 }
144144
145145 /**
146146 * check color support for current env.
147147 */
148- public function colorCheckCommand ()
148+ public function colorCheckCommand (): void
149149 {
150150 // $char= '❤';
151151 // $ret = ProcessUtil::run('echo ❤');
@@ -214,7 +214,7 @@ public function counterCommand(): int
214214 /**
215215 * dynamic spinner message, by Show::spinner()
216216 */
217- public function spinnerCommand ()
217+ public function spinnerCommand (): void
218218 {
219219 $ total = 5000 ;
220220
@@ -229,7 +229,7 @@ public function spinnerCommand()
229229 /**
230230 * dynamic notice message show: pending
231231 */
232- public function pendingCommand ()
232+ public function pendingCommand (): void
233233 {
234234 $ total = 8000 ;
235235
@@ -244,7 +244,7 @@ public function pendingCommand()
244244 /**
245245 * dynamic notice message show: pointing
246246 */
247- public function pointingCommand ()
247+ public function pointingCommand (): void
248248 {
249249 $ total = 100 ;
250250
@@ -259,7 +259,7 @@ public function pointingCommand()
259259 /**
260260 * dynamic text message example, by Show::dynamicText
261261 */
262- public function dynamicTextCommand ()
262+ public function dynamicTextCommand (): void
263263 {
264264 $ dt = Show::dynamicText ('Complete ' , 'Download file: xyz.zip ... ' );
265265 $ dt ->send ('Start ' );
@@ -317,7 +317,7 @@ public function progressCommand($input): int
317317 * a progress bar example show, by class ProgressBar
318318 * @throws \LogicException
319319 */
320- public function progressBarCommand ()
320+ public function progressBarCommand (): void
321321 {
322322 $ i = 0 ;
323323 $ total = 120 ;
@@ -336,7 +336,7 @@ public function progressBarCommand()
336336 /**
337337 * output format message: list
338338 */
339- public function listCommand ()
339+ public function listCommand (): void
340340 {
341341 $ list = [
342342 'The is a list line 0 ' ,
@@ -360,7 +360,7 @@ public function listCommand()
360360 /**
361361 * output format message: multiList
362362 */
363- public function multiListCommand ()
363+ public function multiListCommand (): void
364364 {
365365 Show::multiList ([
366366 'list0 ' => [
@@ -387,7 +387,7 @@ public function multiListCommand()
387387 /**
388388 * output format message: table
389389 */
390- public function tableCommand ()
390+ public function tableCommand (): void
391391 {
392392 $ data = [
393393 [
@@ -443,7 +443,7 @@ public function tableCommand()
443443 /**
444444 * output format message: padding
445445 */
446- public function paddingCommand ()
446+ public function paddingCommand (): void
447447 {
448448 $ data = [
449449 'Eggs ' => '$1.99 ' ,
@@ -461,7 +461,7 @@ public function paddingCommand()
461461 * home:useArg status=2 name=john arg0 -s=test --page=23 -d -rf --debug --test=false -a v1 --ab -c -g --cd val -h '' -i stat=online
462462 * home:useArg status=2 name=john name=tom name=jack arg0 -s=test --page=23 --id=23 --id=154 --id=456 -d -rf --debug --test=false
463463 */
464- public function useArgCommand ()
464+ public function useArgCommand (): void
465465 {
466466 $ this ->write ('input arguments: ' );
467467 $ this ->output ->dump ($ this ->input ->getArgs ());
@@ -479,7 +479,7 @@ public function useArgCommand()
479479 /**
480480 * output current env info
481481 */
482- public function envCommand ()
482+ public function envCommand (): void
483483 {
484484 $ info = [
485485 'phpVersion ' => PHP_VERSION ,
@@ -497,7 +497,7 @@ public function envCommand()
497497 * @usage {command} url=url saveTo=[saveAs] type=[bar|text]
498498 * @example {command} url=https://github.com/inhere/php-console/archive/master.zip type=bar
499499 */
500- public function downCommand ()
500+ public function downCommand (): int
501501 {
502502 $ url = $ this ->input ->getArg ('url ' );
503503
0 commit comments