Upgrade to 3.5.5
This commit is contained in:
34
kirby/vendor/filp/whoops/src/Whoops/Run.php
vendored
34
kirby/vendor/filp/whoops/src/Whoops/Run.php
vendored
@@ -38,6 +38,11 @@ final class Run implements RunInterface
|
||||
*/
|
||||
private $sendHttpCode = 500;
|
||||
|
||||
/**
|
||||
* @var integer|false
|
||||
*/
|
||||
private $sendExitCode = 1;
|
||||
|
||||
/**
|
||||
* @var HandlerInterface[]
|
||||
*/
|
||||
@@ -288,6 +293,31 @@ final class Run implements RunInterface
|
||||
return $this->sendHttpCode = $code;
|
||||
}
|
||||
|
||||
/**
|
||||
* Should Whoops exit with a specific code on the CLI if possible?
|
||||
* Whoops will exit with 1 by default, but you can specify something else.
|
||||
*
|
||||
* @param int $code
|
||||
*
|
||||
* @return int
|
||||
*
|
||||
* @throws InvalidArgumentException
|
||||
*/
|
||||
public function sendExitCode($code = null)
|
||||
{
|
||||
if (func_num_args() == 0) {
|
||||
return $this->sendExitCode;
|
||||
}
|
||||
|
||||
if ($code < 0 || 255 <= $code) {
|
||||
throw new InvalidArgumentException(
|
||||
"Invalid status code '$code', must be between 0 and 254"
|
||||
);
|
||||
}
|
||||
|
||||
return $this->sendExitCode = (int) $code;
|
||||
}
|
||||
|
||||
/**
|
||||
* Should Whoops push output directly to the client?
|
||||
* If this is false, output will be returned by handleException.
|
||||
@@ -380,7 +410,9 @@ final class Run implements RunInterface
|
||||
// HHVM fix for https://github.com/facebook/hhvm/issues/4055
|
||||
$this->system->flushOutputBuffer();
|
||||
|
||||
$this->system->stopExecution(1);
|
||||
$this->system->stopExecution(
|
||||
$this->sendExitCode()
|
||||
);
|
||||
}
|
||||
|
||||
return $output;
|
||||
|
Reference in New Issue
Block a user