build: Updating mediawiki/mediawiki-codesniffer to 0.7.1

Also added "composer fix" command.

Change-Id: I6f3f29f03abb607fbca9cec6f140875f2a3468a0
This commit is contained in:
Kunal Mehta
2016-05-09 18:30:34 -07:00
parent 6089ea868d
commit 6b8c33e763
11 changed files with 98 additions and 96 deletions

View File

@@ -17,8 +17,8 @@ class FontRepoCompiler {
public function getRepository() {
$files = $this->getFilesFromPath( $this->fsPath );
$fonts = array();
$languages = array();
$fonts = [];
$languages = [];
foreach ( $files as $file ) {
$conf = $this->parseFile( $file );
@@ -36,14 +36,13 @@ class FontRepoCompiler {
ksort( $languages );
ksort( $fonts );
return array(
return [
'base' => $this->webPath,
'languages' => $languages,
'fonts' => $fonts
);
];
}
public function getFilesFromPath( $fspath ) {
return glob( "$fspath/*/font.ini" );
}
@@ -54,7 +53,7 @@ class FontRepoCompiler {
public function getLanguages( array $font ) {
if ( !isset( $font['languages'] ) ) {
return array();
return [];
}
$languages = explode( ',', $font['languages'] );
@@ -68,7 +67,7 @@ class FontRepoCompiler {
$code = str_replace( '*', '', $rcode );
if ( !isset( $languages[$code] ) ) {
$languages[$code] = array( 'system' );
$languages[$code] = [ 'system' ];
}
if ( strpos( $rcode, '*' ) !== false ) {
@@ -83,7 +82,7 @@ class FontRepoCompiler {
}
public function getFontInfo( $font, $fontpath, &$version ) {
$info = array();
$info = [];
$fontdir = basename( $fontpath );
$version = $info['version'] = isset( $font['version'] ) ? $font['version'] : $version;

View File

@@ -20,7 +20,7 @@ class ResourceLoaderULSJsonMessageModule extends ResourceLoaderModule {
* @return string[] Module names.
*/
public function getDependencies( ResourceLoaderContext $context = null ) {
return array( 'ext.uls.i18n' );
return [ 'ext.uls.i18n' ];
}
/**
@@ -57,7 +57,7 @@ class ResourceLoaderULSJsonMessageModule extends ResourceLoaderModule {
$code = 'en';
}
$params = array( $code, ULSJsonMessageLoader::getMessages( $code ) );
$params = [ $code, ULSJsonMessageLoader::getMessages( $code ) ];
return Xml::encodeJsCall( 'mw.uls.loadLocalization', $params );
}

View File

@@ -23,7 +23,7 @@
* Resource loader module for providing MediaWiki language names.
*/
class ResourceLoaderULSModule extends ResourceLoaderModule {
protected $targets = array( 'desktop', 'mobile' );
protected $targets = [ 'desktop', 'mobile' ];
/**
* Get all the dynamic data for the content language to an array.
@@ -32,7 +32,7 @@ class ResourceLoaderULSModule extends ResourceLoaderModule {
* @return array
*/
protected function getData( $languageCode ) {
$vars = array();
$vars = [];
$vars['wgULSLanguages'] = Language::fetchLanguageNames(
$languageCode,
'mwfile'
@@ -49,7 +49,7 @@ class ResourceLoaderULSModule extends ResourceLoaderModule {
$languageCode = $context->getLanguage();
$out = '';
foreach ( $this->getData( $languageCode ) as $key => $value ) {
$out .= Xml::encodeJsCall( 'mw.config.set', array( $key, $value ) );
$out .= Xml::encodeJsCall( 'mw.config.set', [ $key, $value ] );
}
return $out;
@@ -85,10 +85,10 @@ class ResourceLoaderULSModule extends ResourceLoaderModule {
return $result['timestamp'];
}
$timestamp = wfTimestamp();
$cache->set( $key, array(
$cache->set( $key, [
'hash' => $hash,
'timestamp' => $timestamp,
) );
] );
return $timestamp;
}

View File

@@ -27,7 +27,7 @@ class ULSJsonMessageLoader {
* @return string[]
*/
public static function getFilenames( $language ) {
$filenames = array();
$filenames = [];
$languages = Language::getFallbacksFor( $language );
// Prepend the requested language code
@@ -57,7 +57,7 @@ class ULSJsonMessageLoader {
* @return array
*/
public static function getMessages( $language ) {
$contents = array();
$contents = [];
foreach ( self::getFilenames( $language ) as $filename ) {
$contents += self::loadI18nFile( $filename );