Browse Source

Return type of Cake\Shell\Shell::abort() is void so it should never be used

Ondrej Mirtes 9 years ago
parent
commit
6386fcaac0
2 changed files with 5 additions and 2 deletions
  1. 3 0
      phpstan.neon
  2. 2 2
      src/Shell/I18nShell.php

+ 3 - 0
phpstan.neon

@@ -12,6 +12,9 @@ parameters:
 		- '#Access to undefined constant Memcached::DYNAMIC_CLIENT_MODE#'
 		- '#Access to undefined constant PDO::SQLSRV_ATTR_ENCODING#'
 		- '#Access to undefined constant PDO::SQLSRV_ENCODING_BINARY#'
+	earlyTerminatingMethodCalls:
+		Cake\Shell\Shell:
+			- abort
 
 services:
     -

+ 2 - 2
src/Shell/I18nShell.php

@@ -79,7 +79,7 @@ class I18nShell extends Shell
      * Inits PO file from POT file.
      *
      * @param string|null $language Language code to use.
-     * @return int|null
+     * @return void
      */
     public function init($language = null)
     {
@@ -87,7 +87,7 @@ class I18nShell extends Shell
             $language = $this->in('Please specify language code, e.g. `en`, `eng`, `en_US` etc.');
         }
         if (strlen($language) < 2) {
-            return $this->abort('Invalid language code. Valid is `en`, `eng`, `en_US` etc.');
+            $this->abort('Invalid language code. Valid is `en`, `eng`, `en_US` etc.');
         }
 
         $this->_paths = [APP];