From: Kunal Mehta Date: Tue, 12 Jul 2016 22:10:25 +0000 (-0700) Subject: MWExceptionHandler: Fix PHP7 compatibility X-Git-Tag: 1.31.0-rc.0~6384 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/password.php?a=commitdiff_plain;h=0bcc59f32cdc9d6ac7f61f62b554331ef6df23b9;p=lhc%2Fweb%2Fwiklou.git MWExceptionHandler: Fix PHP7 compatibility The `Exception` type-hint will cause issues if a PHP7 `Error` is thrown. Change-Id: Iab0af90235badd57304131ae2274a1cfa0be822a --- 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 . '] '