Browse Source

Clean up usage of _stop() and error().

mscherer 10 years ago
parent
commit
4fba5e9d35
1 changed files with 5 additions and 2 deletions
  1. 5 2
      src/Console/Shell.php

+ 5 - 2
src/Console/Shell.php

@@ -670,7 +670,7 @@ class Shell
      *
      * @param string $title Title of the error
      * @param string|null $message An optional error message
-     * @return void
+     * @return int Error code
      * @link http://book.cakephp.org/3.0/en/console-and-shells.html#styling-output
      */
     public function error($title, $message = null)
@@ -681,6 +681,8 @@ class Shell
             $this->_io->err($message);
         }
         $this->_stop(1);
+
+        return 1;
     }
 
     /**
@@ -720,7 +722,8 @@ class Shell
 
             if (strtolower($key) === 'q') {
                 $this->_io->out('<error>Quitting</error>.', 2);
-                return $this->_stop();
+                $this->_stop();
+                return false;
             }
             if (strtolower($key) === 'a') {
                 $this->params['force'] = true;