[Console] ensure exit code between 0-254
255 is reserved by PHP and should not be used also put this code inside the codeCoverageIgnore block because it cannot be tested with phpunit
This commit is contained in:
parent
445b2e3dad
commit
6b9180a23d
@ -126,11 +126,9 @@ class Application
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ($this->autoExit) {
|
if ($this->autoExit) {
|
||||||
if ($statusCode > 255) {
|
// ensure exit code is between 0-254 (255 is reserved by PHP and should not be used)
|
||||||
$statusCode = 255;
|
|
||||||
}
|
|
||||||
// @codeCoverageIgnoreStart
|
// @codeCoverageIgnoreStart
|
||||||
exit($statusCode);
|
exit(max(0, min(254, $statusCode)));
|
||||||
// @codeCoverageIgnoreEnd
|
// @codeCoverageIgnoreEnd
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user