* will be used to redact the trace information.
*
* @since 1.26
- * @author Bryan Davis <bd808@wikimedia.org>
- * @copyright © 2015 Bryan Davis and Wikimedia Foundation.
+ * @copyright © 2015 Wikimedia Foundation and contributors
*/
class LineFormatter extends MonologLineFormatter {
* @param Exception $e
* @return string
*/
- protected function normalizeException( Exception $e ) {
+ protected function normalizeException( $e ) {
return $this->normalizeExceptionArray( $this->exceptionAsArray( $e ) );
}
* @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 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']}] (" .