From d8821f2b0b40a1f1ef03b7187d00d1453b820dc6 Mon Sep 17 00:00:00 2001 From: umherirrender Date: Wed, 17 Jun 2015 22:01:00 +0200 Subject: [PATCH] Fixed spacing - Removed space after casts - Removed spaces in array index - Added spaces around string concat - Added space after words: switch, foreach - else if -> elseif - Removed parentheses around require_once, because it is not a function - Added newline at end of file - Removed double spaces - Added spaces around operations - Removed repeated newlines Bug: T102609 Change-Id: Ib860222b24f8ad8e9062cd4dc42ec88dc63fb49e --- includes/Import.php | 6 ++-- includes/Setup.php | 2 +- includes/api/ApiFormatXml.php | 2 +- includes/api/ApiParamInfo.php | 2 +- includes/cache/LCStoreStaticArray.php | 4 +-- includes/objectcache/SqlBagOStuff.php | 2 -- includes/registration/ExtensionRegistry.php | 2 +- includes/resourceloader/ResourceLoader.php | 6 ++-- .../resourceloader/ResourceLoaderImage.php | 12 +++---- .../ResourceLoaderImageModule.php | 36 +++++++++---------- .../resourceloader/ResourceLoaderModule.php | 8 ++--- .../ResourceLoaderOOUIImageModule.php | 2 +- .../ResourceLoaderSkinModule.php | 4 +-- .../ResourceLoaderStartUpModule.php | 2 +- includes/skins/Skin.php | 2 +- includes/skins/SkinFallbackTemplate.php | 2 +- includes/upload/UploadFromUrl.php | 2 +- languages/messages/MessagesGom.php | 2 +- languages/messages/MessagesGom_deva.php | 2 +- languages/messages/MessagesPnt.php | 2 -- maintenance/exportSites.php | 4 +-- maintenance/importSites.php | 2 +- resources/ResourcesOOUI.php | 2 +- tests/phpunit/ResourceLoaderTestCase.php | 2 +- tests/phpunit/includes/api/ApiMainTest.php | 2 +- tests/phpunit/includes/api/ApiResultTest.php | 6 ++-- .../includes/api/query/ApiQueryTest.php | 2 +- .../objectcache/WANObjectCacheTest.php | 2 +- .../includes/site/HashSiteStoreTest.php | 2 +- .../includes/site/SiteExporterTest.php | 4 +-- tests/phpunit/includes/utils/IPTest.php | 22 ++++++------ .../phpunit/structure/AvailableRightsTest.php | 4 +-- 32 files changed, 76 insertions(+), 80 deletions(-) diff --git a/includes/Import.php b/includes/Import.php index 214bc4e793..6a0bfd093b 100644 --- a/includes/Import.php +++ b/includes/Import.php @@ -394,9 +394,9 @@ class WikiImporter { $countKey = 'title_' . $title->getPrefixedText(); $countable = $page->isCountable( $editInfo ); if ( array_key_exists( $countKey, $this->countableCache ) && - $countable != $this->countableCache[ $countKey ] ) { + $countable != $this->countableCache[$countKey] ) { DeferredUpdates::addUpdate( SiteStatsUpdate::factory( array( - 'articles' => ( (int)$countable - (int)$this->countableCache[ $countKey ] ) + 'articles' => ( (int)$countable - (int)$this->countableCache[$countKey] ) ) ) ); } } @@ -611,7 +611,7 @@ class WikiImporter { $tag = $this->reader->localName; if ( $tag == 'namespace' ) { - $this->foreignNamespaces[ $this->nodeAttribute( 'key' ) ] = + $this->foreignNamespaces[$this->nodeAttribute( 'key' )] = $this->nodeContents(); } elseif ( in_array( $tag, $normalFields ) ) { $siteInfo[$tag] = $this->nodeContents(); diff --git a/includes/Setup.php b/includes/Setup.php index 2fa9de1d29..a97cfa6ad9 100644 --- a/includes/Setup.php +++ b/includes/Setup.php @@ -363,7 +363,7 @@ if ( $wgMetaNamespace === false ) { // Default value is 2000 or the suhosin limit if it is between 1 and 2000 if ( $wgResourceLoaderMaxQueryLength === false ) { - $suhosinMaxValueLength = (int) ini_get( 'suhosin.get.max_value_length' ); + $suhosinMaxValueLength = (int)ini_get( 'suhosin.get.max_value_length' ); if ( $suhosinMaxValueLength > 0 && $suhosinMaxValueLength < 2000 ) { $wgResourceLoaderMaxQueryLength = $suhosinMaxValueLength; } else { diff --git a/includes/api/ApiFormatXml.php b/includes/api/ApiFormatXml.php index fa0bac3406..4c7d720fb4 100644 --- a/includes/api/ApiFormatXml.php +++ b/includes/api/ApiFormatXml.php @@ -72,7 +72,7 @@ class ApiFormatXml extends ApiFormatBase { 'Custom' => function ( &$data, &$metadata ) { if ( isset( $metadata[ApiResult::META_TYPE] ) ) { // We want to use non-BC for BCassoc to force outputting of _idx. - switch( $metadata[ApiResult::META_TYPE] ) { + switch ( $metadata[ApiResult::META_TYPE] ) { case 'BCassoc': $metadata[ApiResult::META_TYPE] = 'assoc'; break; diff --git a/includes/api/ApiParamInfo.php b/includes/api/ApiParamInfo.php index 8a4ef49d8f..2ab37ad140 100644 --- a/includes/api/ApiParamInfo.php +++ b/includes/api/ApiParamInfo.php @@ -337,7 +337,7 @@ class ApiParamInfo extends ApiBase { ? '' : ( $module->getModulePath() . '+' ); $item['submodules'] = array(); foreach ( $item['type'] as $v ) { - $item['submodules'][$v] = $prefix.$v; + $item['submodules'][$v] = $prefix . $v; } } if ( isset( $settings[ApiBase::PARAM_SUBMODULE_PARAM_PREFIX] ) ) { diff --git a/includes/cache/LCStoreStaticArray.php b/includes/cache/LCStoreStaticArray.php index 862ed67fa4..6a597ca59e 100644 --- a/includes/cache/LCStoreStaticArray.php +++ b/includes/cache/LCStoreStaticArray.php @@ -48,7 +48,7 @@ class LCStoreStaticArray implements LCStore { public function startWrite( $code ) { $this->currentLang = $code; - $this->fname = $this->directory. '/' . $code . '.l10n.php'; + $this->fname = $this->directory . '/' . $code . '.l10n.php'; $this->data[$code] = array(); if ( file_exists( $this->fname ) ) { $this->data[$code] = require $this->fname; @@ -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; } diff --git a/includes/objectcache/SqlBagOStuff.php b/includes/objectcache/SqlBagOStuff.php index 2017a74202..b8c1e75068 100644 --- a/includes/objectcache/SqlBagOStuff.php +++ b/includes/objectcache/SqlBagOStuff.php @@ -358,8 +358,6 @@ class SqlBagOStuff extends BagOStuff { return $result; } - - /** * @param string $key * @param mixed $value diff --git a/includes/registration/ExtensionRegistry.php b/includes/registration/ExtensionRegistry.php index d767870a70..d48a1bd26e 100644 --- a/includes/registration/ExtensionRegistry.php +++ b/includes/registration/ExtensionRegistry.php @@ -137,7 +137,7 @@ class ExtensionRegistry { if ( !is_array( $info ) ) { throw new Exception( "$path is not a valid JSON file." ); } - if ( !isset( $info['manifest_version' ] ) ) { + if ( !isset( $info['manifest_version'] ) ) { // For backwards-compatability, assume a version of 1 $info['manifest_version'] = 1; } diff --git a/includes/resourceloader/ResourceLoader.php b/includes/resourceloader/ResourceLoader.php index bbe55ab673..92b0156fb1 100644 --- a/includes/resourceloader/ResourceLoader.php +++ b/includes/resourceloader/ResourceLoader.php @@ -1104,9 +1104,9 @@ MESSAGE; $module = array( $name, $scripts, - (object) $styles, - (object) $messages, - (object) $templates, + (object)$styles, + (object)$messages, + (object)$templates, ); self::trimArray( $module ); diff --git a/includes/resourceloader/ResourceLoaderImage.php b/includes/resourceloader/ResourceLoaderImage.php index bf68fdda94..6382200d38 100644 --- a/includes/resourceloader/ResourceLoaderImage.php +++ b/includes/resourceloader/ResourceLoaderImage.php @@ -60,9 +60,9 @@ class ResourceLoaderImage { if ( strpos( $langList, ',' ) !== false ) { $this->descriptor['lang'] += array_fill_keys( explode( ',', $langList ), - $this->descriptor['lang'][ $langList ] + $this->descriptor['lang'][$langList] ); - unset( $this->descriptor['lang'][ $langList ] ); + unset( $this->descriptor['lang'][$langList] ); } } } @@ -121,10 +121,10 @@ class ResourceLoaderImage { $desc = $this->descriptor; if ( is_string( $desc ) ) { return $this->basePath . '/' . $desc; - } elseif ( isset( $desc['lang'][ $context->getLanguage() ] ) ) { - return $this->basePath . '/' . $desc['lang'][ $context->getLanguage() ]; - } elseif ( isset( $desc[ $context->getDirection() ] ) ) { - return $this->basePath . '/' . $desc[ $context->getDirection() ]; + } elseif ( isset( $desc['lang'][$context->getLanguage()] ) ) { + return $this->basePath . '/' . $desc['lang'][$context->getLanguage()]; + } elseif ( isset( $desc[$context->getDirection()] ) ) { + return $this->basePath . '/' . $desc[$context->getDirection()]; } else { return $this->basePath . '/' . $desc['default']; } diff --git a/includes/resourceloader/ResourceLoaderImageModule.php b/includes/resourceloader/ResourceLoaderImageModule.php index ccdb88f52d..0c1db1afd4 100644 --- a/includes/resourceloader/ResourceLoaderImageModule.php +++ b/includes/resourceloader/ResourceLoaderImageModule.php @@ -231,23 +231,23 @@ class ResourceLoaderImageModule extends ResourceLoaderModule { $this->loadFromDefinition(); $this->imageObjects = array(); } - if ( !isset( $this->imageObjects[ $skin ] ) ) { - $this->imageObjects[ $skin ] = array(); - if ( !isset( $this->images[ $skin ] ) ) { - $this->images[ $skin ] = isset( $this->images[ 'default' ] ) ? - $this->images[ 'default' ] : + if ( !isset( $this->imageObjects[$skin] ) ) { + $this->imageObjects[$skin] = array(); + if ( !isset( $this->images[$skin] ) ) { + $this->images[$skin] = isset( $this->images['default'] ) ? + $this->images['default'] : array(); } - foreach ( $this->images[ $skin ] as $name => $options ) { + foreach ( $this->images[$skin] as $name => $options ) { $fileDescriptor = is_string( $options ) ? $options : $options['file']; $allowedVariants = array_merge( is_array( $options ) && isset( $options['variants'] ) ? $options['variants'] : array(), $this->getGlobalVariants( $context ) ); - if ( isset( $this->variants[ $skin ] ) ) { + if ( isset( $this->variants[$skin] ) ) { $variantConfig = array_intersect_key( - $this->variants[ $skin ], + $this->variants[$skin], array_fill_keys( $allowedVariants, true ) ); } else { @@ -261,11 +261,11 @@ class ResourceLoaderImageModule extends ResourceLoaderModule { $this->localBasePath, $variantConfig ); - $this->imageObjects[ $skin ][ $image->getName() ] = $image; + $this->imageObjects[$skin][$image->getName()] = $image; } } - return $this->imageObjects[ $skin ]; + return $this->imageObjects[$skin]; } /** @@ -280,21 +280,21 @@ class ResourceLoaderImageModule extends ResourceLoaderModule { $this->loadFromDefinition(); $this->globalVariants = array(); } - if ( !isset( $this->globalVariants[ $skin ] ) ) { - $this->globalVariants[ $skin ] = array(); - if ( !isset( $this->variants[ $skin ] ) ) { - $this->variants[ $skin ] = isset( $this->variants[ 'default' ] ) ? - $this->variants[ 'default' ] : + if ( !isset( $this->globalVariants[$skin] ) ) { + $this->globalVariants[$skin] = array(); + if ( !isset( $this->variants[$skin] ) ) { + $this->variants[$skin] = isset( $this->variants['default'] ) ? + $this->variants['default'] : array(); } - foreach ( $this->variants[ $skin ] as $name => $config ) { + foreach ( $this->variants[$skin] as $name => $config ) { if ( isset( $config['global'] ) && $config['global'] ) { - $this->globalVariants[ $skin ][] = $name; + $this->globalVariants[$skin][] = $name; } } } - return $this->globalVariants[ $skin ]; + return $this->globalVariants[$skin]; } /** diff --git a/includes/resourceloader/ResourceLoaderModule.php b/includes/resourceloader/ResourceLoaderModule.php index ec7ed7059d..63da59245b 100644 --- a/includes/resourceloader/ResourceLoaderModule.php +++ b/includes/resourceloader/ResourceLoaderModule.php @@ -458,9 +458,9 @@ abstract class ResourceLoaderModule { // Cache this expensive operation. This calls builds the scripts, styles, and messages // content which typically involves filesystem and/or database access. if ( !array_key_exists( $contextHash, $this->contents ) ) { - $this->contents[ $contextHash ] = $this->buildContent( $context ); + $this->contents[$contextHash] = $this->buildContent( $context ); } - return $this->contents[ $contextHash ]; + return $this->contents[$contextHash]; } /** @@ -608,9 +608,9 @@ abstract class ResourceLoaderModule { $str .= strval( $mhash ); } - $this->versionHash[ $contextHash ] = ResourceLoader::makeHash( $str ); + $this->versionHash[$contextHash] = ResourceLoader::makeHash( $str ); } - return $this->versionHash[ $contextHash ]; + return $this->versionHash[$contextHash]; } /** diff --git a/includes/resourceloader/ResourceLoaderOOUIImageModule.php b/includes/resourceloader/ResourceLoaderOOUIImageModule.php index ebbeb0153e..c825ab240a 100644 --- a/includes/resourceloader/ResourceLoaderOOUIImageModule.php +++ b/includes/resourceloader/ResourceLoaderOOUIImageModule.php @@ -50,7 +50,7 @@ class ResourceLoaderOOUIImageModule extends ResourceLoaderImageModule { array_walk( $data['images'], function ( &$value ) use ( $fixPath ) { if ( is_string( $value['file'] ) ) { $fixPath( $value['file'] ); - } else if ( is_array( $value['file'] ) ) { + } elseif ( is_array( $value['file'] ) ) { array_walk_recursive( $value['file'], $fixPath ); } } ); diff --git a/includes/resourceloader/ResourceLoaderSkinModule.php b/includes/resourceloader/ResourceLoaderSkinModule.php index 980b7fed1e..911d953415 100644 --- a/includes/resourceloader/ResourceLoaderSkinModule.php +++ b/includes/resourceloader/ResourceLoaderSkinModule.php @@ -44,13 +44,13 @@ class ResourceLoaderSkinModule extends ResourceLoaderFileModule { '(min-resolution: 1.5dppx), ' . '(min-resolution: 144dpi)' ][] = '.mw-wiki-logo { background-image: ' . - CSSMin::buildUrlValue( $logoHD['1.5x'] ) .';' . + CSSMin::buildUrlValue( $logoHD['1.5x'] ) . ';' . 'background-size: 135px auto; }'; } if ( isset( $logoHD['2x'] ) ) { $styles[ '(-webkit-min-device-pixel-ratio: 2), ' . - '(min--moz-device-pixel-ratio: 2),'. + '(min--moz-device-pixel-ratio: 2),' . '(min-resolution: 2dppx), ' . '(min-resolution: 192dpi)' ][] = '.mw-wiki-logo { background-image: ' . diff --git a/includes/resourceloader/ResourceLoaderStartUpModule.php b/includes/resourceloader/ResourceLoaderStartUpModule.php index 8dbed8e889..a578ece687 100644 --- a/includes/resourceloader/ResourceLoaderStartUpModule.php +++ b/includes/resourceloader/ResourceLoaderStartUpModule.php @@ -404,7 +404,7 @@ class ResourceLoaderStartUpModule extends ResourceLoaderModule { // Pre-populate versionHash with something because the loop over all modules below includes // the startup module (this module). // See ResourceLoaderModule::getVersionHash() for usage of this cache. - $this->versionHash[ $context->getHash() ] = null; + $this->versionHash[$context->getHash()] = null; return $rl->getCombinedVersion( $context, $rl->getModuleNames() ); } diff --git a/includes/skins/Skin.php b/includes/skins/Skin.php index 6c5fbcd338..327ef7c9fe 100644 --- a/includes/skins/Skin.php +++ b/includes/skins/Skin.php @@ -650,7 +650,7 @@ abstract class Skin extends ContextSource { } return $this->msg( 'retrievedfrom' ) - ->rawParams( '' . $url . '' ) + ->rawParams( '' . $url . '' ) ->parse(); } diff --git a/includes/skins/SkinFallbackTemplate.php b/includes/skins/SkinFallbackTemplate.php index 312769f931..cd5e43c67b 100644 --- a/includes/skins/SkinFallbackTemplate.php +++ b/includes/skins/SkinFallbackTemplate.php @@ -87,7 +87,7 @@ class SkinFallbackTemplate extends BaseTemplate { if ( file_exists( "$IP/skins/$skin/skin.json" ) ) { return "wfLoadSkin( '$skin' );"; } else { - return "require_once \"\$IP/skins/$skin/$skin.php\";"; + return "require_once \"\$IP/skins/$skin/$skin.php\";"; } } diff --git a/includes/upload/UploadFromUrl.php b/includes/upload/UploadFromUrl.php index fc59ace541..4c099b3d42 100644 --- a/includes/upload/UploadFromUrl.php +++ b/includes/upload/UploadFromUrl.php @@ -241,7 +241,7 @@ class UploadFromUrl extends UploadBase { wfDebugLog( 'fileupload', 'Short write ' . $this->nbytes . '/' . strlen( $buffer ) . - ' bytes, aborting with ' . $this->mFileSize . ' uploaded so far' + ' bytes, aborting with ' . $this->mFileSize . ' uploaded so far' ); fclose( $this->mTmpHandle ); $this->mTmpHandle = false; diff --git a/languages/messages/MessagesGom.php b/languages/messages/MessagesGom.php index d684ed59ef..4adf154216 100644 --- a/languages/messages/MessagesGom.php +++ b/languages/messages/MessagesGom.php @@ -8,4 +8,4 @@ * */ -$fallback = 'gom-deva'; \ No newline at end of file +$fallback = 'gom-deva'; diff --git a/languages/messages/MessagesGom_deva.php b/languages/messages/MessagesGom_deva.php index 58fc505f68..b5cc34351f 100644 --- a/languages/messages/MessagesGom_deva.php +++ b/languages/messages/MessagesGom_deva.php @@ -28,4 +28,4 @@ $namespaceNames = array( NS_HELP_TALK => 'मजत_चर्चा', NS_CATEGORY => 'श्रेणी', NS_CATEGORY_TALK => 'श्रेणी_चर्चा', -); \ No newline at end of file +); diff --git a/languages/messages/MessagesPnt.php b/languages/messages/MessagesPnt.php index 0ca2a49332..b0a4ca76ed 100644 --- a/languages/messages/MessagesPnt.php +++ b/languages/messages/MessagesPnt.php @@ -48,8 +48,6 @@ $datePreferences = array( $defaultDateFormat = 'pnt'; - - $dateFormats = array( 'pnt time' => 'H:i', 'pnt date' => 'j xg Y', diff --git a/maintenance/exportSites.php b/maintenance/exportSites.php index 1c71dc0ed0..0c61633efc 100644 --- a/maintenance/exportSites.php +++ b/maintenance/exportSites.php @@ -34,7 +34,7 @@ class ExportSites extends Maintenance { $handle = fopen( $file, 'w' ); - if ( !$handle ) { + if ( !$handle ) { $this->error( "Failed to open $file for writing.\n", 1 ); } @@ -51,4 +51,4 @@ class ExportSites extends Maintenance { } $maintClass = 'ExportSites'; -require_once( RUN_MAINTENANCE_IF_MAIN ); +require_once RUN_MAINTENANCE_IF_MAIN; diff --git a/maintenance/importSites.php b/maintenance/importSites.php index 7abb8d72b8..4537943819 100644 --- a/maintenance/importSites.php +++ b/maintenance/importSites.php @@ -49,4 +49,4 @@ class ImportSites extends Maintenance { } $maintClass = 'ImportSites'; -require_once( RUN_MAINTENANCE_IF_MAIN ); +require_once RUN_MAINTENANCE_IF_MAIN; diff --git a/resources/ResourcesOOUI.php b/resources/ResourcesOOUI.php index 37203fb586..88a703e429 100644 --- a/resources/ResourcesOOUI.php +++ b/resources/ResourcesOOUI.php @@ -115,7 +115,7 @@ return call_user_func( function () { $module['selectorWithVariant'] = '.oo-ui-image-{variant} .oo-ui-icon-{name}, .oo-ui-image-{variant}.oo-ui-icon-{name}, .mw-ui-icon-{name}-{variant}:before, .mw-ui-hovericon:hover .mw-ui-icon-{name}-{variant}-hover:before, .mw-ui-hovericon.mw-ui-icon-{name}-{variant}-hover:hover:before'; } - $modules[ "oojs-ui.styles.$name" ] = $module; + $modules["oojs-ui.styles.$name"] = $module; } return $modules; diff --git a/tests/phpunit/ResourceLoaderTestCase.php b/tests/phpunit/ResourceLoaderTestCase.php index 223019cc00..3165bb88ad 100644 --- a/tests/phpunit/ResourceLoaderTestCase.php +++ b/tests/phpunit/ResourceLoaderTestCase.php @@ -51,7 +51,7 @@ abstract class ResourceLoaderTestCase extends MediaWikiTestCase { $globals = array(); foreach ( self::getSettings() as $key => $value ) { - $globals[ 'wg' . $key ] = $value; + $globals['wg' . $key] = $value; } $this->setMwGlobals( $globals ); } diff --git a/tests/phpunit/includes/api/ApiMainTest.php b/tests/phpunit/includes/api/ApiMainTest.php index e8ef18049c..ee1a9546d4 100644 --- a/tests/phpunit/includes/api/ApiMainTest.php +++ b/tests/phpunit/includes/api/ApiMainTest.php @@ -71,7 +71,7 @@ class ApiMainTest extends ApiTestCase { new FauxRequest( array( 'action' => 'query', 'meta' => 'siteinfo' ) ) ); $modules = $api->getModuleManager()->getNamesWithClasses(); - foreach( $modules as $name => $class ) { + foreach ( $modules as $name => $class ) { $this->assertArrayHasKey( $class, $classes, diff --git a/tests/phpunit/includes/api/ApiResultTest.php b/tests/phpunit/includes/api/ApiResultTest.php index 1ed571c2ff..6f4300ec26 100644 --- a/tests/phpunit/includes/api/ApiResultTest.php +++ b/tests/phpunit/includes/api/ApiResultTest.php @@ -1565,7 +1565,7 @@ class ApiResultTest extends MediaWikiTestCase { try { $arr = array(); - ApiResult::setValue( $arr, 'foo', new ApiResultTestSerializableObject( + ApiResult::setValue( $arr, 'foo', new ApiResultTestSerializableObject( new ApiResultTestStringifiableObject() ) ); $this->fail( 'Expected exception not thrown' ); @@ -1579,7 +1579,7 @@ class ApiResultTest extends MediaWikiTestCase { try { $arr = array(); - ApiResult::setValue( $arr, 'foo', new ApiResultTestSerializableObject( NAN ) ); + ApiResult::setValue( $arr, 'foo', new ApiResultTestSerializableObject( NAN ) ); $this->fail( 'Expected exception not thrown' ); } catch ( UnexpectedValueException $ex ) { $this->assertSame( @@ -1590,7 +1590,7 @@ class ApiResultTest extends MediaWikiTestCase { } $arr = array(); - ApiResult::setValue( $arr, 'foo', new ApiResultTestSerializableObject( + ApiResult::setValue( $arr, 'foo', new ApiResultTestSerializableObject( array( 'one' => new ApiResultTestStringifiableObject( '1' ), 'two' => new ApiResultTestSerializableObject( 2 ), diff --git a/tests/phpunit/includes/api/query/ApiQueryTest.php b/tests/phpunit/includes/api/query/ApiQueryTest.php index 5f061b50e9..61b992bae3 100644 --- a/tests/phpunit/includes/api/query/ApiQueryTest.php +++ b/tests/phpunit/includes/api/query/ApiQueryTest.php @@ -131,7 +131,7 @@ class ApiQueryTest extends ApiTestCase { ); $queryApi = new ApiQuery( $api, 'query' ); $modules = $queryApi->getModuleManager()->getNamesWithClasses(); - foreach( $modules as $name => $class ) { + foreach ( $modules as $name => $class ) { $this->assertArrayHasKey( $class, $classes, diff --git a/tests/phpunit/includes/objectcache/WANObjectCacheTest.php b/tests/phpunit/includes/objectcache/WANObjectCacheTest.php index 10dee83cee..47a83b3fe2 100644 --- a/tests/phpunit/includes/objectcache/WANObjectCacheTest.php +++ b/tests/phpunit/includes/objectcache/WANObjectCacheTest.php @@ -66,7 +66,7 @@ class WANObjectCacheTest extends MediaWikiTestCase { public function testSetOver() { $key = wfRandomString(); - for ( $i=0; $i<3; ++$i ) { + for ( $i = 0; $i < 3; ++$i ) { $value = wfRandomString(); $this->cache->set( $key, $value, 3 ); diff --git a/tests/phpunit/includes/site/HashSiteStoreTest.php b/tests/phpunit/includes/site/HashSiteStoreTest.php index 49a9633862..bebc093696 100644 --- a/tests/phpunit/includes/site/HashSiteStoreTest.php +++ b/tests/phpunit/includes/site/HashSiteStoreTest.php @@ -32,7 +32,7 @@ class HashSiteStoreTest extends MediaWikiTestCase { public function testGetSites() { $expectedSites = array(); - foreach( TestSites::getSites() as $testSite ) { + foreach ( TestSites::getSites() as $testSite ) { $siteId = $testSite->getGlobalId(); $expectedSites[$siteId] = $testSite; } diff --git a/tests/phpunit/includes/site/SiteExporterTest.php b/tests/phpunit/includes/site/SiteExporterTest.php index 19dd0aa12c..7be19ef9ac 100644 --- a/tests/phpunit/includes/site/SiteExporterTest.php +++ b/tests/phpunit/includes/site/SiteExporterTest.php @@ -53,7 +53,7 @@ class SiteExporterTest extends PHPUnit_Framework_TestCase { $exporter->exportSites( array( $foo, $acme ) ); fseek( $tmp, 0 ); - $xml = fread( $tmp, 16*1024 ); + $xml = fread( $tmp, 16 * 1024 ); $this->assertContains( 'assertContains( '', $xml ); @@ -133,7 +133,7 @@ class SiteExporterTest extends PHPUnit_Framework_TestCase { $exporter->exportSites( $sites ); fseek( $tmp, 0 ); - $xml = fread( $tmp, 16*1024 ); + $xml = fread( $tmp, 16 * 1024 ); $actualSites = new SiteList(); $store = $this->newSiteStore( $actualSites ); diff --git a/tests/phpunit/includes/utils/IPTest.php b/tests/phpunit/includes/utils/IPTest.php index 65464c48b2..04b8f48604 100644 --- a/tests/phpunit/includes/utils/IPTest.php +++ b/tests/phpunit/includes/utils/IPTest.php @@ -360,17 +360,17 @@ class IPTest extends PHPUnit_Framework_TestCase { public static function provideIsPublic() { return array( array( false, 'fc00::3' ), # RFC 4193 (local) - array( false, 'fc00::ff'), # RFC 4193 (local) - array( false, '127.1.2.3'), # loopback - array( false, '::1'), # loopback - array( false, 'fe80::1'), # link-local - array( false, '169.254.1.1'), # link-local - array( false, '10.0.0.1'), # RFC 1918 (private) - array( false, '172.16.0.1'), # RFC 1918 (private) - array( false, '192.168.0.1'), # RFC 1918 (private) - array( true, '2001:5c0:1000:a::133'), # public - array( true, 'fc::3'), # public - array( true, '00FC::') # public + array( false, 'fc00::ff' ), # RFC 4193 (local) + array( false, '127.1.2.3' ), # loopback + array( false, '::1' ), # loopback + array( false, 'fe80::1' ), # link-local + array( false, '169.254.1.1' ), # link-local + array( false, '10.0.0.1' ), # RFC 1918 (private) + array( false, '172.16.0.1' ), # RFC 1918 (private) + array( false, '192.168.0.1' ), # RFC 1918 (private) + array( true, '2001:5c0:1000:a::133' ), # public + array( true, 'fc::3' ), # public + array( true, '00FC::' ) # public ); } diff --git a/tests/phpunit/structure/AvailableRightsTest.php b/tests/phpunit/structure/AvailableRightsTest.php index 51d31aaa0a..ccf5393b23 100644 --- a/tests/phpunit/structure/AvailableRightsTest.php +++ b/tests/phpunit/structure/AvailableRightsTest.php @@ -19,11 +19,11 @@ class AvailableRightsTest extends PHPUnit_Framework_TestCase { $rights = User::getAllRights(); - foreach( $wgGroupPermissions as $permissions ) { + foreach ( $wgGroupPermissions as $permissions ) { $rights = array_merge( $rights, array_keys( $permissions ) ); } - foreach( $wgRevokePermissions as $permissions ) { + foreach ( $wgRevokePermissions as $permissions ) { $rights = array_merge( $rights, array_keys( $permissions ) ); } -- 2.20.1