From f800abc858f168aafd57dff2041447a0b92694f1 Mon Sep 17 00:00:00 2001 From: umherirrender Date: Wed, 17 Feb 2016 22:08:07 +0100 Subject: [PATCH] Use short array for generator output The AutoloadGenerator and LocalSettingsGenerator should generate short array syntax Change-Id: I5772640556fd6274db0d522341a98c0acfe5794d --- autoload.php | 4 ++-- includes/installer/LocalSettingsGenerator.php | 6 +++--- includes/installer/SqliteInstaller.php | 8 ++++---- includes/utils/AutoloadGenerator.php | 4 ++-- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/autoload.php b/autoload.php index 83ca3b35ff..341cb90422 100644 --- a/autoload.php +++ b/autoload.php @@ -3,7 +3,7 @@ // @codingStandardsIgnoreFile global $wgAutoloadLocalClasses; -$wgAutoloadLocalClasses = array( +$wgAutoloadLocalClasses = [ 'APCBagOStuff' => __DIR__ . '/includes/libs/objectcache/APCBagOStuff.php', 'AbstractContent' => __DIR__ . '/includes/content/AbstractContent.php', 'Action' => __DIR__ . '/includes/actions/Action.php', @@ -1457,4 +1457,4 @@ $wgAutoloadLocalClasses = array( 'ZipDirectoryReader' => __DIR__ . '/includes/utils/ZipDirectoryReader.php', 'ZipDirectoryReaderError' => __DIR__ . '/includes/utils/ZipDirectoryReader.php', 'profile_point' => __DIR__ . '/profileinfo.php', -); +]; diff --git a/includes/installer/LocalSettingsGenerator.php b/includes/installer/LocalSettingsGenerator.php index 252c22d14d..ced7b93e85 100644 --- a/includes/installer/LocalSettingsGenerator.php +++ b/includes/installer/LocalSettingsGenerator.php @@ -214,9 +214,9 @@ class LocalSettingsGenerator { $servers = $this->values['_MemCachedServers']; if ( !$servers ) { - return 'array()'; + return '[]'; } else { - $ret = 'array( '; + $ret = '[ '; $servers = explode( ',', $servers ); foreach ( $servers as $srv ) { @@ -224,7 +224,7 @@ class LocalSettingsGenerator { $ret .= "'$srv', "; } - return rtrim( $ret, ', ' ) . ' )'; + return rtrim( $ret, ', ' ) . ' ]'; } } diff --git a/includes/installer/SqliteInstaller.php b/includes/installer/SqliteInstaller.php index cd4b1aa730..d59c16294d 100644 --- a/includes/installer/SqliteInstaller.php +++ b/includes/installer/SqliteInstaller.php @@ -319,15 +319,15 @@ EOT; return "# SQLite-specific settings \$wgSQLiteDataDir = \"{$dir}\"; -\$wgObjectCaches[CACHE_DB] = array( +\$wgObjectCaches[CACHE_DB] = [ 'class' => 'SqlBagOStuff', 'loggroup' => 'SQLBagOStuff', - 'server' => array( + 'server' => [ 'type' => 'sqlite', 'dbname' => 'wikicache', 'tablePrefix' => '', 'flags' => 0 - ) -);"; + ] +];"; } } diff --git a/includes/utils/AutoloadGenerator.php b/includes/utils/AutoloadGenerator.php index 5cd6055899..254e4e7d2b 100644 --- a/includes/utils/AutoloadGenerator.php +++ b/includes/utils/AutoloadGenerator.php @@ -206,9 +206,9 @@ class AutoloadGenerator { // @codingStandardsIgnoreFile global \${$this->variableName}; -\${$this->variableName} {$op} array( +\${$this->variableName} {$op} [ {$output} -); +]; EOD ); -- 2.20.1