Merge branch 'hotfix/move-is-level-fatal' of https://github.com/Vmak11/whoops into bugfix/fix-issue-with-stacktrace

Conflicts:
	src/Whoops/Exception/Inspector.php
	src/Whoops/Run.php
This commit is contained in:
Adam Vercimak
2015-08-12 09:17:07 -05:00
3 changed files with 21 additions and 14 deletions
+2 -2
View File
@@ -7,7 +7,7 @@
namespace Whoops\Exception;
use Exception;
use Whoops\Run;
use Whoops\Util\Misc;
class Inspector
{
@@ -160,7 +160,7 @@ class Inspector
return $traces;
}
if (!Run::isLevelFatal($e->getCode())) {
if (!Misc::isLevelFatal($e->getSeverity())) {
return $traces;
}
+2 -12
View File
@@ -13,6 +13,7 @@ use Whoops\Exception\Inspector;
use Whoops\Handler\CallbackHandler;
use Whoops\Handler\Handler;
use Whoops\Handler\HandlerInterface;
use Whoops\Util\Misc;
class Run
{
@@ -346,7 +347,7 @@ class Run
$this->canThrowExceptions = false;
$error = error_get_last();
if ($error && $this->isLevelFatal($error['type'])) {
if ($error && Misc::isLevelFatal($error['type'])) {
// If there was a fatal error,
// it was not handled in handleError yet.
$this->handleError(
@@ -394,15 +395,4 @@ class Run
return $this;
}
public static function isLevelFatal($level)
{
$errors = E_ERROR;
$errors |= E_PARSE;
$errors |= E_CORE_ERROR;
$errors |= E_CORE_WARNING;
$errors |= E_COMPILE_ERROR;
$errors |= E_COMPILE_WARNING;
return ($level & $errors) > 0;
}
}
+17
View File
@@ -41,4 +41,21 @@ class Misc
}
return "E_UNKNOWN";
}
/**
* Determine if an error level is fatal (halts execution)
*
* @param int $level
* @return boolean
*/
public static function isLevelFatal($level)
{
$errors = E_ERROR;
$errors |= E_PARSE;
$errors |= E_CORE_ERROR;
$errors |= E_CORE_WARNING;
$errors |= E_COMPILE_ERROR;
$errors |= E_COMPILE_WARNING;
return ($level & $errors) > 0;
}
}