$this->includeStacktraces( $includeStacktraces );
}
-
/**
* {@inheritdoc}
*/
return $output;
}
-
/**
* Convert an Exception to a string.
*
* @param Exception $e
* @return string
*/
- protected function normalizeException( Exception $e ) {
+ protected function normalizeException( $e ) {
return $this->normalizeExceptionArray( $this->exceptionAsArray( $e ) );
}
-
/**
* Convert an exception to an array of structured data.
*
* @return array
*/
protected function exceptionAsArray( Exception $e ) {
- $out = array(
+ $out = [
'class' => get_class( $e ),
'message' => $e->getMessage(),
'code' => $e->getCode(),
'file' => $e->getFile(),
'line' => $e->getLine(),
'trace' => MWExceptionHandler::redactTrace( $e->getTrace() ),
- );
+ ];
$prev = $e->getPrevious();
if ( $prev ) {
return $out;
}
-
/**
* Convert an array of Exception data to a string.
*
* @return string
*/
protected function normalizeExceptionArray( array $e ) {
- $defaults = array(
+ $defaults = [
'class' => 'Unknown',
'file' => 'unknown',
'line' => null,
'message' => 'unknown',
- 'trace' => array(),
- );
+ 'trace' => [],
+ ];
$e = array_merge( $defaults, $e );
$str = "\n[Exception {$e['class']}] (" .