From 0bcc59f32cdc9d6ac7f61f62b554331ef6df23b9 Mon Sep 17 00:00:00 2001 From: Kunal Mehta Date: Tue, 12 Jul 2016 15:10:25 -0700 Subject: [PATCH] MWExceptionHandler: Fix PHP7 compatibility The `Exception` type-hint will cause issues if a PHP7 `Error` is thrown. Change-Id: Iab0af90235badd57304131ae2274a1cfa0be822a --- includes/exception/MWExceptionHandler.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/includes/exception/MWExceptionHandler.php b/includes/exception/MWExceptionHandler.php index e4ff5f3330..7d8b244ba4 100644 --- a/includes/exception/MWExceptionHandler.php +++ b/includes/exception/MWExceptionHandler.php @@ -488,7 +488,11 @@ TXT; return "[$id] $url $type from line $line of $file: $message"; } - public static function getPublicLogMessage( Exception $e ) { + /** + * @param Exception|Throwable $e + * @return string + */ + public static function getPublicLogMessage( $e ) { $reqId = WebRequest::getRequestId(); $type = get_class( $e ); return '[' . $reqId . '] ' -- 2.20.1