jenkins-bot has submitted this change and it was merged.
Change subject: Fixed spacing in api folder
......................................................................
Fixed spacing in api folder
Added spaces before if, foreach
Added some braces for one line statements
Change-Id: Id7779dca4d1185245cf5764102b8de8b232c34b6
---
M includes/api/ApiBase.php
M includes/api/ApiBlock.php
M includes/api/ApiComparePages.php
M includes/api/ApiCreateAccount.php
M includes/api/ApiFeedContributions.php
M includes/api/ApiFeedWatchlist.php
M includes/api/ApiImageRotate.php
M includes/api/ApiImport.php
M includes/api/ApiMain.php
M includes/api/ApiMove.php
M includes/api/ApiPurge.php
M includes/api/ApiQueryAllMessages.php
M includes/api/ApiQueryAllPages.php
M includes/api/ApiQueryAllUsers.php
M includes/api/ApiQueryBacklinks.php
M includes/api/ApiQueryBlocks.php
M includes/api/ApiQueryDeletedrevs.php
M includes/api/ApiQueryDuplicateFiles.php
M includes/api/ApiQueryExtLinksUsage.php
M includes/api/ApiQueryExternalLinks.php
M includes/api/ApiQueryImageInfo.php
M includes/api/ApiQueryInfo.php
M includes/api/ApiQueryLogEvents.php
M includes/api/ApiQueryQueryPage.php
M includes/api/ApiQuerySiteinfo.php
M includes/api/ApiQueryUserContributions.php
M includes/api/ApiQueryUserInfo.php
M includes/api/ApiQueryUsers.php
M includes/api/ApiUpload.php
29 files changed, 84 insertions(+), 83 deletions(-)
Approvals:
IAlex: Looks good to me, approved
jenkins-bot: Verified
diff --git a/includes/api/ApiBase.php b/includes/api/ApiBase.php
index 08fde7a..ee5aa97 100644
--- a/includes/api/ApiBase.php
+++ b/includes/api/ApiBase.php
@@ -311,8 +311,7 @@
);
}
$msg .= "Example" . ( count( $examples ) > 1 ?
's' : '' ) . ":\n";
- foreach( $examples as $k => $v ) {
-
+ foreach ( $examples as $k => $v ) {
if ( is_numeric( $k ) ) {
$msg .= " $v\n";
} else {
@@ -1397,7 +1396,7 @@
public function dieUsageMsg( $error ) {
# most of the time we send a 1 element, so we might as well
send it as
# a string and make this an array here.
- if( is_string( $error ) ) {
+ if ( is_string( $error ) ) {
$error = array( $error );
}
$parsed = $this->parseMsg( $error );
@@ -1412,10 +1411,10 @@
*/
public function dieUsageMsgOrDebug( $error ) {
global $wgDebugAPI;
- if( $wgDebugAPI !== true ) {
+ if ( $wgDebugAPI !== true ) {
$this->dieUsageMsg( $error );
} else {
- if( is_string( $error ) ) {
+ if ( is_string( $error ) ) {
$error = array( $error );
}
$parsed = $this->parseMsg( $error );
@@ -1448,7 +1447,7 @@
// Check whether the error array was nested
// array( array( <code>, <params> ), array( <another_code>,
<params> ) )
- if( is_array( $key ) ) {
+ if ( is_array( $key ) ) {
$error = $key;
$key = array_shift( $error );
}
diff --git a/includes/api/ApiBlock.php b/includes/api/ApiBlock.php
index 90432b9..ab0a7e9 100644
--- a/includes/api/ApiBlock.php
+++ b/includes/api/ApiBlock.php
@@ -104,7 +104,7 @@
$res['userID'] = $target instanceof User ? $target->getId() : 0;
$block = Block::newFromTarget( $target );
- if( $block instanceof Block ) {
+ if ( $block instanceof Block ) {
$res['expiry'] = $block->mExpiry ==
$this->getDB()->getInfinity()
? 'infinite'
: wfTimestamp( TS_ISO_8601, $block->mExpiry );
diff --git a/includes/api/ApiComparePages.php b/includes/api/ApiComparePages.php
index 79ffcb0..1e35c34 100644
--- a/includes/api/ApiComparePages.php
+++ b/includes/api/ApiComparePages.php
@@ -81,17 +81,17 @@
* @return int
*/
private function revisionOrTitleOrId( $revision, $titleText, $titleId )
{
- if( $revision ) {
+ if ( $revision ) {
return $revision;
- } elseif( $titleText ) {
+ } elseif ( $titleText ) {
$title = Title::newFromText( $titleText );
- if( !$title || $title->isExternal() ) {
+ if ( !$title || $title->isExternal() ) {
$this->dieUsageMsg( array( 'invalidtitle',
$titleText ) );
}
return $title->getLatestRevID();
} elseif ( $titleId ) {
$title = Title::newFromID( $titleId );
- if( !$title ) {
+ if ( !$title ) {
$this->dieUsageMsg( array( 'nosuchpageid',
$titleId ) );
}
return $title->getLatestRevID();
diff --git a/includes/api/ApiCreateAccount.php
b/includes/api/ApiCreateAccount.php
index 278ea29..59ff324 100644
--- a/includes/api/ApiCreateAccount.php
+++ b/includes/api/ApiCreateAccount.php
@@ -48,7 +48,7 @@
wfSetupSession();
}
- if( $params['mailpassword'] && !$params['email'] ) {
+ if ( $params['mailpassword'] && !$params['email'] ) {
$this->dieUsageMsg( 'noemail' );
}
@@ -80,20 +80,20 @@
$status = $loginForm->addNewaccountInternal();
$result = array();
- if( $status->isGood() ) {
+ if ( $status->isGood() ) {
// Success!
global $wgEmailAuthentication;
$user = $status->getValue();
- if( $params['language'] ) {
+ if ( $params['language'] ) {
$user->setOption( 'language',
$params['language'] );
}
- if( $params['mailpassword'] ) {
+ if ( $params['mailpassword'] ) {
// If mailpassword was set, disable the
password and send an email.
$user->setPassword( null );
$status->merge(
$loginForm->mailPasswordInternal( $user, false, 'createaccount-title',
'createaccount-text' ) );
- } elseif( $wgEmailAuthentication &&
Sanitizer::validateEmail( $user->getEmail() ) ) {
+ } elseif ( $wgEmailAuthentication &&
Sanitizer::validateEmail( $user->getEmail() ) ) {
// Send out an email authentication message if
needed
$status->merge( $user->sendConfirmationMail() );
}
@@ -120,18 +120,18 @@
$apiResult = $this->getResult();
- if( $status->hasMessage( 'sessionfailure' ) ||
$status->hasMessage( 'nocookiesfornew' ) ) {
+ if ( $status->hasMessage( 'sessionfailure' ) ||
$status->hasMessage( 'nocookiesfornew' ) ) {
// Token was incorrect, so add it to result, but don't
throw an exception
// since not having the correct token is part of the
normal
// flow of events.
$result['token'] = LoginForm::getCreateaccountToken();
$result['result'] = 'needtoken';
- } elseif( !$status->isOK() ) {
+ } elseif ( !$status->isOK() ) {
// There was an error. Die now.
// Cannot use dieUsageMsg() directly because extensions
// might return custom error messages.
$errors = $status->getErrorsArray();
- if( $errors[0] instanceof Message ) {
+ if ( $errors[0] instanceof Message ) {
$code = 'aborted';
$desc = $errors[0];
} else {
@@ -139,14 +139,14 @@
$desc = wfMessage( $code, $errors[0] );
}
$this->dieUsage( $desc, $code );
- } elseif( !$status->isGood() ) {
+ } elseif ( !$status->isGood() ) {
// Status is not good, but OK. This means warnings.
$result['result'] = 'warning';
// Add any warnings to the result
$warnings = $status->getErrorsByType( 'warning' );
- if( $warnings ) {
- foreach( $warnings as &$warning ) {
+ if ( $warnings ) {
+ foreach ( $warnings as &$warning ) {
$apiResult->setIndexedTagName(
$warning['params'], 'param' );
}
$apiResult->setIndexedTagName( $warnings,
'warning' );
@@ -259,7 +259,7 @@
$errors = parent::getPossibleErrors();
// All local errors are from LoginForm, which means they're
actually message keys.
- foreach( $localErrors as $error ) {
+ foreach ( $localErrors as $error ) {
$errors[] = array( 'code' => $error, 'info' =>
wfMessage( $error )->parse() );
}
diff --git a/includes/api/ApiFeedContributions.php
b/includes/api/ApiFeedContributions.php
index 42fb652..a11563b 100644
--- a/includes/api/ApiFeedContributions.php
+++ b/includes/api/ApiFeedContributions.php
@@ -43,11 +43,11 @@
global $wgFeed, $wgFeedClasses, $wgSitename, $wgLanguageCode;
- if( !$wgFeed ) {
+ if ( !$wgFeed ) {
$this->dieUsage( 'Syndication feeds are not available',
'feed-unavailable' );
}
- if( !isset( $wgFeedClasses[$params['feedformat']] ) ) {
+ if ( !isset( $wgFeedClasses[$params['feedformat']] ) ) {
$this->dieUsage( 'Invalid subscription feed type',
'feed-invalid' );
}
@@ -82,7 +82,7 @@
) );
$feedItems = array();
- if( $pager->getNumRows() > 0 ) {
+ if ( $pager->getNumRows() > 0 ) {
foreach ( $pager->mResult as $row ) {
$feedItems[] = $this->feedItem( $row );
}
@@ -93,7 +93,7 @@
protected function feedItem( $row ) {
$title = Title::makeTitle( intval( $row->page_namespace ),
$row->page_title );
- if( $title ) {
+ if ( $title ) {
$date = $row->rev_timestamp;
$comments = $title->getTalkPage()->getFullURL();
$revision = Revision::newFromRow( $row );
@@ -124,7 +124,7 @@
* @return string
*/
protected function feedItemDesc( $revision ) {
- if( $revision ) {
+ if ( $revision ) {
$msg = wfMessage( 'colon-separator'
)->inContentLanguage()->text();
$content = $revision->getContent();
diff --git a/includes/api/ApiFeedWatchlist.php
b/includes/api/ApiFeedWatchlist.php
index b96ea37..ddcd6ac 100644
--- a/includes/api/ApiFeedWatchlist.php
+++ b/includes/api/ApiFeedWatchlist.php
@@ -56,11 +56,11 @@
try {
$params = $this->extractRequestParams();
- if( !$wgFeed ) {
+ if ( !$wgFeed ) {
$this->dieUsage( 'Syndication feeds are not
available', 'feed-unavailable' );
}
- if( !isset( $wgFeedClasses[$params['feedformat']] ) ) {
+ if ( !isset( $wgFeedClasses[$params['feedformat']] ) ) {
$this->dieUsage( 'Invalid subscription feed
type', 'feed-invalid' );
}
diff --git a/includes/api/ApiImageRotate.php b/includes/api/ApiImageRotate.php
index 3ecb0d5..7a60e83 100644
--- a/includes/api/ApiImageRotate.php
+++ b/includes/api/ApiImageRotate.php
@@ -37,15 +37,15 @@
*/
private static function addValues( array &$result, $values, $flag =
null, $name = null ) {
foreach ( $values as $val ) {
- if( $val instanceof Title ) {
+ if ( $val instanceof Title ) {
$v = array();
ApiQueryBase::addTitleInfo( $v, $val );
- } elseif( $name !== null ) {
+ } elseif ( $name !== null ) {
$v = array( $name => $val );
} else {
$v = $val;
}
- if( $flag !== null ) {
+ if ( $flag !== null ) {
$v[$flag] = '';
}
$result[] = $v;
diff --git a/includes/api/ApiImport.php b/includes/api/ApiImport.php
index 1f0a5fa..56af76f 100644
--- a/includes/api/ApiImport.php
+++ b/includes/api/ApiImport.php
@@ -66,7 +66,7 @@
}
if ( isset( $params['rootpage'] ) ) {
$statusRootPage = $importer->setTargetRootPage(
$params['rootpage'] );
- if( !$statusRootPage->isGood() ) {
+ if ( !$statusRootPage->isGood() ) {
$this->dieUsageMsg(
$statusRootPage->getErrorsArray() );
}
}
diff --git a/includes/api/ApiMain.php b/includes/api/ApiMain.php
index 76f9b42..99847cf 100644
--- a/includes/api/ApiMain.php
+++ b/includes/api/ApiMain.php
@@ -788,7 +788,7 @@
// Allow extensions to stop execution for arbitrary reasons.
$message = false;
- if( !wfRunHooks( 'ApiCheckCanExecute', array( $module, $user,
&$message ) ) ) {
+ if ( !wfRunHooks( 'ApiCheckCanExecute', array( $module, $user,
&$message ) ) ) {
$this->dieUsageMsg( $message );
}
}
@@ -950,7 +950,7 @@
$unusedParams = array_diff( $allParams, $paramsUsed );
}
- if( count( $unusedParams ) ) {
+ if ( count( $unusedParams ) ) {
$s = count( $unusedParams ) > 1 ? 's' : '';
$this->setWarning( "Unrecognized parameter$s: '" .
implode( $unusedParams, "', '" ) . "'" );
}
@@ -963,7 +963,7 @@
*/
protected function printResult( $isError ) {
global $wgDebugAPI;
- if( $wgDebugAPI !== false ) {
+ if ( $wgDebugAPI !== false ) {
$this->setWarning( 'SECURITY WARNING: $wgDebugAPI is
enabled' );
}
@@ -1008,7 +1008,7 @@
ApiBase::PARAM_DFLT => 'help',
ApiBase::PARAM_TYPE =>
$this->mModuleMgr->getNames( 'action' )
),
- 'maxlag' => array(
+ 'maxlag' => array(
ApiBase::PARAM_TYPE => 'integer'
),
'smaxage' => array(
@@ -1020,7 +1020,7 @@
ApiBase::PARAM_DFLT => 0
),
'requestid' => null,
- 'servedby' => false,
+ 'servedby' => false,
'origin' => null,
);
}
diff --git a/includes/api/ApiMove.php b/includes/api/ApiMove.php
index 3e846e3..c18036c 100644
--- a/includes/api/ApiMove.php
+++ b/includes/api/ApiMove.php
@@ -88,7 +88,7 @@
$r['redirectcreated'] = '';
}
- if( $toTitleExists ) {
+ if ( $toTitleExists ) {
$r['moveoverredirect'] = '';
}
@@ -99,7 +99,7 @@
if ( $retval === true ) {
$r['talkfrom'] = $fromTalk->getPrefixedText();
$r['talkto'] = $toTalk->getPrefixedText();
- if( $toTalkExists ) {
+ if ( $toTalkExists ) {
$r['talkmoveoverredirect'] = '';
}
} else {
diff --git a/includes/api/ApiPurge.php b/includes/api/ApiPurge.php
index f13a50e..b68dc5c 100644
--- a/includes/api/ApiPurge.php
+++ b/includes/api/ApiPurge.php
@@ -42,15 +42,15 @@
*/
private static function addValues( array &$result, $values, $flag =
null, $name = null ) {
foreach ( $values as $val ) {
- if( $val instanceof Title ) {
+ if ( $val instanceof Title ) {
$v = array();
ApiQueryBase::addTitleInfo( $v, $val );
- } elseif( $name !== null ) {
+ } elseif ( $name !== null ) {
$v = array( $name => $val );
} else {
$v = $val;
}
- if( $flag !== null ) {
+ if ( $flag !== null ) {
$v[$flag] = '';
}
$result[] = $v;
diff --git a/includes/api/ApiQueryAllMessages.php
b/includes/api/ApiQueryAllMessages.php
index c9811b0..d47c7b7 100644
--- a/includes/api/ApiQueryAllMessages.php
+++ b/includes/api/ApiQueryAllMessages.php
@@ -87,7 +87,7 @@
foreach ( $messages_target as $message ) {
// === 0: must be at beginning of string
(position 0)
if ( strpos( $message, $params['prefix'] ) ===
0 ) {
- if( !$skip ) {
+ if ( !$skip ) {
$skip = true;
}
$messages_filtered[] = $message;
diff --git a/includes/api/ApiQueryAllPages.php
b/includes/api/ApiQueryAllPages.php
index d718b96..0d0c10f 100644
--- a/includes/api/ApiQueryAllPages.php
+++ b/includes/api/ApiQueryAllPages.php
@@ -174,7 +174,7 @@
$res = $this->select( __METHOD__ );
//Get gender information
- if( MWNamespace::hasGenderDistinction( $params['namespace'] ) )
{
+ if ( MWNamespace::hasGenderDistinction( $params['namespace'] )
) {
$users = array();
foreach ( $res as $row ) {
$users[] = $row->page_title;
diff --git a/includes/api/ApiQueryAllUsers.php
b/includes/api/ApiQueryAllUsers.php
index 7283aa0..1948a51 100644
--- a/includes/api/ApiQueryAllUsers.php
+++ b/includes/api/ApiQueryAllUsers.php
@@ -83,12 +83,12 @@
if ( !is_null( $params['rights'] ) && count( $params['rights']
) ) {
$groups = array();
- foreach( $params['rights'] as $r ) {
+ foreach ( $params['rights'] as $r ) {
$groups = array_merge( $groups,
User::getGroupsWithPermission( $r ) );
}
// no group with the given right(s) exists, no need for
a query
- if( !count( $groups ) ) {
+ if ( !count( $groups ) ) {
$this->getResult()->setIndexedTagName_internal(
array( 'query', $this->getModuleName() ), '' );
return;
}
diff --git a/includes/api/ApiQueryBacklinks.php
b/includes/api/ApiQueryBacklinks.php
index 6899808..e39c25a 100644
--- a/includes/api/ApiQueryBacklinks.php
+++ b/includes/api/ApiQueryBacklinks.php
@@ -229,10 +229,10 @@
$orderBy = array();
$sort = ( $this->params['dir'] == 'descending' ? ' DESC' : '' );
// Don't order by namespace/title if it's constant in the WHERE
clause
- if( $this->hasNS && count( array_unique( $allRedirNs ) ) != 1 )
{
+ if ( $this->hasNS && count( array_unique( $allRedirNs ) ) != 1
) {
$orderBy[] = $this->bl_ns . $sort;
}
- if( count( array_unique( $allRedirDBkey ) ) != 1 ) {
+ if ( count( array_unique( $allRedirDBkey ) ) != 1 ) {
$orderBy[] = $this->bl_title . $sort;
}
$orderBy[] = $this->bl_from . $sort;
diff --git a/includes/api/ApiQueryBlocks.php b/includes/api/ApiQueryBlocks.php
index ba90452..fa2a7c4 100644
--- a/includes/api/ApiQueryBlocks.php
+++ b/includes/api/ApiQueryBlocks.php
@@ -94,8 +94,9 @@
list( $ip, $range ) = IP::parseCIDR( $params['ip'] );
if ( $ip && $range ) {
// We got a CIDR range
- if ( $range < 16 )
+ if ( $range < 16 ) {
$this->dieUsage( 'CIDR ranges broader
than /16 are not accepted', 'cidrtoobroad' );
+ }
$lower = wfBaseConvert( $ip, 10, 16, 8, false );
$upper = wfBaseConvert( $ip + pow( 2, 32 -
$range ) - 1, 10, 16, 8, false );
} else {
diff --git a/includes/api/ApiQueryDeletedrevs.php
b/includes/api/ApiQueryDeletedrevs.php
index 31ca1ef..4a53409 100644
--- a/includes/api/ApiQueryDeletedrevs.php
+++ b/includes/api/ApiQueryDeletedrevs.php
@@ -74,13 +74,13 @@
if ( $mode == 'revs' || $mode == 'user' ) {
// Ignore namespace and unique due to inability to know
whether they were purposely set
- foreach( array( 'from', 'to', 'prefix', /*'namespace',
'unique'*/ ) as $p ) {
+ foreach ( array( 'from', 'to', 'prefix', /*'namespace',
'unique'*/ ) as $p ) {
if ( !is_null( $params[$p] ) ) {
$this->dieUsage( "The '{$p}' parameter
cannot be used in modes 1 or 2", 'badparams' );
}
}
} else {
- foreach( array( 'start', 'end' ) as $p ) {
+ foreach ( array( 'start', 'end' ) as $p ) {
if ( !is_null( $params[$p] ) ) {
$this->dieUsage( "The {$p} parameter
cannot be used in mode 3", 'badparams' );
}
diff --git a/includes/api/ApiQueryDuplicateFiles.php
b/includes/api/ApiQueryDuplicateFiles.php
index 7f73631..0311fa7 100644
--- a/includes/api/ApiQueryDuplicateFiles.php
+++ b/includes/api/ApiQueryDuplicateFiles.php
@@ -58,7 +58,7 @@
}
$images = $namespaces[NS_FILE];
- if( $params['dir'] == 'descending' ) {
+ if ( $params['dir'] == 'descending' ) {
$images = array_reverse( $images );
}
@@ -79,7 +79,7 @@
}
$filesToFind = array_keys( $images );
- if( $params['localonly'] ) {
+ if ( $params['localonly'] ) {
$files =
RepoGroup::singleton()->getLocalRepo()->findFiles( $filesToFind );
} else {
$files = RepoGroup::singleton()->findFiles(
$filesToFind );
@@ -97,29 +97,29 @@
// find all files with the hashes, result format is: array(
hash => array( dup1, dup2 ), hash1 => ... )
$filesToFindBySha1s = array_unique( array_values( $sha1s ) );
- if( $params['localonly'] ) {
+ if ( $params['localonly'] ) {
$filesBySha1s =
RepoGroup::singleton()->getLocalRepo()->findBySha1s( $filesToFindBySha1s );
} else {
$filesBySha1s = RepoGroup::singleton()->findBySha1s(
$filesToFindBySha1s );
}
// iterate over $images to handle continue param correct
- foreach( $images as $image => $pageId ) {
- if( !isset( $sha1s[$image] ) ) {
+ foreach ( $images as $image => $pageId ) {
+ if ( !isset( $sha1s[$image] ) ) {
continue; //file does not exist
}
$sha1 = $sha1s[$image];
$dupFiles = $filesBySha1s[$sha1];
- if( $params['dir'] == 'descending' ) {
+ if ( $params['dir'] == 'descending' ) {
$dupFiles = array_reverse( $dupFiles );
}
/** @var $dupFile File */
foreach ( $dupFiles as $dupFile ) {
$dupName = $dupFile->getName();
- if( $image == $dupName && $dupFile->isLocal() )
{
+ if ( $image == $dupName && $dupFile->isLocal()
) {
continue; //ignore the local file itself
}
- if( $skipUntilThisDup !== false && $dupName <
$skipUntilThisDup ) {
+ if ( $skipUntilThisDup !== false && $dupName <
$skipUntilThisDup ) {
continue; //skip to pos after the image
from continue param
}
$skipUntilThisDup = false;
@@ -138,7 +138,7 @@
'user' => $dupFile->getUser(
'text' ),
'timestamp' => wfTimestamp(
TS_ISO_8601, $dupFile->getTimestamp() )
);
- if( !$dupFile->isLocal() ) {
+ if ( !$dupFile->isLocal() ) {
$r['shared'] = '';
}
$fit = $this->addPageSubItem( $pageId,
$r );
@@ -148,7 +148,7 @@
}
}
}
- if( !$fit ) {
+ if ( !$fit ) {
break;
}
}
diff --git a/includes/api/ApiQueryExtLinksUsage.php
b/includes/api/ApiQueryExtLinksUsage.php
index eb9cdf9..124d273 100644
--- a/includes/api/ApiQueryExtLinksUsage.php
+++ b/includes/api/ApiQueryExtLinksUsage.php
@@ -123,7 +123,7 @@
if ( $fld_url ) {
$to = $row->el_to;
// expand protocol-relative urls
- if( $params['expandurl'] ) {
+ if ( $params['expandurl'] ) {
$to = wfExpandUrl( $to,
PROTO_CANONICAL );
}
$vals['url'] = $to;
diff --git a/includes/api/ApiQueryExternalLinks.php
b/includes/api/ApiQueryExternalLinks.php
index 761b49e..56ee268 100644
--- a/includes/api/ApiQueryExternalLinks.php
+++ b/includes/api/ApiQueryExternalLinks.php
@@ -88,7 +88,7 @@
$entry = array();
$to = $row->el_to;
// expand protocol-relative urls
- if( $params['expandurl'] ) {
+ if ( $params['expandurl'] ) {
$to = wfExpandUrl( $to, PROTO_CANONICAL );
}
ApiResult::setContent( $entry, $to );
diff --git a/includes/api/ApiQueryImageInfo.php
b/includes/api/ApiQueryImageInfo.php
index 0869cb9..c36821b 100644
--- a/includes/api/ApiQueryImageInfo.php
+++ b/includes/api/ApiQueryImageInfo.php
@@ -72,7 +72,7 @@
$result = $this->getResult();
//search only inside the local repo
- if( $params['localonly'] ) {
+ if ( $params['localonly'] ) {
$images =
RepoGroup::singleton()->getLocalRepo()->findFiles( $titles );
} else {
$images = RepoGroup::singleton()->findFiles(
$titles );
diff --git a/includes/api/ApiQueryInfo.php b/includes/api/ApiQueryInfo.php
index 37cd915..6dbda5f 100644
--- a/includes/api/ApiQueryInfo.php
+++ b/includes/api/ApiQueryInfo.php
@@ -60,7 +60,7 @@
$pageSet->requestField( 'page_restrictions' );
// when resolving redirects, no page will have this field
- if( !$pageSet->isResolvingRedirects() ) {
+ if ( !$pageSet->isResolvingRedirects() ) {
$pageSet->requestField( 'page_is_redirect' );
}
$pageSet->requestField( 'page_is_new' );
@@ -476,7 +476,7 @@
$this->protections[$title->getNamespace()][$title->getDBkey()][] = $a;
}
// Also check old restrictions
- foreach( $this->titles as $pageId => $title ) {
+ foreach ( $this->titles as $pageId => $title ) {
if ( $this->pageRestrictions[$pageId] ) {
$namespace = $title->getNamespace();
$dbKey = $title->getDBkey();
diff --git a/includes/api/ApiQueryLogEvents.php
b/includes/api/ApiQueryLogEvents.php
index 73dcea4..33b70a4 100644
--- a/includes/api/ApiQueryLogEvents.php
+++ b/includes/api/ApiQueryLogEvents.php
@@ -241,7 +241,7 @@
break;
case 'rights':
$vals2 = array();
- if( $legacy ) {
+ if ( $legacy ) {
list( $vals2['old'], $vals2['new'] ) =
$params;
} else {
$vals2['new'] = implode( ', ',
$params['5::newgroups'] );
diff --git a/includes/api/ApiQueryQueryPage.php
b/includes/api/ApiQueryQueryPage.php
index b03bdfb..9d0fd0a 100644
--- a/includes/api/ApiQueryQueryPage.php
+++ b/includes/api/ApiQueryQueryPage.php
@@ -52,7 +52,7 @@
global $wgQueryPages;
$this->qpMap = array();
foreach ( $wgQueryPages as $page ) {
- if( !in_array( $page[1], $this->uselessQueryPages ) ) {
+ if ( !in_array( $page[1], $this->uselessQueryPages ) ) {
$this->qpMap[$page[1]] = $page[0];
}
}
diff --git a/includes/api/ApiQuerySiteinfo.php
b/includes/api/ApiQuerySiteinfo.php
index f79083e..37b22f1 100644
--- a/includes/api/ApiQuerySiteinfo.php
+++ b/includes/api/ApiQuerySiteinfo.php
@@ -170,15 +170,15 @@
$data['lang'] = $GLOBALS['wgLanguageCode'];
$fallbacks = array();
- foreach( $wgContLang->getFallbackLanguages() as $code ) {
+ foreach ( $wgContLang->getFallbackLanguages() as $code ) {
$fallbacks[] = array( 'code' => $code );
}
$data['fallback'] = $fallbacks;
$this->getResult()->setIndexedTagName( $data['fallback'],
'lang' );
- if( $wgContLang->hasVariants() ) {
+ if ( $wgContLang->hasVariants() ) {
$variants = array();
- foreach( $wgContLang->getVariants() as $code ) {
+ foreach ( $wgContLang->getVariants() as $code ) {
$variants[] = array( 'code' => $code );
}
$data['variants'] = $variants;
@@ -345,10 +345,10 @@
$val['language'] = $langNames[$prefix];
}
$val['url'] = wfExpandUrl( $row['iw_url'],
PROTO_CURRENT );
- if( isset( $row['iw_wikiid'] ) ) {
+ if ( isset( $row['iw_wikiid'] ) ) {
$val['wikiid'] = $row['iw_wikiid'];
}
- if( isset( $row['iw_api'] ) ) {
+ if ( isset( $row['iw_api'] ) ) {
$val['api'] = $row['iw_api'];
}
@@ -520,7 +520,7 @@
$data = array(
'url' => $url ? $url : '',
- 'text' => $text ? $text : ''
+ 'text' => $text ? $text : ''
);
return $this->getResult()->addValue( 'query', $property, $data
);
diff --git a/includes/api/ApiQueryUserContributions.php
b/includes/api/ApiQueryUserContributions.php
index 597c412..6d20d66 100644
--- a/includes/api/ApiQueryUserContributions.php
+++ b/includes/api/ApiQueryUserContributions.php
@@ -83,10 +83,10 @@
// Do the actual query.
$res = $this->select( __METHOD__ );
- if( $this->fld_sizediff ) {
+ if ( $this->fld_sizediff ) {
$revIds = array();
foreach ( $res as $row ) {
- if( $row->rev_parent_id ) {
+ if ( $row->rev_parent_id ) {
$revIds[] = $row->rev_parent_id;
}
}
diff --git a/includes/api/ApiQueryUserInfo.php
b/includes/api/ApiQueryUserInfo.php
index 1a491ec..8e65b40 100644
--- a/includes/api/ApiQueryUserInfo.php
+++ b/includes/api/ApiQueryUserInfo.php
@@ -167,8 +167,9 @@
if ( $user->isNewbie() ) {
$categories[] = 'ip';
$categories[] = 'subnet';
- if ( !$user->isAnon() )
+ if ( !$user->isAnon() ) {
$categories[] = 'newbie';
+ }
}
$categories = array_merge( $categories, $user->getGroups() );
diff --git a/includes/api/ApiQueryUsers.php b/includes/api/ApiQueryUsers.php
index 72ab786..0a0aaee 100644
--- a/includes/api/ApiQueryUsers.php
+++ b/includes/api/ApiQueryUsers.php
@@ -127,7 +127,7 @@
$this->addFields( array( 'user_name',
'ug_group' ) );
$userGroupsRes = $this->select( __METHOD__ );
- foreach( $userGroupsRes as $row ) {
+ foreach ( $userGroupsRes as $row ) {
$userGroups[$row->user_name][] =
$row->ug_group;
}
}
diff --git a/includes/api/ApiUpload.php b/includes/api/ApiUpload.php
index 9d30729..a8d7115 100644
--- a/includes/api/ApiUpload.php
+++ b/includes/api/ApiUpload.php
@@ -56,7 +56,7 @@
$this->mParams['chunk'] = $request->getFileName( 'chunk' );
// Copy the session key to the file key, for backward
compatibility.
- if( !$this->mParams['filekey'] && $this->mParams['sessionkey']
) {
+ if ( !$this->mParams['filekey'] && $this->mParams['sessionkey']
) {
$this->mParams['filekey'] =
$this->mParams['sessionkey'];
}
@@ -82,7 +82,7 @@
// Check if the uploaded file is sane
if ( $this->mParams['chunk'] ) {
$maxSize = $this->mUpload->getMaxUploadSize();
- if( $this->mParams['filesize'] > $maxSize ) {
+ if ( $this->mParams['filesize'] > $maxSize ) {
$this->dieUsage( 'The file you submitted was
too large', 'file-too-large' );
}
if ( !$this->mUpload->getTitle() ) {
@@ -354,7 +354,7 @@
if ( $this->mParams['chunk'] ) {
// Chunk upload
$this->mUpload = new UploadFromChunks();
- if( isset( $this->mParams['filekey'] ) ) {
+ if ( isset( $this->mParams['filekey'] ) ) {
// handle new chunk
$this->mUpload->continueChunks(
$this->mParams['filename'],
--
To view, visit https://gerrit.wikimedia.org/r/60028
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Id7779dca4d1185245cf5764102b8de8b232c34b6
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Umherirrender <[email protected]>
Gerrit-Reviewer: Anomie <[email protected]>
Gerrit-Reviewer: IAlex <[email protected]>
Gerrit-Reviewer: Siebrand <[email protected]>
Gerrit-Reviewer: jenkins-bot
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits