X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fcache%2FLCStoreStaticArray.php;h=1e20082f1615516384b9d21ea9735f481b8bb08d;hb=a2f2cf8cf12fc927da8d7b7c4a11d132edc13499;hp=6a597ca59efc778f5fa5603e4cbe2c18b66ab9a7;hpb=fdfeaff8e5d15c10116385cd09df73dadf8c131b;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/cache/LCStoreStaticArray.php b/includes/cache/LCStoreStaticArray.php index 6a597ca59e..1e20082f16 100644 --- a/includes/cache/LCStoreStaticArray.php +++ b/includes/cache/LCStoreStaticArray.php @@ -28,7 +28,7 @@ class LCStoreStaticArray implements LCStore { private $currentLang = null; /** @var array Localisation data. */ - private $data = array(); + private $data = []; /** @var string File name. */ private $fname = null; @@ -36,7 +36,7 @@ class LCStoreStaticArray implements LCStore { /** @var string Directory for cache files. */ private $directory; - public function __construct( $conf = array() ) { + public function __construct( $conf = [] ) { global $wgCacheDirectory; if ( isset( $conf['directory'] ) ) { @@ -49,7 +49,7 @@ class LCStoreStaticArray implements LCStore { public function startWrite( $code ) { $this->currentLang = $code; $this->fname = $this->directory . '/' . $code . '.l10n.php'; - $this->data[$code] = array(); + $this->data[$code] = []; if ( file_exists( $this->fname ) ) { $this->data[$code] = require $this->fname; } @@ -69,17 +69,17 @@ class LCStoreStaticArray implements LCStore { public static function encode( $value ) { if ( is_scalar( $value ) || $value === null ) { // [V]alue - return array( 'v', $value ); + return [ 'v', $value ]; } if ( is_object( $value ) ) { // [S]erialized - return array( 's', serialize( $value ) ); + return [ 's', serialize( $value ) ]; } if ( is_array( $value ) ) { // [A]rray - return array( 'a', array_map( function ( $v ) { + return [ 'a', array_map( function ( $v ) { return LCStoreStaticArray::encode( $v ); - }, $data ) ); + }, $value ) ]; } throw new RuntimeException( 'Cannot encode ' . var_export( $value, true ) );