X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fcache%2FLCStoreStaticArray.php;h=1e20082f1615516384b9d21ea9735f481b8bb08d;hb=a2f2cf8cf12fc927da8d7b7c4a11d132edc13499;hp=862ed67fa41cc22e72f14d890e959e1beba17a62;hpb=c4c1d277ee138892b7117800a4b88dfca25e3d24;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/cache/LCStoreStaticArray.php b/includes/cache/LCStoreStaticArray.php index 862ed67fa4..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'] ) ) { @@ -48,8 +48,8 @@ class LCStoreStaticArray implements LCStore { public function startWrite( $code ) { $this->currentLang = $code; - $this->fname = $this->directory. '/' . $code . '.l10n.php'; - $this->data[$code] = array(); + $this->fname = $this->directory . '/' . $code . '.l10n.php'; + $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 ) ); @@ -125,7 +125,7 @@ class LCStoreStaticArray implements LCStore { public function get( $code, $key ) { if ( !array_key_exists( $code, $this->data ) ) { - $fname = $this->directory. '/' . $code . '.l10n.php'; + $fname = $this->directory . '/' . $code . '.l10n.php'; if ( !file_exists( $fname ) ) { return null; }