diff -u b/core/includes/bootstrap.inc b/core/includes/bootstrap.inc --- b/core/includes/bootstrap.inc +++ b/core/includes/bootstrap.inc @@ -679,7 +679,7 @@ * always fatal: the execution of the script will stop as soon as the exception * handler exits. * - * @param \Exception|\Error $exception + * @param \ThrowableInterface $exception * The exception object that was thrown. */ function _drupal_exception_handler($exception) { @@ -690,11 +690,11 @@ _drupal_log_error(Error::decodeException($exception), TRUE); } // PHP 7 introduces Error throwables. - catch (Error $exception2) { - _drupal_exception_handler_additional($exception, $exception2); + catch (\Error $error) { + _drupal_exception_handler_additional($exception, $error); } // In order to be compatibile with PHP 5 we also catch regular Exceptions. - catch (Exception $exception2) { + catch (\Exception $exception2) { _drupal_exception_handler_additional($exception, $exception2); } } @@ -702,9 +702,9 @@ /** * Displays any additional errors caught while handling an exception. * - * @param \Exception|\Error $exception + * @param \ThrowableInterface $exception * The first exception object that was thrown. - * @param \Exception|\Error $exception + * @param \ThrowableInterface $error * The second exception object that was thrown. */ function _drupal_exception_handler_additional($exception, $exception2) { @@ -1099,11 +1099,11 @@ } } // PHP 7 introduces Error throwables. - catch (Error $exception) { - _drupal_shutdown_function_handle_exception($exception); + catch (\Error $error) { + _drupal_shutdown_function_handle_exception($error); } // In order to be compatibile with PHP 5 we also catch regular Exceptions. - catch (Exception $exception) { + catch (\Exception $exception) { _drupal_shutdown_function_handle_exception($exception); } } @@ -1111,7 +1111,7 @@ /** * Displays and logs any errors that may happen during shutdown. * - * @param \Exception|\Error $exception + * @param \ThrowableInterface $exception * The exception object that was thrown. * * @see _drupal_shutdown_function() diff -u b/core/lib/Drupal/Core/Utility/Error.php b/core/lib/Drupal/Core/Utility/Error.php --- b/core/lib/Drupal/Core/Utility/Error.php +++ b/core/lib/Drupal/Core/Utility/Error.php @@ -33,7 +33,7 @@ /** * Decodes an exception and retrieves the correct caller. * - * @param \Exception|\Error $exception + * @param \ThrowableInterface $exception * The exception object that was thrown. * * @return array @@ -82,7 +82,7 @@ /** * Renders an exception error message without further exceptions. * - * @param \Exception|\Error $exception + * @param \ThrowableInterface $exception * The exception object that was thrown. * * @return string