lithium\console\Command::stop PHP Method

stop() public method

Stop execution, by exiting the script.
public stop ( integer $status, string | null $message = null ) : void
$status integer Numeric value that will be used on `exit()`.
$message string | null An optional message that will be written to the stream.
return void
    public function stop($status = 0, $message = null)
    {
        if ($message) {
            $status == 0 ? $this->out($message) : $this->error($message);
        }
        exit($status);
    }

Usage Example

 /**
  * Exit immediately. Primarily used for overrides during testing.
  *
  * @param integer|string $status integer range 0 to 254, string printed on exit
  * @return void
  */
 protected function _stop($status = 0)
 {
     if ($this->process['logOpened']) {
         closelog();
         $this->process['logOpened'] = false;
     }
     return parent::stop($status);
 }