X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fdebug%2Flogger%2FMonologSpi.php;h=f44ff1ceef17922e2ae8750d6eb3207e39b4965a;hb=6c9a2923fe1ee3a65cb027be5e781772f2b12fbd;hp=4b9c3f52179794a8e3bb078b010941fca89d05c2;hpb=c732764ef4764c384eb9e2502ce249fb4a177bee;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/debug/logger/MonologSpi.php b/includes/debug/logger/MonologSpi.php index 4b9c3f5217..197b269b0a 100644 --- a/includes/debug/logger/MonologSpi.php +++ b/includes/debug/logger/MonologSpi.php @@ -39,79 +39,78 @@ use ObjectFactory; * global configuration variable used by LoggerFactory to construct its * default SPI provider: * @code - * $wgMWLoggerDefaultSpi = array( + * $wgMWLoggerDefaultSpi = [ * 'class' => '\\MediaWiki\\Logger\\MonologSpi', - * 'args' => array( array( - * 'loggers' => array( - * '@default' => array( - * 'processors' => array( 'wiki', 'psr', 'pid', 'uid', 'web' ), - * 'handlers' => array( 'stream' ), - * ), - * 'runJobs' => array( - * 'processors' => array( 'wiki', 'psr', 'pid' ), - * 'handlers' => array( 'stream' ), - * ) - * ), - * 'processors' => array( - * 'wiki' => array( + * 'args' => [ [ + * 'loggers' => [ + * '@default' => [ + * 'processors' => [ 'wiki', 'psr', 'pid', 'uid', 'web' ], + * 'handlers' => [ 'stream' ], + * ], + * 'runJobs' => [ + * 'processors' => [ 'wiki', 'psr', 'pid' ], + * 'handlers' => [ 'stream' ], + * ] + * ], + * 'processors' => [ + * 'wiki' => [ * 'class' => '\\MediaWiki\\Logger\\Monolog\\WikiProcessor', - * ), - * 'psr' => array( + * ], + * 'psr' => [ * 'class' => '\\Monolog\\Processor\\PsrLogMessageProcessor', - * ), - * 'pid' => array( + * ], + * 'pid' => [ * 'class' => '\\Monolog\\Processor\\ProcessIdProcessor', - * ), - * 'uid' => array( + * ], + * 'uid' => [ * 'class' => '\\Monolog\\Processor\\UidProcessor', - * ), - * 'web' => array( + * ], + * 'web' => [ * 'class' => '\\Monolog\\Processor\\WebProcessor', - * ), - * ), - * 'handlers' => array( - * 'stream' => array( + * ], + * ], + * 'handlers' => [ + * 'stream' => [ * 'class' => '\\Monolog\\Handler\\StreamHandler', - * 'args' => array( 'path/to/your.log' ), + * 'args' => [ 'path/to/your.log' ], * 'formatter' => 'line', - * ), - * 'redis' => array( + * ], + * 'redis' => [ * 'class' => '\\Monolog\\Handler\\RedisHandler', - * 'args' => array( function() { + * 'args' => [ function() { * $redis = new Redis(); * $redis->connect( '127.0.0.1', 6379 ); * return $redis; * }, * 'logstash' - * ), + * ], * 'formatter' => 'logstash', * 'buffer' => true, - * ), - * 'udp2log' => array( + * ], + * 'udp2log' => [ * 'class' => '\\MediaWiki\\Logger\\Monolog\\LegacyHandler', - * 'args' => array( + * 'args' => [ * 'udp://127.0.0.1:8420/mediawiki - * ), + * ], * 'formatter' => 'line', - * ), - * ), - * 'formatters' => array( - * 'line' => array( + * ], + * ], + * 'formatters' => [ + * 'line' => [ * 'class' => '\\Monolog\\Formatter\\LineFormatter', - * ), - * 'logstash' => array( + * ], + * 'logstash' => [ * 'class' => '\\Monolog\\Formatter\\LogstashFormatter', - * 'args' => array( 'mediawiki', php_uname( 'n' ), null, '', 1 ), - * ), - * ), - * ) ), - * ); + * 'args' => [ 'mediawiki', php_uname( 'n' ), null, '', 1 ], + * ], + * ], + * ] ], + * ]; * @endcode * * @see https://github.com/Seldaek/monolog * @since 1.25 - * @author Bryan Davis - * @copyright © 2014 Bryan Davis and Wikimedia Foundation. + * @copyright © 2014 Wikimedia Foundation and contributors */ class MonologSpi implements Spi { @@ -130,7 +129,7 @@ class MonologSpi implements Spi { * @param array $config Configuration data. */ public function __construct( array $config ) { - $this->config = array(); + $this->config = []; $this->mergeConfig( $config ); } @@ -158,12 +157,12 @@ class MonologSpi implements Spi { * be no need to flush the caches. */ public function reset() { - $this->singletons = array( - 'loggers' => array(), - 'handlers' => array(), - 'formatters' => array(), - 'processors' => array(), - ); + $this->singletons = [ + 'loggers' => [], + 'handlers' => [], + 'formatters' => [], + 'processors' => [], + ]; } /** @@ -202,7 +201,7 @@ class MonologSpi implements Spi { if ( isset( $spec['calls'] ) ) { foreach ( $spec['calls'] as $method => $margs ) { - call_user_func_array( array( $obj, $method ), $margs ); + call_user_func_array( [ $obj, $method ], $margs ); } }