Siebrand has uploaded a new change for review.
https://gerrit.wikimedia.org/r/95372
Change subject: Update formatting
......................................................................
Update formatting
Change-Id: I12fdb71bc87a8ad5ed5b9f1fe9c06bd0f7154e9a
---
M includes/api/ApiResult.php
M includes/api/ApiRsd.php
M includes/api/ApiSetNotificationTimestamp.php
M includes/api/ApiTokens.php
M includes/api/ApiUnblock.php
M includes/api/ApiUpload.php
M includes/api/ApiUserrights.php
7 files changed, 27 insertions(+), 7 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core
refs/changes/72/95372/1
diff --git a/includes/api/ApiResult.php b/includes/api/ApiResult.php
index 39c114b..68137ff 100644
--- a/includes/api/ApiResult.php
+++ b/includes/api/ApiResult.php
@@ -117,6 +117,7 @@
// Objects can't always be cast to string
$s = strlen( $value );
}
+
return $s;
}
@@ -287,7 +288,8 @@
if ( $newsize > $wgAPIMaxResultSize ) {
$this->setWarning(
"This result was truncated because it
would otherwise be larger than the " .
- "limit of
{$wgAPIMaxResultSize} bytes" );
+ "limit of {$wgAPIMaxResultSize}
bytes" );
+
return false;
}
$this->mSize = $newsize;
@@ -322,6 +324,7 @@
// Add named element
self::setElement( $data, $name, $value, $flags );
}
+
return true;
}
@@ -394,6 +397,7 @@
$result[] = $error;
}
$this->setIndexedTagName( $result, $errorType );
+
return $result;
}
diff --git a/includes/api/ApiRsd.php b/includes/api/ApiRsd.php
index d219c91..e01f0fa 100644
--- a/includes/api/ApiRsd.php
+++ b/includes/api/ApiRsd.php
@@ -107,6 +107,7 @@
),
);
wfRunHooks( 'ApiRsdServiceApis', array( &$apis ) );
+
return $apis;
}
@@ -149,6 +150,7 @@
}
$outputData[] = $data;
}
+
return $outputData;
}
}
diff --git a/includes/api/ApiSetNotificationTimestamp.php
b/includes/api/ApiSetNotificationTimestamp.php
index 53a68fd..5302896 100644
--- a/includes/api/ApiSetNotificationTimestamp.php
+++ b/includes/api/ApiSetNotificationTimestamp.php
@@ -172,6 +172,7 @@
if ( !isset( $this->mPageSet ) ) {
$this->mPageSet = new ApiPageSet( $this );
}
+
return $this->mPageSet;
}
@@ -210,8 +211,8 @@
if ( $flags ) {
$result += $this->getPageSet()->getFinalParams( $flags
);
}
- return $result;
+ return $result;
}
public function getParamDescription() {
@@ -271,6 +272,7 @@
public function getPossibleErrors() {
$ps = $this->getPageSet();
+
return array_merge(
parent::getPossibleErrors(),
$ps->getFinalPossibleErrors(),
diff --git a/includes/api/ApiTokens.php b/includes/api/ApiTokens.php
index d220a5e..6862668 100644
--- a/includes/api/ApiTokens.php
+++ b/includes/api/ApiTokens.php
@@ -67,6 +67,7 @@
wfRunHooks( 'ApiTokensGetTokenTypes', array( &$types ) );
ksort( $types );
wfProfileOut( __METHOD__ );
+
return $types;
}
diff --git a/includes/api/ApiUnblock.php b/includes/api/ApiUnblock.php
index 6a739a2..78137a8 100644
--- a/includes/api/ApiUnblock.php
+++ b/includes/api/ApiUnblock.php
@@ -96,6 +96,7 @@
public function getParamDescription() {
$p = $this->getModulePrefix();
+
return array(
'id' => "ID of the block you want to unblock (obtained
through list=blocks). Cannot be used together with {$p}user",
'user' => "Username, IP address or IP range you want to
unblock. Cannot be used together with {$p}id",
diff --git a/includes/api/ApiUpload.php b/includes/api/ApiUpload.php
index 5839edc..6d5861d 100644
--- a/includes/api/ApiUpload.php
+++ b/includes/api/ApiUpload.php
@@ -141,6 +141,7 @@
// Stash the file and get stash result
return $this->getStashResult( $warnings );
}
+
// This is the most common case -- a normal upload with no
warnings
// performUpload will return a formatted properly for the API
with status
return $this->performUpload( $warnings );
@@ -165,6 +166,7 @@
} catch ( MWException $e ) {
$this->dieUsage( $e->getMessage(), 'stashfailed' );
}
+
return $result;
}
@@ -185,6 +187,7 @@
} catch ( MWException $e ) {
$result['warnings']['stashfailed'] = $e->getMessage();
}
+
return $result;
}
@@ -217,6 +220,7 @@
$chunkPath, $chunkSize,
$this->mParams['offset'] );
if ( !$status->isGood() ) {
$this->dieUsage( $status->getWikiText(),
'stashfailed' );
+
return array();
}
}
@@ -252,6 +256,7 @@
$status = $this->mUpload->concatenateChunks();
if ( !$status->isGood() ) {
$this->dieUsage(
$status->getWikiText(), 'stashfailed' );
+
return array();
}
@@ -265,6 +270,7 @@
}
$result['filekey'] = $filekey;
$result['offset'] = $this->mParams['offset'] + $chunkSize;
+
return $result;
}
@@ -287,6 +293,7 @@
wfDebug( __METHOD__ . ' ' . $message . "\n" );
throw new MWException( $message );
}
+
return $fileKey;
}
@@ -341,6 +348,7 @@
}
unset( $progress['status'] ); // remove Status object
$this->getResult()->addValue( null,
$this->getModuleName(), $progress );
+
return false;
}
@@ -357,6 +365,7 @@
$sessionData['sessionkey'] =
$this->mParams['statuskey'];
}
$this->getResult()->addValue( null,
$this->getModuleName(), $sessionData );
+
return false;
}
@@ -481,7 +490,7 @@
break;
case UploadBase::ILLEGAL_FILENAME:
$this->dieRecoverableError( 'illegal-filename',
'filename',
- array( 'filename' =>
$verification['filtered'] ) );
+ array( 'filename' =>
$verification['filtered'] ) );
break;
case UploadBase::FILENAME_TOO_LONG:
$this->dieRecoverableError( 'filename-toolong',
'filename' );
@@ -521,15 +530,15 @@
case UploadBase::VERIFICATION_ERROR:
$this->getResult()->setIndexedTagName(
$verification['details'], 'detail' );
$this->dieUsage( 'This file did not pass file
verification', 'verification-error',
- 0, array( 'details' =>
$verification['details'] ) );
+ 0, array( 'details' =>
$verification['details'] ) );
break;
case UploadBase::HOOK_ABORTED:
$this->dieUsage( "The modification you tried to
make was aborted by an extension hook",
- 'hookaborted', 0, array(
'error' => $verification['error'] ) );
+ 'hookaborted', 0, array( 'error' =>
$verification['error'] ) );
break;
default:
$this->dieUsage( 'An unknown error occurred',
'unknown-error',
- 0, array( 'code' =>
$verification['status'] ) );
+ 0, array( 'code' =>
$verification['status'] ) );
break;
}
}
@@ -569,6 +578,7 @@
$warnings[$warning['warning']] =
$localFile->getName();
}
}
+
return $warnings;
}
@@ -764,7 +774,6 @@
);
return $params;
-
}
public function getResultProperties() {
diff --git a/includes/api/ApiUserrights.php b/includes/api/ApiUserrights.php
index 7d30828..5e068cb 100644
--- a/includes/api/ApiUserrights.php
+++ b/includes/api/ApiUserrights.php
@@ -72,6 +72,7 @@
}
$this->mUser = $user;
+
return $user;
}
--
To view, visit https://gerrit.wikimedia.org/r/95372
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I12fdb71bc87a8ad5ed5b9f1fe9c06bd0f7154e9a
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Siebrand <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits