@@ -174,7 +174,7 @@ public function run($exit = true)
174174 * @param string $command A command name
175175 * @return int|mixed
176176 */
177- abstract protected function dispatch ($ command );
177+ abstract protected function dispatch (string $ command );
178178
179179 /**
180180 * run a independent command
@@ -287,7 +287,7 @@ protected function logError($e)
287287 /**
288288 * @param $command
289289 */
290- protected function filterSpecialCommand ($ command )
290+ protected function filterSpecialCommand (string $ command )
291291 {
292292 if (!$ command ) {
293293 if ($ this ->input ->getSameOpt (['V ' , 'version ' ])) {
@@ -484,7 +484,7 @@ public function showCommandList($quit = true)
484484 /**
485485 * @param string $name
486486 * @param string $default
487- * @return string
487+ * @return string|null
488488 */
489489 public function getCommandMessage ($ name , $ default = null )
490490 {
@@ -529,7 +529,7 @@ public function addCommandAliases(string $name, $aliases)
529529 * @param string $name
530530 * @return string
531531 */
532- protected function getRealCommandName (string $ name )
532+ protected function getRealCommandName (string $ name ): string
533533 {
534534 return $ this ->commandAliases [$ name ] ?? $ name ;
535535 }
@@ -541,15 +541,15 @@ protected function getRealCommandName(string $name)
541541 /**
542542 * @return array
543543 */
544- public function getControllerNames ()
544+ public function getControllerNames (): array
545545 {
546546 return array_keys ($ this ->controllers );
547547 }
548548
549549 /**
550550 * @return array
551551 */
552- public function getCommandNames ()
552+ public function getCommandNames (): array
553553 {
554554 return array_keys ($ this ->commands );
555555 }
@@ -581,7 +581,7 @@ public function getControllers(): array
581581 * @param $name
582582 * @return bool
583583 */
584- public function isController ($ name )
584+ public function isController (string $ name ): bool
585585 {
586586 return isset ($ this ->controllers [$ name ]);
587587 }
@@ -613,7 +613,7 @@ public function getCommands(): array
613613 * @param $name
614614 * @return bool
615615 */
616- public function isCommand ($ name )
616+ public function isCommand (string $ name ): bool
617617 {
618618 return isset ($ this ->commands [$ name ]);
619619 }
@@ -683,7 +683,7 @@ public function isInternalCommand(string $name): bool
683683 /**
684684 * @return string
685685 */
686- public function getName ()
686+ public function getName (): string
687687 {
688688 return $ this ->meta ['name ' ];
689689 }
@@ -705,7 +705,7 @@ public function setMeta(array $meta)
705705 * @param null|string $default
706706 * @return array|string
707707 */
708- public function getMeta ($ name = null , $ default = null )
708+ public function getMeta (string $ name = null , $ default = null )
709709 {
710710 if (!$ name ) {
711711 return $ this ->meta ;
@@ -727,7 +727,7 @@ public function isDebug()
727727 * is profile
728728 * @return boolean
729729 */
730- public function isProfile ()
730+ public function isProfile (): bool
731731 {
732732 return (bool )$ this ->input ->getOpt ('profile ' , $ this ->getMeta ('profile ' ));
733733 }
0 commit comments