aboutsummaryrefslogtreecommitdiffstats
path: root/includes/api
diff options
context:
space:
mode:
authorSam Reed <reedy@users.mediawiki.org>2010-04-17 20:58:04 +0000
committerSam Reed <reedy@users.mediawiki.org>2010-04-17 20:58:04 +0000
commit0769301e8706f9f44e8efc6c686c425562b3f3fc (patch)
tree439cd68a31aeb03d49c60a9abc050009ebaa55ab /includes/api
parente3be0de215957b9e14c164f6ac94b657cd7b4c46 (diff)
downloadmediawikicore-0769301e8706f9f44e8efc6c686c425562b3f3fc.tar.gz
mediawikicore-0769301e8706f9f44e8efc6c686c425562b3f3fc.zip
Stylize Api upto date
Notes
Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/65183
Diffstat (limited to 'includes/api')
-rw-r--r--includes/api/ApiBase.php12
-rw-r--r--includes/api/ApiEmailUser.php6
-rw-r--r--includes/api/ApiFormatYaml_spyc.php2
-rw-r--r--includes/api/ApiMain.php14
-rw-r--r--includes/api/ApiPageSet.php2
-rw-r--r--includes/api/ApiParse.php6
-rw-r--r--includes/api/ApiQueryAllmessages.php4
-rw-r--r--includes/api/ApiQueryBacklinks.php2
-rw-r--r--includes/api/ApiQueryImageInfo.php4
-rw-r--r--includes/api/ApiRollback.php2
-rw-r--r--includes/api/ApiUpload.php2
11 files changed, 28 insertions, 28 deletions
diff --git a/includes/api/ApiBase.php b/includes/api/ApiBase.php
index f195abd9985d..d4587d735415 100644
--- a/includes/api/ApiBase.php
+++ b/includes/api/ApiBase.php
@@ -475,7 +475,7 @@ abstract class ApiBase {
$params = $this->getFinalParams();
$results = array();
- if( $params ) { // getFinalParams() can return false
+ if ( $params ) { // getFinalParams() can return false
foreach ( $params as $paramName => $paramSettings ) {
$results[$paramName] = $this->getParameterFromSettings( $paramName, $paramSettings, $parseLimit );
}
@@ -559,7 +559,7 @@ abstract class ApiBase {
}
# If no user option was passed, use watchdefault or watchcreation
if ( is_null( $userOption ) ) {
- $userOption = $titleObj->exists()
+ $userOption = $titleObj->exists()
? 'watchdefault' : 'watchcreations';
}
# If the corresponding user option is true, watch, else no change
@@ -581,7 +581,7 @@ abstract class ApiBase {
*/
protected function setWatch ( $watch, $titleObj, $userOption = null ) {
$value = $this->getWatchlistValue( $watch, $titleObj, $userOption );
- if( $value === null ) {
+ if ( $value === null ) {
return;
}
@@ -705,9 +705,9 @@ abstract class ApiBase {
$value = wfTimestamp( TS_MW, $value );
break;
case 'user':
- if( !is_array( $value ) ) $value = array( $value );
+ if ( !is_array( $value ) ) $value = array( $value );
- foreach( $value as $key => $val ) {
+ foreach ( $value as $key => $val ) {
$title = Title::makeTitleSafe( NS_USER, $val );
if ( is_null( $title ) ) {
$this->dieUsage( "Invalid value for user parameter $encParamName", "baduser_{$encParamName}" );
@@ -715,7 +715,7 @@ abstract class ApiBase {
$value[$key] = $title->getText();
}
- if( !$multi ) $value = $value[0];
+ if ( !$multi ) $value = $value[0];
break;
default:
diff --git a/includes/api/ApiEmailUser.php b/includes/api/ApiEmailUser.php
index 64a2c3556c25..c1e5834c9393 100644
--- a/includes/api/ApiEmailUser.php
+++ b/includes/api/ApiEmailUser.php
@@ -61,9 +61,9 @@ class ApiEmailUser extends ApiBase {
}
$data = array(
- 'Target' => $targetUser->getName(),
- 'Text' => $params['text'],
- 'Subject' => $params['subject'],
+ 'Target' => $targetUser->getName(),
+ 'Text' => $params['text'],
+ 'Subject' => $params['subject'],
'CCMe' => $params['ccme'],
);
$retval = SpecialEmailuser::submit( $data );
diff --git a/includes/api/ApiFormatYaml_spyc.php b/includes/api/ApiFormatYaml_spyc.php
index 30f860dd4a03..1fe6a2adf3e3 100644
--- a/includes/api/ApiFormatYaml_spyc.php
+++ b/includes/api/ApiFormatYaml_spyc.php
@@ -185,7 +185,7 @@ class Spyc {
else
$string = $spaces . "-\n";
} else {
- if ($key == '*') //bug 21922 - Quote asterix used as keys
+ if ( $key == '*' ) // bug 21922 - Quote asterix used as keys
$key = "'*'";
// It's mapped
diff --git a/includes/api/ApiMain.php b/includes/api/ApiMain.php
index 419c22065da7..edfd2d36b69e 100644
--- a/includes/api/ApiMain.php
+++ b/includes/api/ApiMain.php
@@ -168,7 +168,7 @@ class ApiMain extends ApiBase {
$this->mRequest = &$request;
- $this->mSquidMaxage = -1; // flag for executeActionWithErrorHandling()
+ $this->mSquidMaxage = - 1; // flag for executeActionWithErrorHandling()
$this->mCommit = false;
}
@@ -451,7 +451,7 @@ class ApiMain extends ApiBase {
* @param $params Array an array containing the request parameters.
* @return boolean True on success, false should exit immediately
*/
- protected function checkMaxLag($module, $params) {
+ protected function checkMaxLag( $module, $params ) {
if ( $module->shouldCheckMaxlag() && isset( $params['maxlag'] ) ) {
// Check for maxlag
global $wgShowHostnames;
@@ -476,7 +476,7 @@ class ApiMain extends ApiBase {
* Check for sufficient permissions to execute
* @param $module object An Api module
*/
- protected function checkExecutePermissions($module) {
+ protected function checkExecutePermissions( $module ) {
global $wgUser, $wgGroupPermissions;
if ( $module->isReadMode() && !$wgGroupPermissions['*']['read'] && !$wgUser->isAllowed( 'read' ) )
{
@@ -500,7 +500,7 @@ class ApiMain extends ApiBase {
* @param $module object An Api module
* @param $params Array an array with the request parameters
*/
- protected function setupExternalResponse($module, $params) {
+ protected function setupExternalResponse( $module, $params ) {
// Ignore mustBePosted() for internal calls
if ( $module->mustBePosted() && !$this->mRequest->wasPosted() ) {
$this->dieUsageMsg( array( 'mustbeposted', $this->mAction ) );
@@ -525,12 +525,12 @@ class ApiMain extends ApiBase {
$params = $this->setupExecuteAction();
$module = $this->setupModule();
- $this->checkExecutePermissions($module);
+ $this->checkExecutePermissions( $module );
- if(!$this->checkMaxLag($module, $params)) return;
+ if ( !$this->checkMaxLag( $module, $params ) ) return;
if ( !$this->mInternalMode ) {
- $this->setupExternalResponse($module, $params);
+ $this->setupExternalResponse( $module, $params );
}
// Execute
diff --git a/includes/api/ApiPageSet.php b/includes/api/ApiPageSet.php
index fee47502dbec..7010d8fed50f 100644
--- a/includes/api/ApiPageSet.php
+++ b/includes/api/ApiPageSet.php
@@ -79,7 +79,7 @@ class ApiPageSet extends ApiQueryBase {
$this->mPendingRedirectIDs = array();
}
- $this->mFakePageId = -1;
+ $this->mFakePageId = - 1;
}
/**
diff --git a/includes/api/ApiParse.php b/includes/api/ApiParse.php
index ab1d627af229..5618f972106b 100644
--- a/includes/api/ApiParse.php
+++ b/includes/api/ApiParse.php
@@ -54,10 +54,10 @@ class ApiParse extends ApiBase {
// $title parameter in Parser::parse isn't enough *sigh*
global $wgParser, $wgUser, $wgTitle, $wgEnableParserCache, $wgLang;
- //Current unncessary, code to act as a safeguard against any change in current behaviour of uselang breaks
+ // Current unncessary, code to act as a safeguard against any change in current behaviour of uselang breaks
$oldLang = null;
if ( isset( $params['uselang'] ) && $params['uselang'] != $wgLang->getCode() ) {
- $oldLang = $wgLang; //Backup wgLang
+ $oldLang = $wgLang; // Backup wgLang
$wgLang = Language::factory( $params['uselang'] );
}
@@ -214,7 +214,7 @@ class ApiParse extends ApiBase {
$result->addValue( null, $this->getModuleName(), $result_array );
if ( !is_null( $oldLang ) ) {
- $wgLang = $oldLang; //Reset $wgLang to $oldLang
+ $wgLang = $oldLang; // Reset $wgLang to $oldLang
}
}
diff --git a/includes/api/ApiQueryAllmessages.php b/includes/api/ApiQueryAllmessages.php
index a8151697f0d8..82d4f10b8fd7 100644
--- a/includes/api/ApiQueryAllmessages.php
+++ b/includes/api/ApiQueryAllmessages.php
@@ -46,7 +46,7 @@ class ApiQueryAllmessages extends ApiQueryBase {
$oldLang = null;
if ( !is_null( $params['lang'] ) && $params['lang'] != $wgLang->getCode() ) {
- $oldLang = $wgLang; //Keep $wgLang for restore later
+ $oldLang = $wgLang; // Keep $wgLang for restore later
$wgLang = Language::factory( $params['lang'] );
}
@@ -125,7 +125,7 @@ class ApiQueryAllmessages extends ApiQueryBase {
$result->setIndexedTagName_internal( array( 'query', $this->getModuleName() ), 'message' );
if ( !is_null( $oldLang ) ) {
- $wgLang = $oldLang; //Restore $oldLang
+ $wgLang = $oldLang; // Restore $oldLang
}
}
diff --git a/includes/api/ApiQueryBacklinks.php b/includes/api/ApiQueryBacklinks.php
index b4a3b1bc0553..a90969d783b4 100644
--- a/includes/api/ApiQueryBacklinks.php
+++ b/includes/api/ApiQueryBacklinks.php
@@ -246,7 +246,7 @@ class ApiQueryBacklinks extends ApiQueryGeneratorBase {
if ( $this->hasNS ) {
$parentID = $this->pageMap[$row-> { $this->bl_ns } ][$row-> { $this->bl_title } ];
} else {
- $parentID = $this->pageMap[NS_IMAGE][$row->{$this->bl_title}];
+ $parentID = $this->pageMap[NS_IMAGE][$row-> { $this->bl_title } ];
}
$this->continueStr = $this->getContinueRedirStr( $parentID, $row->page_id );
break;
diff --git a/includes/api/ApiQueryImageInfo.php b/includes/api/ApiQueryImageInfo.php
index 5f0d2bd6096c..84e3616700a1 100644
--- a/includes/api/ApiQueryImageInfo.php
+++ b/includes/api/ApiQueryImageInfo.php
@@ -288,11 +288,11 @@ class ApiQueryImageInfo extends ApiQueryBase {
),
'urlwidth' => array(
ApiBase::PARAM_TYPE => 'integer',
- ApiBase::PARAM_DFLT => -1
+ ApiBase::PARAM_DFLT => - 1
),
'urlheight' => array(
ApiBase::PARAM_TYPE => 'integer',
- ApiBase::PARAM_DFLT => -1
+ ApiBase::PARAM_DFLT => - 1
),
'continue' => null,
);
diff --git a/includes/api/ApiRollback.php b/includes/api/ApiRollback.php
index 27ce389a4dfe..2301e3adfe35 100644
--- a/includes/api/ApiRollback.php
+++ b/includes/api/ApiRollback.php
@@ -155,7 +155,7 @@ class ApiRollback extends ApiBase {
$params = $this->extractRequestParams();
if ( !isset( $params['title'] ) ) {
- $this->dieUsageMsg( array( 'missingparam', 'title' ) );
+ $this->dieUsageMsg( array( 'missingparam', 'title' ) );
}
$this->mTitleObj = Title::newFromText( $params['title'] );
diff --git a/includes/api/ApiUpload.php b/includes/api/ApiUpload.php
index 054b79b71467..6d02fa35442e 100644
--- a/includes/api/ApiUpload.php
+++ b/includes/api/ApiUpload.php
@@ -241,7 +241,7 @@ class ApiUpload extends ApiBase {
$this->verifyUpload();
$warnings = $this->checkForWarnings();
- if( isset($warnings) ) return $warnings;
+ if ( isset( $warnings ) ) return $warnings;
// Use comment as initial page text by default
if ( is_null( $this->mParams['text'] ) ) {