Commit 35de471a authored by Qiang Xue's avatar Qiang Xue

Merge pull request #1327 from kamilsk/master

fix issue #1315
parents 3a613e85 7e12ae57
...@@ -20,7 +20,7 @@ class ErrorException extends Exception ...@@ -20,7 +20,7 @@ class ErrorException extends Exception
protected $severity; protected $severity;
/** /**
* Constructs the exception * Constructs the exception.
* @link http://php.net/manual/en/errorexception.construct.php * @link http://php.net/manual/en/errorexception.construct.php
* @param $message [optional] * @param $message [optional]
* @param $code [optional] * @param $code [optional]
...@@ -51,7 +51,6 @@ class ErrorException extends Exception ...@@ -51,7 +51,6 @@ class ErrorException extends Exception
} }
// XDebug has a different key name // XDebug has a different key name
$frame['args'] = [];
if (isset($frame['params']) && !isset($frame['args'])) { if (isset($frame['params']) && !isset($frame['args'])) {
$frame['args'] = $frame['params']; $frame['args'] = $frame['params'];
} }
...@@ -64,17 +63,7 @@ class ErrorException extends Exception ...@@ -64,17 +63,7 @@ class ErrorException extends Exception
} }
/** /**
* Gets the exception severity * Returns if error is one of fatal type.
* @link http://php.net/manual/en/errorexception.getseverity.php
* @return int the severity level of the exception.
*/
final public function getSeverity()
{
return $this->severity;
}
/**
* Returns if error is one of fatal type
* *
* @param array $error error got from error_get_last() * @param array $error error got from error_get_last()
* @return bool if error is one of fatal type * @return bool if error is one of fatal type
...@@ -84,6 +73,16 @@ class ErrorException extends Exception ...@@ -84,6 +73,16 @@ class ErrorException extends Exception
return isset($error['type']) && in_array($error['type'], [E_ERROR, E_PARSE, E_CORE_ERROR, E_CORE_WARNING, E_COMPILE_ERROR, E_COMPILE_WARNING]); return isset($error['type']) && in_array($error['type'], [E_ERROR, E_PARSE, E_CORE_ERROR, E_CORE_WARNING, E_COMPILE_ERROR, E_COMPILE_WARNING]);
} }
/**
* Gets the exception severity.
* @link http://php.net/manual/en/errorexception.getseverity.php
* @return int the severity level of the exception.
*/
final public function getSeverity()
{
return $this->severity;
}
/** /**
* @return string the user-friendly name of this exception * @return string the user-friendly name of this exception
*/ */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment