X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fdebug%2Flogger%2FLegacyLogger.php;h=526b4ab03b8888315608691f195143238e8cfd3e;hb=e5facc46bc170c302438f60849041b0d6be75e82;hp=34ea64135c9812486816c7ae202da8f68a6d4c76;hpb=3eacca5ab8e22cc25dd406dada9555c86cca6681;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/debug/logger/LegacyLogger.php b/includes/debug/logger/LegacyLogger.php index 34ea64135c..526b4ab03b 100644 --- a/includes/debug/logger/LegacyLogger.php +++ b/includes/debug/logger/LegacyLogger.php @@ -59,7 +59,7 @@ class LegacyLogger extends AbstractLogger { * * @var array $levelMapping */ - protected static $levelMapping = array( + protected static $levelMapping = [ LogLevel::DEBUG => 100, LogLevel::INFO => 200, LogLevel::NOTICE => 250, @@ -68,7 +68,7 @@ class LegacyLogger extends AbstractLogger { LogLevel::CRITICAL => 500, LogLevel::ALERT => 550, LogLevel::EMERGENCY => 600, - ); + ]; /** * @param string $channel @@ -84,7 +84,7 @@ class LegacyLogger extends AbstractLogger { * @param string $message * @param array $context */ - public function log( $level, $message, array $context = array() ) { + public function log( $level, $message, array $context = [] ) { if ( self::shouldEmit( $this->channel, $message, $level, $context ) ) { $text = self::format( $this->channel, $message, $context ); $destination = self::destination( $this->channel, $message, $context ); @@ -92,7 +92,7 @@ class LegacyLogger extends AbstractLogger { } if ( !isset( $context['private'] ) || !$context['private'] ) { // Add to debug toolbar if not marked as "private" - MWDebug::debugMsg( $message, array( 'channel' => $this->channel ) + $context ); + MWDebug::debugMsg( $message, [ 'channel' => $this->channel ] + $context ); } } @@ -282,13 +282,7 @@ class LegacyLogger extends AbstractLogger { $cachedTimezone = new DateTimeZone( $wgDBerrorLogTZ ); } - // Workaround for https://bugs.php.net/bug.php?id=52063 - // Can be removed when min PHP > 5.3.6 - if ( $cachedTimezone === null ) { - $d = date_create( 'now' ); - } else { - $d = date_create( 'now', $cachedTimezone ); - } + $d = date_create( 'now', $cachedTimezone ); $date = $d->format( 'D M j G:i:s T Y' ); $host = wfHostname(); @@ -322,7 +316,7 @@ class LegacyLogger extends AbstractLogger { */ public static function interpolate( $message, array $context ) { if ( strpos( $message, '{' ) !== false ) { - $replace = array(); + $replace = []; foreach ( $context as $key => $val ) { $replace['{' . $key . '}'] = self::flatten( $val ); }