Umherirrender has uploaded a new change for review.
https://gerrit.wikimedia.org/r/119798
Change subject: Fixed spacing
......................................................................
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
---
M includes/MediaWikiVersionFetcher.php
M includes/QueryPage.php
M includes/Setup.php
M includes/TimestampException.php
M includes/TitleArrayFromResult.php
M includes/User.php
M includes/UserArray.php
M includes/composer/ComposerVersionNormalizer.php
M includes/db/DatabaseMssql.php
M includes/db/DatabaseMysqli.php
M includes/diff/DairikiDiff.php
M includes/filebackend/SwiftFileBackend.php
M includes/installer/MssqlInstaller.php
M includes/objectcache/MemcachedClient.php
M includes/parser/CoreParserFunctions.php
M includes/profiler/ProfilerMwprof.php
M includes/resourceloader/ResourceLoaderStartUpModule.php
M includes/specials/SpecialChangePassword.php
M includes/specials/SpecialUserrights.php
M includes/specials/SpecialVersion.php
M includes/specials/SpecialWatchlist.php
M includes/upload/UploadBase.php
M languages/classes/LanguageUz.php
M languages/utils/CLDRPluralRuleEvaluator.php
M maintenance/generateJsonI18n.php
M skins/CologneBlue.php
M skins/Vector.php
M tests/parser/parserTest.inc
M tests/phpunit/MediaWikiTestCase.php
M tests/phpunit/includes/MWTimestampTest.php
M tests/phpunit/includes/MediaWikiVersionFetcherTest.php
M tests/phpunit/includes/MessageTest.php
M tests/phpunit/includes/StatusTest.php
M tests/phpunit/includes/TitleArrayFromResultTest.php
M tests/phpunit/includes/UserArrayFromResultTest.php
M tests/phpunit/includes/composer/ComposerVersionNormalizerTest.php
M tests/phpunit/includes/diff/ArrayDiffFormatterTest.php
M tests/phpunit/includes/diff/DiffOpTest.php
M tests/phpunit/includes/exception/BadTitleErrorTest.php
M tests/phpunit/includes/exception/ErrorPageErrorTest.php
M tests/phpunit/includes/exception/MWExceptionTest.php
M tests/phpunit/includes/exception/ReadOnlyErrorTest.php
M tests/phpunit/includes/exception/ThrottledErrorTest.php
M tests/phpunit/includes/site/SiteListTest.php
M tests/phpunit/languages/LanguageRuTest.php
M tests/phpunit/languages/SpecialPageAliasTest.php
M tests/testHelpers.inc
47 files changed, 80 insertions(+), 89 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core
refs/changes/98/119798/1
diff --git a/includes/MediaWikiVersionFetcher.php
b/includes/MediaWikiVersionFetcher.php
index 1d59ec3..17cb8aa 100644
--- a/includes/MediaWikiVersionFetcher.php
+++ b/includes/MediaWikiVersionFetcher.php
@@ -28,4 +28,4 @@
return $matches[1];
}
-}
\ No newline at end of file
+}
diff --git a/includes/QueryPage.php b/includes/QueryPage.php
index b808408..69629e0 100644
--- a/includes/QueryPage.php
+++ b/includes/QueryPage.php
@@ -552,7 +552,7 @@
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 777ca37..1a7f21e 100644
--- a/includes/Setup.php
+++ b/includes/Setup.php
@@ -36,7 +36,7 @@
$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 @@
);
}
-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 18f58fd..4345a73 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 f900538..b4a553f 100644
--- a/includes/TitleArrayFromResult.php
+++ b/includes/TitleArrayFromResult.php
@@ -83,4 +83,4 @@
function valid() {
return $this->current !== false;
}
-}
\ No newline at end of file
+}
diff --git a/includes/User.php b/includes/User.php
index dd8717f..1ccb732 100644
--- a/includes/User.php
+++ b/includes/User.php
@@ -1700,7 +1700,7 @@
// 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 38f0d9d..51fb154 100644
--- a/includes/UserArray.php
+++ b/includes/UserArray.php
@@ -63,4 +63,4 @@
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 727e142..a0d31cf 100644
--- a/includes/composer/ComposerVersionNormalizer.php
+++ b/includes/composer/ComposerVersionNormalizer.php
@@ -63,5 +63,4 @@
return $version;
}
-
-}
\ No newline at end of file
+}
diff --git a/includes/db/DatabaseMssql.php b/includes/db/DatabaseMssql.php
index e304a34..50b7158 100644
--- a/includes/db/DatabaseMssql.php
+++ b/includes/db/DatabaseMssql.php
@@ -471,7 +471,7 @@
$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 @@
$this->mScrollableCursor = false;
try {
parent::delete( $table, $conds, $fname );
- } catch( Exception $e ) {
+ } catch ( Exception $e ) {
$this->mScrollableCursor = true;
throw $e;
}
@@ -730,7 +730,7 @@
$insertOptions,
$selectOptions
);
- } catch( Exception $e ) {
+ } catch ( Exception $e ) {
$this->mScrollableCursor = true;
throw $e;
}
@@ -911,7 +911,7 @@
$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 b371ae0..8c9b06c 100644
--- a/includes/db/DatabaseMysqli.php
+++ b/includes/db/DatabaseMysqli.php
@@ -67,7 +67,7 @@
$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 61edc1e..0e38d68 100644
--- a/includes/diff/DairikiDiff.php
+++ b/includes/diff/DairikiDiff.php
@@ -66,10 +66,10 @@
* @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 @@
}
$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 7050226..174f9f3 100644
--- a/includes/filebackend/SwiftFileBackend.php
+++ b/includes/filebackend/SwiftFileBackend.php
@@ -1275,7 +1275,7 @@
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 952b902..d6c84eb 100644
--- a/includes/installer/MssqlInstaller.php
+++ b/includes/installer/MssqlInstaller.php
@@ -273,12 +273,12 @@
// 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 79c5187..d9ea54c 100644
--- a/includes/objectcache/MemcachedClient.php
+++ b/includes/objectcache/MemcachedClient.php
@@ -729,7 +729,7 @@
* @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 67b1c66..ad6bc0f 100644
--- a/includes/parser/CoreParserFunctions.php
+++ b/includes/parser/CoreParserFunctions.php
@@ -60,12 +60,12 @@
$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 @@
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 @@
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 5ecfc21..e7ed6e3 100644
--- a/includes/profiler/ProfilerMwprof.php
+++ b/includes/profiler/ProfilerMwprof.php
@@ -36,7 +36,7 @@
// 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 64fafd7..aed4c44 100644
--- a/includes/resourceloader/ResourceLoaderStartUpModule.php
+++ b/includes/resourceloader/ResourceLoaderStartUpModule.php
@@ -218,7 +218,7 @@
);
// 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 47f5b1e..2bd14c7 100644
--- a/includes/specials/SpecialChangePassword.php
+++ b/includes/specials/SpecialChangePassword.php
@@ -141,7 +141,7 @@
? '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 a6b3602..3ef8f8b 100644
--- a/includes/specials/SpecialUserrights.php
+++ b/includes/specials/SpecialUserrights.php
@@ -156,7 +156,6 @@
$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 870fa11..d509f21 100644
--- a/includes/specials/SpecialVersion.php
+++ b/includes/specials/SpecialVersion.php
@@ -490,7 +490,7 @@
$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 @@
);
} else {
$vcsVerString = Html::element( 'span',
- array( 'class' =>
'mw-version-ext-vcs-version'),
+ array( 'class' =>
'mw-version-ext-vcs-version' ),
"({$vcsVersion})"
);
}
@@ -633,7 +633,7 @@
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 fbdaec4..4c3f17b 100644
--- a/includes/specials/SpecialWatchlist.php
+++ b/includes/specials/SpecialWatchlist.php
@@ -246,7 +246,6 @@
), LIST_OR );
}
-
ChangeTags::modifyDisplayQuery(
$tables,
$fields,
diff --git a/includes/upload/UploadBase.php b/includes/upload/UploadBase.php
index 6cce4ac..d4be08c 100644
--- a/includes/upload/UploadBase.php
+++ b/includes/upload/UploadBase.php
@@ -1195,7 +1195,7 @@
*/
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;
@@ -1279,7 +1279,6 @@
wfDebug( __METHOD__ . ": iframe in uploaded file.\n" );
return true;
}
-
foreach ( $attribs as $attrib => $value ) {
$stripped = $this->stripXmlNamespace( $attrib );
diff --git a/languages/classes/LanguageUz.php b/languages/classes/LanguageUz.php
index 88d57de..985de68 100644
--- a/languages/classes/LanguageUz.php
+++ b/languages/classes/LanguageUz.php
@@ -114,7 +114,7 @@
}
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 edd97fd..e9b7e02 100644
--- a/languages/utils/CLDRPluralRuleEvaluator.php
+++ b/languages/utils/CLDRPluralRuleEvaluator.php
@@ -72,8 +72,8 @@
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 fd56361..3b2374d 100644
--- a/maintenance/generateJsonI18n.php
+++ b/maintenance/generateJsonI18n.php
@@ -125,7 +125,7 @@
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 9344feb..ad1090a 100644
--- a/skins/CologneBlue.php
+++ b/skins/CologneBlue.php
@@ -111,7 +111,7 @@
return $html;
}
- /**
+ /**
* @param string $name
*/
protected function renderAfterPortlet( $name ) {
diff --git a/skins/Vector.php b/skins/Vector.php
index 2bab6ad..5b944eb 100644
--- a/skins/Vector.php
+++ b/skins/Vector.php
@@ -275,7 +275,7 @@
$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 595dd7d..f20d73a 100644
--- a/tests/parser/parserTest.inc
+++ b/tests/parser/parserTest.inc
@@ -672,7 +672,7 @@
)
)
)';
- $regex = '/'.$defs.'\b
+ $regex = '/' . $defs . '\b
(?<k>[\w-]+) # Key
\b
(?:\s*
@@ -688,7 +688,7 @@
)
)?
/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 277826c..3742a54 100644
--- a/tests/phpunit/MediaWikiTestCase.php
+++ b/tests/phpunit/MediaWikiTestCase.php
@@ -353,7 +353,7 @@
}
// 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 5b038a6..c82dc42 100644
--- a/tests/phpunit/includes/MWTimestampTest.php
+++ b/tests/phpunit/includes/MWTimestampTest.php
@@ -31,10 +31,10 @@
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 bbb83da..e548f81 100644
--- a/tests/phpunit/includes/MediaWikiVersionFetcherTest.php
+++ b/tests/phpunit/includes/MediaWikiVersionFetcherTest.php
@@ -18,4 +18,4 @@
$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 7c99352..930a7f6 100644
--- a/tests/phpunit/includes/MessageTest.php
+++ b/tests/phpunit/includes/MessageTest.php
@@ -31,7 +31,7 @@
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 b0e6d20..9d42d1c 100644
--- a/tests/phpunit/includes/StatusTest.php
+++ b/tests/phpunit/includes/StatusTest.php
@@ -541,7 +541,7 @@
*/
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 534bd2c..832316e 100644
--- a/tests/phpunit/includes/TitleArrayFromResultTest.php
+++ b/tests/phpunit/includes/TitleArrayFromResultTest.php
@@ -113,5 +113,4 @@
//@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 adc330d..8d095d6 100644
--- a/tests/phpunit/includes/UserArrayFromResultTest.php
+++ b/tests/phpunit/includes/UserArrayFromResultTest.php
@@ -108,5 +108,4 @@
//@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 8de8be1..59b8d20 100644
--- a/tests/phpunit/includes/composer/ComposerVersionNormalizerTest.php
+++ b/tests/phpunit/includes/composer/ComposerVersionNormalizerTest.php
@@ -152,5 +152,4 @@
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 50c5c57..351908b 100644
--- a/tests/phpunit/includes/diff/ArrayDiffFormatterTest.php
+++ b/tests/phpunit/includes/diff/ArrayDiffFormatterTest.php
@@ -40,7 +40,7 @@
$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 @@
);
$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 fe2c566..d89b89f 100644
--- a/tests/phpunit/includes/diff/DiffOpTest.php
+++ b/tests/phpunit/includes/diff/DiffOpTest.php
@@ -1,7 +1,7 @@
<?php
//Load our FakeDiffOp
-require_once( __DIR__ . DIRECTORY_SEPARATOR . 'FakeDiffOp.php' );
+require_once __DIR__ . DIRECTORY_SEPARATOR . 'FakeDiffOp.php';
/**
* @licence GNU GPL v2+
@@ -44,10 +44,10 @@
public function testGetClosingWithParameter() {
$obj = new FakeDiffOp();
$obj->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 6f9804d..003efd2 100644
--- a/tests/phpunit/includes/exception/BadTitleErrorTest.php
+++ b/tests/phpunit/includes/exception/BadTitleErrorTest.php
@@ -22,10 +22,9 @@
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 4cfcd83..13dcf33 100644
--- a/tests/phpunit/includes/exception/ErrorPageErrorTest.php
+++ b/tests/phpunit/includes/exception/ErrorPageErrorTest.php
@@ -27,7 +27,7 @@
$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 2dc4850..24741a3 100644
--- a/tests/phpunit/includes/exception/MWExceptionTest.php
+++ b/tests/phpunit/includes/exception/MWExceptionTest.php
@@ -112,11 +112,11 @@
*/
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 352ec65..6f6aba4 100644
--- a/tests/phpunit/includes/exception/ReadOnlyErrorTest.php
+++ b/tests/phpunit/includes/exception/ReadOnlyErrorTest.php
@@ -10,7 +10,7 @@
$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 ca67241..8995a0d 100644
--- a/tests/phpunit/includes/exception/ThrottledErrorTest.php
+++ b/tests/phpunit/includes/exception/ThrottledErrorTest.php
@@ -23,10 +23,9 @@
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 61d0ace..534ed9c 100644
--- a/tests/phpunit/includes/site/SiteListTest.php
+++ b/tests/phpunit/includes/site/SiteListTest.php
@@ -229,7 +229,7 @@
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 e17c708..792cf72 100644
--- a/tests/phpunit/languages/LanguageRuTest.php
+++ b/tests/phpunit/languages/LanguageRuTest.php
@@ -22,7 +22,7 @@
* @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 8865f68..f6d6bc9 100644
--- a/tests/phpunit/languages/SpecialPageAliasTest.php
+++ b/tests/phpunit/languages/SpecialPageAliasTest.php
@@ -17,8 +17,8 @@
* @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 @@
$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 1d9cf30..bc67147 100644
--- a/tests/testHelpers.inc
+++ b/tests/testHelpers.inc
@@ -481,7 +481,7 @@
}
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'] ) )
) {
--
To view, visit https://gerrit.wikimedia.org/r/119798
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I0590070f1b3542108e242730e8d9a3ba9831e94f
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Umherirrender <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits