From: umherirrender Date: Thu, 20 Mar 2014 18:59:20 +0000 (+0100) Subject: Fixed spacing X-Git-Tag: 1.31.0-rc.0~16555^2 X-Git-Url: https://git.cyclocoop.org/%27.WWW_URL.%27admin/?a=commitdiff_plain;h=2000672ac379e77adc1ad83747844401bfc7c51d;p=lhc%2Fweb%2Fwiklou.git Fixed spacing - Added spaces after if/foreach/catch - Added new line before end of file - Added or removed spaces before/after parenthesis, comma - Added spaces around string concat Change-Id: I0590070f1b3542108e242730e8d9a3ba9831e94f --- diff --git a/includes/MediaWikiVersionFetcher.php b/includes/MediaWikiVersionFetcher.php index 1d59ec3097..17cb8aa451 100644 --- a/includes/MediaWikiVersionFetcher.php +++ b/includes/MediaWikiVersionFetcher.php @@ -28,4 +28,4 @@ class MediaWikiVersionFetcher { return $matches[1]; } -} \ No newline at end of file +} diff --git a/includes/QueryPage.php b/includes/QueryPage.php index b808408e6e..69629e05f0 100644 --- a/includes/QueryPage.php +++ b/includes/QueryPage.php @@ -552,7 +552,7 @@ abstract class QueryPage extends SpecialPage { if ( $this->numRows > 0 ) { $out->addHTML( $this->msg( 'showingresultsinrange' )->numParams( min( $this->numRows, $this->limit ), # do not show the one extra row, if exist - $this->offset + 1, (min( $this->numRows, $this->limit ) + $this->offset) )->parseAsBlock() ); + $this->offset + 1, ( min( $this->numRows, $this->limit ) + $this->offset ) )->parseAsBlock() ); # Disable the "next" link when we reach the end $paging = $this->getLanguage()->viewPrevNext( $this->getPageTitle( $par ), $this->offset, $this->limit, $this->linkParameters(), ( $this->numRows <= $this->limit ) ); diff --git a/includes/Setup.php b/includes/Setup.php index 777ca3792e..1a7f21e8d4 100644 --- a/includes/Setup.php +++ b/includes/Setup.php @@ -36,7 +36,7 @@ if ( !defined( 'MEDIAWIKI' ) ) { $fname = 'Setup.php'; wfProfileIn( $fname ); -wfProfileIn( $fname . '-defaults' ); +wfProfileIn( $fname . '-defaults' ); // Check to see if we are at the file scope if ( !isset( $wgVersion ) ) { @@ -396,7 +396,7 @@ if ( $wgRC2UDPAddress ) { ); } -wfProfileOut( $fname . '-defaults' ); +wfProfileOut( $fname . '-defaults' ); // Disable MWDebug for command line mode, this prevents MWDebug from eating up // all the memory from logging SQL queries on maintenance scripts diff --git a/includes/TimestampException.php b/includes/TimestampException.php index 18f58fd7cb..4345a73a6c 100644 --- a/includes/TimestampException.php +++ b/includes/TimestampException.php @@ -3,4 +3,4 @@ /** * @since 1.20 */ -class TimestampException extends MWException {} \ No newline at end of file +class TimestampException extends MWException {} diff --git a/includes/TitleArrayFromResult.php b/includes/TitleArrayFromResult.php index f90053885a..b4a553f2b7 100644 --- a/includes/TitleArrayFromResult.php +++ b/includes/TitleArrayFromResult.php @@ -83,4 +83,4 @@ class TitleArrayFromResult extends TitleArray implements Countable { function valid() { return $this->current !== false; } -} \ No newline at end of file +} diff --git a/includes/User.php b/includes/User.php index dd8717f873..1ccb732637 100644 --- a/includes/User.php +++ b/includes/User.php @@ -1700,7 +1700,7 @@ class User { // Already pinged? if ( $count ) { if ( $count >= $max ) { - wfDebugLog( 'ratelimit', $this->getName() . " tripped! $key at $count $summary"); + wfDebugLog( 'ratelimit', $this->getName() . " tripped! $key at $count $summary" ); $triggered = true; } else { wfDebug( __METHOD__ . ": ok. $key at $count $summary\n" ); diff --git a/includes/UserArray.php b/includes/UserArray.php index 38f0d9d518..51fb154a7e 100644 --- a/includes/UserArray.php +++ b/includes/UserArray.php @@ -63,4 +63,4 @@ abstract class UserArray implements Iterator { protected static function newFromResult_internal( $res ) { return new UserArrayFromResult( $res ); } -} \ No newline at end of file +} diff --git a/includes/composer/ComposerVersionNormalizer.php b/includes/composer/ComposerVersionNormalizer.php index 727e1423f7..a0d31cf2a9 100644 --- a/includes/composer/ComposerVersionNormalizer.php +++ b/includes/composer/ComposerVersionNormalizer.php @@ -63,5 +63,4 @@ class ComposerVersionNormalizer { return $version; } - -} \ No newline at end of file +} diff --git a/includes/db/DatabaseMssql.php b/includes/db/DatabaseMssql.php index e304a3489e..50b7158332 100644 --- a/includes/db/DatabaseMssql.php +++ b/includes/db/DatabaseMssql.php @@ -471,7 +471,7 @@ class DatabaseMssql extends DatabaseBase { $this->mScrollableCursor = false; try { parent::deleteJoin( $delTable, $joinTable, $delVar, $joinVar, $conds, $fname ); - } catch( Exception $e ) { + } catch ( Exception $e ) { $this->mScrollableCursor = true; throw $e; } @@ -482,7 +482,7 @@ class DatabaseMssql extends DatabaseBase { $this->mScrollableCursor = false; try { parent::delete( $table, $conds, $fname ); - } catch( Exception $e ) { + } catch ( Exception $e ) { $this->mScrollableCursor = true; throw $e; } @@ -730,7 +730,7 @@ class DatabaseMssql extends DatabaseBase { $insertOptions, $selectOptions ); - } catch( Exception $e ) { + } catch ( Exception $e ) { $this->mScrollableCursor = true; throw $e; } @@ -911,7 +911,7 @@ class DatabaseMssql extends DatabaseBase { $first = $offset + 1; $last = $offset + $limit; $sub1 = 'sub_' . $this->mSubqueryId; - $sub2 = 'sub_' . ($this->mSubqueryId + 1); + $sub2 = 'sub_' . ( $this->mSubqueryId + 1 ); $this->mSubqueryId += 2; if ( !$s1 ) { // wat diff --git a/includes/db/DatabaseMysqli.php b/includes/db/DatabaseMysqli.php index b371ae0bbd..8c9b06c31a 100644 --- a/includes/db/DatabaseMysqli.php +++ b/includes/db/DatabaseMysqli.php @@ -67,7 +67,7 @@ class DatabaseMysqli extends DatabaseMysqlBase { $port = $hostAndPort[1]; } } - + $connFlags = 0; if ( $this->mFlags & DBO_SSL ) { $connFlags |= MYSQLI_CLIENT_SSL; diff --git a/includes/diff/DairikiDiff.php b/includes/diff/DairikiDiff.php index 61edc1ed00..0e38d689be 100644 --- a/includes/diff/DairikiDiff.php +++ b/includes/diff/DairikiDiff.php @@ -66,10 +66,10 @@ abstract class DiffOp { * @return string|null */ public function getClosing( $i = null ) { - if( $i === null ) { + if ( $i === null ) { return $this->closing; } - if( array_key_exists( $i, $this->closing ) ) { + if ( array_key_exists( $i, $this->closing ) ) { return $this->closing[$i]; } return null; @@ -424,7 +424,7 @@ class DiffEngine { } $x1 = $xoff + (int)( ( $numer + ( $xlim - $xoff ) * $chunk ) / $nchunks ); - for (; $x < $x1; $x++ ) { + for ( ; $x < $x1; $x++ ) { $line = $flip ? $this->yv[$x] : $this->xv[$x]; if ( empty( $ymatches[$line] ) ) { continue; diff --git a/includes/filebackend/SwiftFileBackend.php b/includes/filebackend/SwiftFileBackend.php index 7050226985..174f9f3622 100644 --- a/includes/filebackend/SwiftFileBackend.php +++ b/includes/filebackend/SwiftFileBackend.php @@ -1275,7 +1275,7 @@ class SwiftFileBackend extends FileBackendStore { return null; } - wfProfileIn( __METHOD__. "-{$this->name}-miss" ); + wfProfileIn( __METHOD__ . "-{$this->name}-miss" ); list( $rcode, $rdesc, $rhdrs, $rbody, $rerr ) = $this->http->run( array( 'method' => 'HEAD', 'url' => $this->storageUrl( $auth, $container ), diff --git a/includes/installer/MssqlInstaller.php b/includes/installer/MssqlInstaller.php index 952b9029b9..d6c84ebd37 100644 --- a/includes/installer/MssqlInstaller.php +++ b/includes/installer/MssqlInstaller.php @@ -273,12 +273,12 @@ class MssqlInstaller extends DatabaseInstaller { // http://technet.microsoft.com/en-us/library/ms178569.aspx // The following array sets up which permissions imply whatever permissions we specify $implied = array( - // schema database server - 'DELETE' => array( 'DELETE', 'CONTROL SERVER' ), + // schema database server + 'DELETE' => array( 'DELETE', 'CONTROL SERVER' ), 'EXECUTE' => array( 'EXECUTE', 'CONTROL SERVER' ), - 'INSERT' => array( 'INSERT', 'CONTROL SERVER' ), - 'SELECT' => array( 'SELECT', 'CONTROL SERVER' ), - 'UPDATE' => array( 'UPDATE', 'CONTROL SERVER' ), + 'INSERT' => array( 'INSERT', 'CONTROL SERVER' ), + 'SELECT' => array( 'SELECT', 'CONTROL SERVER' ), + 'UPDATE' => array( 'UPDATE', 'CONTROL SERVER' ), ); $grantOptions = array_flip( $this->webUserPrivs ); diff --git a/includes/objectcache/MemcachedClient.php b/includes/objectcache/MemcachedClient.php index 79c51872c4..d9ea54c013 100644 --- a/includes/objectcache/MemcachedClient.php +++ b/includes/objectcache/MemcachedClient.php @@ -729,7 +729,7 @@ class MWMemcached { * @access private */ function _connect_sock( &$sock, $host ) { - list( $ip, $port ) = preg_split('/:(?=\d)/' , $host ); + list( $ip, $port ) = preg_split( '/:(?=\d)/', $host ); $sock = false; $timeout = $this->_connect_timeout; $errno = $errstr = null; diff --git a/includes/parser/CoreParserFunctions.php b/includes/parser/CoreParserFunctions.php index 67b1c66205..ad6bc0f43c 100644 --- a/includes/parser/CoreParserFunctions.php +++ b/includes/parser/CoreParserFunctions.php @@ -60,12 +60,12 @@ class CoreParserFunctions { $parser->setFunctionHook( $func, array( __CLASS__, $func ), SFH_NO_HASH ); } - $parser->setFunctionHook( 'namespace', array( __CLASS__, 'mwnamespace' ), SFH_NO_HASH ); - $parser->setFunctionHook( 'int', array( __CLASS__, 'intFunction' ), SFH_NO_HASH ); - $parser->setFunctionHook( 'special', array( __CLASS__, 'special' ) ); - $parser->setFunctionHook( 'speciale', array( __CLASS__, 'speciale' ) ); - $parser->setFunctionHook( 'tag', array( __CLASS__, 'tagObj' ), SFH_OBJECT_ARGS ); - $parser->setFunctionHook( 'formatdate', array( __CLASS__, 'formatDate' ) ); + $parser->setFunctionHook( 'namespace', array( __CLASS__, 'mwnamespace' ), SFH_NO_HASH ); + $parser->setFunctionHook( 'int', array( __CLASS__, 'intFunction' ), SFH_NO_HASH ); + $parser->setFunctionHook( 'special', array( __CLASS__, 'special' ) ); + $parser->setFunctionHook( 'speciale', array( __CLASS__, 'speciale' ) ); + $parser->setFunctionHook( 'tag', array( __CLASS__, 'tagObj' ), SFH_OBJECT_ARGS ); + $parser->setFunctionHook( 'formatdate', array( __CLASS__, 'formatDate' ) ); if ( $wgAllowDisplayTitle ) { $parser->setFunctionHook( 'displaytitle', array( __CLASS__, 'displaytitle' ), SFH_NO_HASH ); @@ -210,7 +210,7 @@ class CoreParserFunctions { static function localurle( $parser, $s = '', $arg = null ) { $temp = self::urlFunction( 'getLocalURL', $s, $arg ); - if( !is_string( $temp ) ) { + if ( !is_string( $temp ) ) { return $temp; } else { return htmlspecialchars( $temp ); @@ -223,7 +223,7 @@ class CoreParserFunctions { static function fullurle( $parser, $s = '', $arg = null ) { $temp = self::urlFunction( 'getFullURL', $s, $arg ); - if( !is_string( $temp ) ) { + if ( !is_string( $temp ) ) { return $temp; } else { return htmlspecialchars( $temp ); diff --git a/includes/profiler/ProfilerMwprof.php b/includes/profiler/ProfilerMwprof.php index 5ecfc21037..e7ed6e35e5 100644 --- a/includes/profiler/ProfilerMwprof.php +++ b/includes/profiler/ProfilerMwprof.php @@ -36,7 +36,7 @@ class ProfilerMwprof extends Profiler { // Message types - const TYPE_SINGLE = 1; + const TYPE_SINGLE = 1; const TYPE_RUNNING = 2; /** diff --git a/includes/resourceloader/ResourceLoaderStartUpModule.php b/includes/resourceloader/ResourceLoaderStartUpModule.php index 64fafd70be..aed4c44ff5 100644 --- a/includes/resourceloader/ResourceLoaderStartUpModule.php +++ b/includes/resourceloader/ResourceLoaderStartUpModule.php @@ -218,7 +218,7 @@ class ResourceLoaderStartUpModule extends ResourceLoaderModule { ); // Ensure uniform query order ksort( $query ); - return wfAppendQuery( wfScript( 'load' ), $query ); + return wfAppendQuery( wfScript( 'load' ), $query ); } /** diff --git a/includes/specials/SpecialChangePassword.php b/includes/specials/SpecialChangePassword.php index 47f5b1ebd9..2bd14c7dcc 100644 --- a/includes/specials/SpecialChangePassword.php +++ b/includes/specials/SpecialChangePassword.php @@ -141,7 +141,7 @@ class SpecialChangePassword extends FormSpecialPage { ? 'resetpass-submit-loggedin' : 'resetpass_submit' ); - $form->addButton( 'wpCancel', $this->msg( 'resetpass-submit-cancel' )->text() ); + $form->addButton( 'wpCancel', $this->msg( 'resetpass-submit-cancel' )->text() ); $form->setHeaderText( $this->msg( 'resetpass_text' )->parseAsBlock() ); if ( $this->mPreTextMessage instanceof Message ) { $form->addPreText( $this->mPreTextMessage->parseAsBlock() ); diff --git a/includes/specials/SpecialUserrights.php b/includes/specials/SpecialUserrights.php index a6b36024e8..3ef8f8b9b5 100644 --- a/includes/specials/SpecialUserrights.php +++ b/includes/specials/SpecialUserrights.php @@ -156,7 +156,6 @@ class UserrightsPage extends SpecialPage { $targetUser->clearInstanceCache(); // bug 38989 } - if ( $request->getVal( 'conflictcheck-originalgroups' ) !== implode( ',', $targetUser->getGroups() ) ) { $out->addWikiMsg( 'userrights-conflict' ); } else { diff --git a/includes/specials/SpecialVersion.php b/includes/specials/SpecialVersion.php index 870fa1177a..d509f218c1 100644 --- a/includes/specials/SpecialVersion.php +++ b/includes/specials/SpecialVersion.php @@ -490,7 +490,7 @@ class SpecialVersion extends SpecialPage { $fhooks = $wgParser->getFunctionHooks(); if ( count( $fhooks ) ) { - $out = Html::rawElement( 'h2', array( 'class' => 'mw-headline' ) , Linker::makeExternalLink( + $out = Html::rawElement( 'h2', array( 'class' => 'mw-headline' ), Linker::makeExternalLink( '//www.mediawiki.org/wiki/Special:MyLanguage/Manual:Parser_functions', $this->msg( 'version-parser-function-hooks' )->parse(), false /* msg()->parse() already escapes */ @@ -625,7 +625,7 @@ class SpecialVersion extends SpecialPage { ); } else { $vcsVerString = Html::element( 'span', - array( 'class' => 'mw-version-ext-vcs-version'), + array( 'class' => 'mw-version-ext-vcs-version' ), "({$vcsVersion})" ); } @@ -633,7 +633,7 @@ class SpecialVersion extends SpecialPage { if ( $vcsDate ) { $vcsTimeString = Html::element( 'span', - array( 'class' => 'mw-version-ext-vcs-timestamp'), + array( 'class' => 'mw-version-ext-vcs-timestamp' ), $this->getLanguage()->timeanddate( $vcsDate ) ); $versionString .= " {$vcsTimeString}"; diff --git a/includes/specials/SpecialWatchlist.php b/includes/specials/SpecialWatchlist.php index fbdaec460d..4c3f17bb98 100644 --- a/includes/specials/SpecialWatchlist.php +++ b/includes/specials/SpecialWatchlist.php @@ -246,7 +246,6 @@ class SpecialWatchlist extends ChangesListSpecialPage { ), LIST_OR ); } - ChangeTags::modifyDisplayQuery( $tables, $fields, diff --git a/includes/upload/UploadBase.php b/includes/upload/UploadBase.php index 6cce4ac3f2..d4be08ccdb 100644 --- a/includes/upload/UploadBase.php +++ b/includes/upload/UploadBase.php @@ -1195,7 +1195,7 @@ abstract class UploadBase { */ public static function checkSvgPICallback( $target, $data ) { // Don't allow external stylesheets (bug 57550) - if ( preg_match( '/xml-stylesheet/i', $target) ) { + if ( preg_match( '/xml-stylesheet/i', $target ) ) { return true; } return false; @@ -1280,7 +1280,6 @@ abstract class UploadBase { return true; } - foreach ( $attribs as $attrib => $value ) { $stripped = $this->stripXmlNamespace( $attrib ); $value = strtolower( $value ); diff --git a/languages/classes/LanguageUz.php b/languages/classes/LanguageUz.php index 88d57de94a..985de68e06 100644 --- a/languages/classes/LanguageUz.php +++ b/languages/classes/LanguageUz.php @@ -114,7 +114,7 @@ class UzConverter extends LanguageConverter { } function translate( $text, $toVariant ) { - if( $toVariant == 'uz-cyrl' ) { + if ( $toVariant == 'uz-cyrl' ) { $text = str_replace( 'ye', 'е', $text ); $text = str_replace( 'Ye', 'Е', $text ); $text = str_replace( 'YE', 'Е', $text ); diff --git a/languages/utils/CLDRPluralRuleEvaluator.php b/languages/utils/CLDRPluralRuleEvaluator.php index edd97fdf68..e9b7e02bad 100644 --- a/languages/utils/CLDRPluralRuleEvaluator.php +++ b/languages/utils/CLDRPluralRuleEvaluator.php @@ -72,8 +72,8 @@ class CLDRPluralRuleEvaluator { public static function evaluateCompiled( $number, array $rules ) { // Calculate the values of the operand symbols $number = strval( $number ); - if ( !preg_match( '/^ -? ( ([0-9]+) (?: \. ([0-9]+) )? )$/x', $number, $m ) ) { - wfDebug( __METHOD__.': invalid number input, returning "other"' ); + if ( !preg_match( '/^ -? ( ([0-9]+) (?: \. ([0-9]+) )? )$/x', $number, $m ) ) { + wfDebug( __METHOD__ . ': invalid number input, returning "other"' ); return count( $rules ); } if ( !isset( $m[3] ) ) { diff --git a/maintenance/generateJsonI18n.php b/maintenance/generateJsonI18n.php index fd5636108c..3b2374d429 100644 --- a/maintenance/generateJsonI18n.php +++ b/maintenance/generateJsonI18n.php @@ -125,7 +125,7 @@ $GLOBALS['wgHooks']['LocalisationCacheRecache'][] = function ( $cache, $code, &$ PHP; - $jsondir = str_replace('\\', '/', $jsondir ); + $jsondir = str_replace( '\\', '/', $jsondir ); $shim = str_replace( '{{OUT}}', $jsondir, $shim ); return $shim; } diff --git a/skins/CologneBlue.php b/skins/CologneBlue.php index 9344febf22..ad1090aa7b 100644 --- a/skins/CologneBlue.php +++ b/skins/CologneBlue.php @@ -111,7 +111,7 @@ class CologneBlueTemplate extends BaseTemplate { return $html; } - /** + /** * @param string $name */ protected function renderAfterPortlet( $name ) { diff --git a/skins/Vector.php b/skins/Vector.php index 2bab6adc6e..5b944ebb54 100644 --- a/skins/Vector.php +++ b/skins/Vector.php @@ -275,7 +275,7 @@ class VectorTemplate extends BaseTemplate { $this->renderPortal( 'tb', $this->getToolbox(), 'toolbox', 'SkinTemplateToolboxEnd' ); break; case 'LANGUAGES': - if ( $this->data['language_urls'] !== false ) { + if ( $this->data['language_urls'] !== false ) { $this->renderPortal( 'lang', $this->data['language_urls'], 'otherlanguages' ); } break; diff --git a/tests/parser/parserTest.inc b/tests/parser/parserTest.inc index 595dd7df1b..f20d73a0a5 100644 --- a/tests/parser/parserTest.inc +++ b/tests/parser/parserTest.inc @@ -672,7 +672,7 @@ class ParserTest { ) ) )'; - $regex = '/'.$defs.'\b + $regex = '/' . $defs . '\b (?[\w-]+) # Key \b (?:\s* @@ -688,7 +688,7 @@ class ParserTest { ) )? /x'; - $valueregex = '/'.$defs.'(?&value)/x'; + $valueregex = '/' . $defs . '(?&value)/x'; if ( preg_match_all( $regex, $instring, $matches, PREG_SET_ORDER ) ) { foreach ( $matches as $bits ) { diff --git a/tests/phpunit/MediaWikiTestCase.php b/tests/phpunit/MediaWikiTestCase.php index 277826c482..3742a54618 100644 --- a/tests/phpunit/MediaWikiTestCase.php +++ b/tests/phpunit/MediaWikiTestCase.php @@ -353,7 +353,7 @@ abstract class MediaWikiTestCase extends PHPUnit_Framework_TestCase { } // NOTE; some things such as Closures are not serializable // in this case just set the value! - catch( Exception $e ) { + catch ( Exception $e ) { $this->mwGlobals[$globalKey] = $GLOBALS[$globalKey]; } } diff --git a/tests/phpunit/includes/MWTimestampTest.php b/tests/phpunit/includes/MWTimestampTest.php index 5b038a62bc..c82dc4275b 100644 --- a/tests/phpunit/includes/MWTimestampTest.php +++ b/tests/phpunit/includes/MWTimestampTest.php @@ -31,10 +31,10 @@ class MWTimestampTest extends MediaWikiLangTestCase { public function provideValidTimestampDifferences() { return array( - array( '1406833268','1406833269', '00 00 00 01' ), - array( '1406833268','1406833329', '00 00 01 01' ), - array( '1406833268','1406836929', '00 01 01 01' ), - array( '1406833268','1406923329', '01 01 01 01' ), + array( '1406833268', '1406833269', '00 00 00 01' ), + array( '1406833268', '1406833329', '00 00 01 01' ), + array( '1406833268', '1406836929', '00 01 01 01' ), + array( '1406833268', '1406923329', '01 01 01 01' ), ); } diff --git a/tests/phpunit/includes/MediaWikiVersionFetcherTest.php b/tests/phpunit/includes/MediaWikiVersionFetcherTest.php index bbb83da6c1..e548f81748 100644 --- a/tests/phpunit/includes/MediaWikiVersionFetcherTest.php +++ b/tests/phpunit/includes/MediaWikiVersionFetcherTest.php @@ -18,4 +18,4 @@ class MediaWikiVersionFetcherTest extends PHPUnit_Framework_TestCase { $this->assertInternalType( 'string', $versionFetcher->fetchVersion() ); } -} \ No newline at end of file +} diff --git a/tests/phpunit/includes/MessageTest.php b/tests/phpunit/includes/MessageTest.php index 7c993524fd..930a7f6ac1 100644 --- a/tests/phpunit/includes/MessageTest.php +++ b/tests/phpunit/includes/MessageTest.php @@ -31,7 +31,7 @@ class MessageTest extends MediaWikiLangTestCase { public function testParams( $expected ) { $msg = new Message( 'imasomething' ); - $returned = call_user_func_array( array( $msg, 'params' ), array_slice( func_get_args(), 1 ) ); + $returned = call_user_func_array( array( $msg, 'params' ), array_slice( func_get_args(), 1 ) ); $this->assertSame( $msg, $returned ); $this->assertEquals( $expected, $msg->getParams() ); diff --git a/tests/phpunit/includes/StatusTest.php b/tests/phpunit/includes/StatusTest.php index b0e6d20bfa..9d42d1c505 100644 --- a/tests/phpunit/includes/StatusTest.php +++ b/tests/phpunit/includes/StatusTest.php @@ -541,7 +541,7 @@ class StatusTest extends MediaWikiLangTestCase { */ public function testGetStatusArrayWithNonObjectMessages( $nonObjMsg ) { $status = new Status(); - if( !array_key_exists( 1, $nonObjMsg ) ) { + if ( !array_key_exists( 1, $nonObjMsg ) ) { $status->warning( $nonObjMsg[0] ); } else { $status->warning( $nonObjMsg[0], $nonObjMsg[1] ); diff --git a/tests/phpunit/includes/TitleArrayFromResultTest.php b/tests/phpunit/includes/TitleArrayFromResultTest.php index 534bd2c4e8..832316ee18 100644 --- a/tests/phpunit/includes/TitleArrayFromResultTest.php +++ b/tests/phpunit/includes/TitleArrayFromResultTest.php @@ -113,5 +113,4 @@ class TitleArrayFromResultTest extends MediaWikiTestCase { //@todo unit test for key() //@todo unit test for next() //@todo unit test for rewind() - -} \ No newline at end of file +} diff --git a/tests/phpunit/includes/UserArrayFromResultTest.php b/tests/phpunit/includes/UserArrayFromResultTest.php index adc330d21f..8d095d63c0 100644 --- a/tests/phpunit/includes/UserArrayFromResultTest.php +++ b/tests/phpunit/includes/UserArrayFromResultTest.php @@ -108,5 +108,4 @@ class UserArrayFromResultTest extends MediaWikiTestCase { //@todo unit test for key() //@todo unit test for next() //@todo unit test for rewind() - -} \ No newline at end of file +} diff --git a/tests/phpunit/includes/composer/ComposerVersionNormalizerTest.php b/tests/phpunit/includes/composer/ComposerVersionNormalizerTest.php index 8de8be16df..59b8d20c15 100644 --- a/tests/phpunit/includes/composer/ComposerVersionNormalizerTest.php +++ b/tests/phpunit/includes/composer/ComposerVersionNormalizerTest.php @@ -152,5 +152,4 @@ class ComposerVersionNormalizerTest extends PHPUnit_Framework_TestCase { array( 'alpha42' ), ); } - -} \ No newline at end of file +} diff --git a/tests/phpunit/includes/diff/ArrayDiffFormatterTest.php b/tests/phpunit/includes/diff/ArrayDiffFormatterTest.php index 50c5c572e4..351908b955 100644 --- a/tests/phpunit/includes/diff/ArrayDiffFormatterTest.php +++ b/tests/phpunit/includes/diff/ArrayDiffFormatterTest.php @@ -40,7 +40,7 @@ class ArrayDiffFormatterTest extends MediaWikiTestCase { $diffOp->expects( $this->any() ) ->method( 'getOrig' ) ->will( $this->returnValue( $orig ) ); - if( $type === 'change' ) { + if ( $type === 'change' ) { $diffOp->expects( $this->any() ) ->method( 'getClosing' ) ->with( $this->isType( 'integer' ) ) @@ -104,10 +104,10 @@ class ArrayDiffFormatterTest extends MediaWikiTestCase { ); $testCases = array(); - foreach( $emptyArrayTestCases as $testCase ) { + foreach ( $emptyArrayTestCases as $testCase ) { $testCases[] = array( $testCase, array() ); } - foreach( $otherTestCases as $testCase ) { + foreach ( $otherTestCases as $testCase ) { $testCases[] = array( $testCase[0], $testCase[1] ); } return $testCases; diff --git a/tests/phpunit/includes/diff/DiffOpTest.php b/tests/phpunit/includes/diff/DiffOpTest.php index fe2c566fa0..d89b89feec 100644 --- a/tests/phpunit/includes/diff/DiffOpTest.php +++ b/tests/phpunit/includes/diff/DiffOpTest.php @@ -1,7 +1,7 @@ closing = array( 'foo', 'bar', 'baz' ); - $this->assertEquals( 'foo' , $obj->getClosing( 0 ) ); - $this->assertEquals( 'bar' , $obj->getClosing( 1 ) ); - $this->assertEquals( 'baz' , $obj->getClosing( 2 ) ); - $this->assertEquals( null , $obj->getClosing( 3 ) ); + $this->assertEquals( 'foo', $obj->getClosing( 0 ) ); + $this->assertEquals( 'bar', $obj->getClosing( 1 ) ); + $this->assertEquals( 'baz', $obj->getClosing( 2 ) ); + $this->assertEquals( null, $obj->getClosing( 3 ) ); } /** diff --git a/tests/phpunit/includes/exception/BadTitleErrorTest.php b/tests/phpunit/includes/exception/BadTitleErrorTest.php index 6f9804dab4..003efd27f4 100644 --- a/tests/phpunit/includes/exception/BadTitleErrorTest.php +++ b/tests/phpunit/includes/exception/BadTitleErrorTest.php @@ -22,10 +22,9 @@ class BadTitleErrorTest extends MediaWikiTestCase { public function testExceptionSetsStatusCode() { global $wgOut; $wgOut = $this->getMockWgOut(); - try{ + try { throw new BadTitleError(); - } - catch( BadTitleError $e ) { + } catch ( BadTitleError $e ) { $e->report(); $this->assertTrue( true ); } diff --git a/tests/phpunit/includes/exception/ErrorPageErrorTest.php b/tests/phpunit/includes/exception/ErrorPageErrorTest.php index 4cfcd83e3e..13dcf33b27 100644 --- a/tests/phpunit/includes/exception/ErrorPageErrorTest.php +++ b/tests/phpunit/includes/exception/ErrorPageErrorTest.php @@ -27,7 +27,7 @@ class ErrorPageErrorTest extends MediaWikiTestCase { $mockMessage->expects( $this->once() ) ->method( 'inLanguage' ) ->will( $this->returnValue( $mockMessage ) ); - $mockMessage->expects( $this->once() ) + $mockMessage->expects( $this->once() ) ->method( 'useDatabase' ) ->will( $this->returnValue( $mockMessage ) ); return $mockMessage; diff --git a/tests/phpunit/includes/exception/MWExceptionTest.php b/tests/phpunit/includes/exception/MWExceptionTest.php index 2dc4850c03..24741a3dbc 100644 --- a/tests/phpunit/includes/exception/MWExceptionTest.php +++ b/tests/phpunit/includes/exception/MWExceptionTest.php @@ -112,11 +112,11 @@ class MWExceptionTest extends MediaWikiTestCase { */ public static function mockHook() { $args = func_get_args(); - if( !$args[0] instanceof MWException ) { + if ( !$args[0] instanceof MWException ) { return '$caller not instance of MWException'; } unset( $args[0] ); - if( array_key_exists( 1, $args ) && $args[1] === null ) { + if ( array_key_exists( 1, $args ) && $args[1] === null ) { return null; } return 'YAY.' . json_encode( $args ); diff --git a/tests/phpunit/includes/exception/ReadOnlyErrorTest.php b/tests/phpunit/includes/exception/ReadOnlyErrorTest.php index 352ec657e9..6f6aba47cf 100644 --- a/tests/phpunit/includes/exception/ReadOnlyErrorTest.php +++ b/tests/phpunit/includes/exception/ReadOnlyErrorTest.php @@ -10,7 +10,7 @@ class ReadOnlyErrorTest extends MediaWikiTestCase { $e = new ReadOnlyError(); $this->assertEquals( 'readonly', $e->title ); $this->assertEquals( 'readonlytext', $e->msg ); - $this->assertEquals( wfReadOnlyReason()?: array(), $e->params ); + $this->assertEquals( wfReadOnlyReason() ?: array(), $e->params ); } } diff --git a/tests/phpunit/includes/exception/ThrottledErrorTest.php b/tests/phpunit/includes/exception/ThrottledErrorTest.php index ca6724192e..8995a0d80f 100644 --- a/tests/phpunit/includes/exception/ThrottledErrorTest.php +++ b/tests/phpunit/includes/exception/ThrottledErrorTest.php @@ -23,10 +23,9 @@ class ThrottledErrorTest extends MediaWikiTestCase { public function testExceptionSetsStatusCode() { global $wgOut; $wgOut = $this->getMockWgOut(); - try{ + try { throw new ThrottledError(); - } - catch( ThrottledError $e ) { + } catch ( ThrottledError $e ) { $e->report(); $this->assertTrue( true ); } diff --git a/tests/phpunit/includes/site/SiteListTest.php b/tests/phpunit/includes/site/SiteListTest.php index 61d0ace0d7..534ed9c905 100644 --- a/tests/phpunit/includes/site/SiteListTest.php +++ b/tests/phpunit/includes/site/SiteListTest.php @@ -229,7 +229,7 @@ class SiteListTest extends MediaWikiTestCase { foreach ( $list as $site ) { $this->assertTrue( $copy->hasInternalId( $site->getInternalId() ) ); - foreach( $site->getNavigationIds() as $navId ) { + foreach ( $site->getNavigationIds() as $navId ) { $this->assertTrue( $copy->hasNavigationId( $navId ), 'unserialized data expects nav id ' . $navId . ' for site ' . $site->getGlobalId() diff --git a/tests/phpunit/languages/LanguageRuTest.php b/tests/phpunit/languages/LanguageRuTest.php index e17c70857e..792cf726da 100644 --- a/tests/phpunit/languages/LanguageRuTest.php +++ b/tests/phpunit/languages/LanguageRuTest.php @@ -22,7 +22,7 @@ class LanguageRuTest extends LanguageClassesTestCase { * @covers Language::convertPlural */ public function testExplicitPlural() { - $forms = array( 'one','many', 'other', '12=dozen' ); + $forms = array( 'one', 'many', 'other', '12=dozen' ); $this->assertEquals( 'dozen', $this->getLang()->convertPlural( 12, $forms ) ); $forms = array( 'one', 'many', '100=hundred', 'other', '12=dozen' ); $this->assertEquals( 'hundred', $this->getLang()->convertPlural( 100, $forms ) ); diff --git a/tests/phpunit/languages/SpecialPageAliasTest.php b/tests/phpunit/languages/SpecialPageAliasTest.php index 8865f689aa..f6d6bc9643 100644 --- a/tests/phpunit/languages/SpecialPageAliasTest.php +++ b/tests/phpunit/languages/SpecialPageAliasTest.php @@ -17,8 +17,8 @@ class SpecialPageAliasTest extends MediaWikiTestCase { * @dataProvider validSpecialPageAliasesProvider */ public function testValidSpecialPageAliases( $code, $specialPageAliases ) { - foreach( $specialPageAliases as $specialPage => $aliases ) { - foreach( $aliases as $alias ) { + foreach ( $specialPageAliases as $specialPage => $aliases ) { + foreach ( $aliases as $alias ) { $msg = "$specialPage alias '$alias' in $code is valid with no slashes"; $this->assertRegExp( '/^[^\/]*$/', $msg ); } @@ -30,7 +30,7 @@ class SpecialPageAliasTest extends MediaWikiTestCase { $data = array(); - foreach( $codes as $code ) { + foreach ( $codes as $code ) { $specialPageAliases = $this->getSpecialPageAliases( $code ); if ( $specialPageAliases !== array() ) { diff --git a/tests/testHelpers.inc b/tests/testHelpers.inc index 1d9cf305aa..bc6714757b 100644 --- a/tests/testHelpers.inc +++ b/tests/testHelpers.inc @@ -481,7 +481,7 @@ class TestFileIterator implements Iterator { } if ( $input == false || $result == false || - ( ( preg_match( '/\\bdisabled\\b/i', $this->sectionData['options'] ) && !$this->parserTest->runDisabled ) + ( ( preg_match( '/\\bdisabled\\b/i', $this->sectionData['options'] ) && !$this->parserTest->runDisabled ) || ( preg_match( '/\\bparsoid\\b/i', $this->sectionData['options'] ) && $result != 'html/php' && !$this->parserTest->runParsoid ) || !preg_match( "/" . $this->parserTest->regex . "/i", $this->sectionData['test'] ) ) ) {