mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
Allow ParseError as exception and remove typehint.
This commit is contained in:
parent
ddfb7d649e
commit
7982b6b078
2 changed files with 4 additions and 4 deletions
|
@ -109,11 +109,11 @@ class ErrorHandler {
|
||||||
* This will either use custom exception renderer class if configured,
|
* This will either use custom exception renderer class if configured,
|
||||||
* or use the default ExceptionRenderer.
|
* or use the default ExceptionRenderer.
|
||||||
*
|
*
|
||||||
* @param Exception $exception The exception to render.
|
* @param Exception|ParseError $exception The exception to render.
|
||||||
* @return void
|
* @return void
|
||||||
* @see http://php.net/manual/en/function.set-exception-handler.php
|
* @see http://php.net/manual/en/function.set-exception-handler.php
|
||||||
*/
|
*/
|
||||||
public static function handleException(Exception $exception) {
|
public static function handleException($exception) {
|
||||||
$config = Configure::read('Exception');
|
$config = Configure::read('Exception');
|
||||||
static::_log($exception, $config);
|
static::_log($exception, $config);
|
||||||
|
|
||||||
|
|
|
@ -86,9 +86,9 @@ class ExceptionRenderer {
|
||||||
* If the error is a CakeException it will be converted to either a 400 or a 500
|
* If the error is a CakeException it will be converted to either a 400 or a 500
|
||||||
* code error depending on the code used to construct the error.
|
* code error depending on the code used to construct the error.
|
||||||
*
|
*
|
||||||
* @param Exception $exception Exception
|
* @param Exception|ParseError $exception Exception
|
||||||
*/
|
*/
|
||||||
public function __construct(Exception $exception) {
|
public function __construct($exception) {
|
||||||
$this->controller = $this->_getController($exception);
|
$this->controller = $this->_getController($exception);
|
||||||
|
|
||||||
if (method_exists($this->controller, 'appError')) {
|
if (method_exists($this->controller, 'appError')) {
|
||||||
|
|
Loading…
Reference in a new issue