Siebrand has uploaded a new change for review.
https://gerrit.wikimedia.org/r/95370
Change subject: Update formatting
......................................................................
Update formatting
Change-Id: I8c3a5b4396a1c3bba22f676137f640c6aa3c8960
---
M includes/api/ApiQueryLangBacklinks.php
M includes/api/ApiQueryLangLinks.php
M includes/api/ApiQueryLinks.php
M includes/api/ApiQueryLogEvents.php
M includes/api/ApiQueryORM.php
M includes/api/ApiQueryPageProps.php
M includes/api/ApiQueryProtectedTitles.php
M includes/api/ApiQueryQueryPage.php
M includes/api/ApiQueryRandom.php
M includes/api/ApiQueryRecentChanges.php
10 files changed, 38 insertions(+), 24 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core
refs/changes/70/95370/1
diff --git a/includes/api/ApiQueryLangBacklinks.php
b/includes/api/ApiQueryLangBacklinks.php
index 5bd451b..652fa11 100644
--- a/includes/api/ApiQueryLangBacklinks.php
+++ b/includes/api/ApiQueryLangBacklinks.php
@@ -92,14 +92,14 @@
$this->addOption( 'ORDER BY', array(
'll_title' . $sort,
'll_from' . $sort
- ));
+ ) );
}
} else {
$this->addOption( 'ORDER BY', array(
'll_lang' . $sort,
'll_title' . $sort,
'll_from' . $sort
- ));
+ ) );
}
$this->addOption( 'LIMIT', $params['limit'] + 1 );
@@ -111,7 +111,7 @@
$count = 0;
$result = $this->getResult();
foreach ( $res as $row ) {
- if ( ++ $count > $params['limit'] ) {
+ if ( ++$count > $params['limit'] ) {
// We've reached the one extra which shows that
there are additional pages to be had. Stop here...
// Continue string preserved in case the
redirect query doesn't pass the limit
$this->setContinueEnumParameter( 'continue',
"{$row->ll_lang}|{$row->ll_title}|{$row->ll_from}" );
diff --git a/includes/api/ApiQueryLangLinks.php
b/includes/api/ApiQueryLangLinks.php
index aa796e3..926a1b6 100644
--- a/includes/api/ApiQueryLangLinks.php
+++ b/includes/api/ApiQueryLangLinks.php
@@ -86,9 +86,9 @@
$this->addOption( 'ORDER BY', 'll_lang' . $sort
);
} else {
$this->addOption( 'ORDER BY', array(
- 'll_from' . $sort,
- 'll_lang' . $sort
- ));
+ 'll_from' . $sort,
+ 'll_lang' . $sort
+ ) );
}
}
diff --git a/includes/api/ApiQueryLinks.php b/includes/api/ApiQueryLinks.php
index 937f4f1..c3a130b 100644
--- a/includes/api/ApiQueryLinks.php
+++ b/includes/api/ApiQueryLinks.php
@@ -212,6 +212,7 @@
public function getParamDescription() {
$desc = $this->description;
+
return array(
'namespace' => "Show {$desc}s in this namespace(s)
only",
'limit' => "How many {$desc}s to return",
@@ -237,6 +238,7 @@
public function getExamples() {
$desc = $this->description;
$name = $this->getModuleName();
+
return array(
"api.php?action=query&prop={$name}&titles=Main%20Page"
=> "Get {$desc}s from the [[Main Page]]",
"api.php?action=query&generator={$name}&titles=Main%20Page&prop=info" => "Get
information about the {$desc} pages in the [[Main Page]]",
diff --git a/includes/api/ApiQueryLogEvents.php
b/includes/api/ApiQueryLogEvents.php
index 1a2719e..d177279 100644
--- a/includes/api/ApiQueryLogEvents.php
+++ b/includes/api/ApiQueryLogEvents.php
@@ -168,7 +168,7 @@
$res = $this->select( __METHOD__ );
$result = $this->getResult();
foreach ( $res as $row ) {
- if ( ++ $count > $limit ) {
+ if ( ++$count > $limit ) {
// We've reached the one extra which shows that
there are additional pages to be had. Stop here...
$this->setContinueEnumParameter( 'start',
wfTimestamp( TS_ISO_8601, $row->log_timestamp ) );
break;
@@ -285,6 +285,7 @@
$result->setIndexedTagName_recursive( $logParams,
'param' );
$vals = array_merge( $vals, $logParams );
}
+
return $vals;
}
@@ -392,6 +393,7 @@
public function getAllowedParams() {
global $wgLogTypes, $wgLogActions, $wgLogActionsHandlers;
+
return array(
'prop' => array(
ApiBase::PARAM_ISMULTI => true,
@@ -444,6 +446,7 @@
public function getParamDescription() {
$p = $this->getModulePrefix();
+
return array(
'prop' => array(
'Which properties to get',
@@ -473,6 +476,7 @@
public function getResultProperties() {
global $wgLogTypes;
+
return array(
'ids' => array(
'logid' => 'integer',
diff --git a/includes/api/ApiQueryORM.php b/includes/api/ApiQueryORM.php
index a23ff06..469b297 100644
--- a/includes/api/ApiQueryORM.php
+++ b/includes/api/ApiQueryORM.php
@@ -104,7 +104,7 @@
protected function getParams() {
return array_filter(
$this->extractRequestParams(),
- function( $prop ) {
+ function ( $prop ) {
return isset( $prop );
}
);
@@ -260,5 +260,4 @@
return array_merge( $this->getTable()->getFieldDescriptions(),
$descriptions );
}
-
}
diff --git a/includes/api/ApiQueryPageProps.php
b/includes/api/ApiQueryPageProps.php
index 2de5710..91a8090 100644
--- a/includes/api/ApiQueryPageProps.php
+++ b/includes/api/ApiQueryPageProps.php
@@ -115,6 +115,7 @@
if ( !$fit ) {
$this->setContinueEnumParameter( 'continue', $page );
}
+
return $fit;
}
diff --git a/includes/api/ApiQueryProtectedTitles.php
b/includes/api/ApiQueryProtectedTitles.php
index 222ad07..4273c0d 100644
--- a/includes/api/ApiQueryProtectedTitles.php
+++ b/includes/api/ApiQueryProtectedTitles.php
@@ -80,7 +80,7 @@
$titles = array();
foreach ( $res as $row ) {
- if ( ++ $count > $params['limit'] ) {
+ if ( ++$count > $params['limit'] ) {
// We've reached the one extra which shows that
there are additional pages to be had. Stop here...
$this->setContinueEnumParameter( 'start',
wfTimestamp( TS_ISO_8601, $row->pt_timestamp ) );
break;
@@ -148,6 +148,7 @@
public function getAllowedParams() {
global $wgRestrictionLevels;
+
return array(
'namespace' => array(
ApiBase::PARAM_ISMULTI => true,
@@ -216,6 +217,7 @@
public function getResultProperties() {
global $wgRestrictionLevels;
+
return array(
'' => array(
'ns' => 'namespace',
diff --git a/includes/api/ApiQueryQueryPage.php
b/includes/api/ApiQueryQueryPage.php
index 79fe049..a6e455f 100644
--- a/includes/api/ApiQueryQueryPage.php
+++ b/includes/api/ApiQueryQueryPage.php
@@ -138,6 +138,7 @@
if ( $qp->getRestriction() != '' ) {
return 'private';
}
+
return 'public';
}
diff --git a/includes/api/ApiQueryRandom.php b/includes/api/ApiQueryRandom.php
index fae3377..b1f5ab9 100644
--- a/includes/api/ApiQueryRandom.php
+++ b/includes/api/ApiQueryRandom.php
@@ -83,8 +83,8 @@
// Prevent duplicates
if ( !in_array( $row->page_id, $this->pageIDs )
) {
$fit = $this->getResult()->addValue(
- array( 'query',
$this->getModuleName() ),
- null,
$this->extractRowInfo( $row ) );
+ array( 'query',
$this->getModuleName() ),
+ null, $this->extractRowInfo(
$row ) );
if ( !$fit ) {
// We can't really
query-continue a random list.
// Return an insanely high
value so
@@ -131,6 +131,7 @@
$vals = array();
$vals['id'] = intval( $row->page_id );
ApiQueryBase::addTitleInfo( $vals, $title );
+
return $vals;
}
diff --git a/includes/api/ApiQueryRecentChanges.php
b/includes/api/ApiQueryRecentChanges.php
index 8d969fc..9abe76b 100644
--- a/includes/api/ApiQueryRecentChanges.php
+++ b/includes/api/ApiQueryRecentChanges.php
@@ -37,9 +37,9 @@
}
private $fld_comment = false, $fld_parsedcomment = false, $fld_user =
false, $fld_userid = false,
- $fld_flags = false, $fld_timestamp = false, $fld_title
= false, $fld_ids = false,
- $fld_sizes = false, $fld_redirect = false,
$fld_patrolled = false, $fld_loginfo = false,
- $fld_tags = false, $fld_sha1 = false, $token = array();
+ $fld_flags = false, $fld_timestamp = false, $fld_title = false,
$fld_ids = false,
+ $fld_sizes = false, $fld_redirect = false, $fld_patrolled =
false, $fld_loginfo = false,
+ $fld_tags = false, $fld_sha1 = false, $token = array();
private $tokenFunctions;
@@ -64,6 +64,7 @@
'patrol' => array( 'ApiQueryRecentChanges',
'getPatrolToken' )
);
wfRunHooks( 'APIQueryRecentChangesTokens', array(
&$this->tokenFunctions ) );
+
return $this->tokenFunctions;
}
@@ -80,8 +81,8 @@
if ( $rc ) {
if ( ( $wgUser->useRCPatrol() && $rc->getAttribute(
'rc_type' ) == RC_EDIT ) ||
- ( $wgUser->useNPPatrol() && $rc->getAttribute(
'rc_type' ) == RC_NEW ) )
- {
+ ( $wgUser->useNPPatrol() && $rc->getAttribute(
'rc_type' ) == RC_NEW )
+ ) {
$validTokenUser = true;
}
} else {
@@ -96,11 +97,11 @@
if ( is_null( $cachedPatrolToken ) ) {
$cachedPatrolToken = $wgUser->getEditToken(
'patrol' );
}
+
return $cachedPatrolToken;
} else {
return false;
}
-
}
/**
@@ -155,7 +156,7 @@
$cont = explode( '|', $params['continue'] );
if ( count( $cont ) != 2 ) {
$this->dieUsage( 'Invalid continue param. You
should pass the ' .
- 'original value
returned by the previous query', '_badcontinue' );
+ 'original value returned by the
previous query', '_badcontinue' );
}
$timestamp = $this->getDB()->addQuotes( wfTimestamp(
TS_MW, $cont[0] ) );
@@ -187,10 +188,10 @@
/* Check for conflicting parameters. */
if ( ( isset( $show['minor'] ) && isset(
$show['!minor'] ) )
- || ( isset( $show['bot'] ) && isset(
$show['!bot'] ) )
- || ( isset( $show['anon'] ) && isset(
$show['!anon'] ) )
- || ( isset( $show['redirect'] ) &&
isset( $show['!redirect'] ) )
- || ( isset( $show['patrolled'] ) &&
isset( $show['!patrolled'] ) )
+ || ( isset( $show['bot'] ) && isset(
$show['!bot'] ) )
+ || ( isset( $show['anon'] ) && isset(
$show['!anon'] ) )
+ || ( isset( $show['redirect'] ) && isset(
$show['!redirect'] ) )
+ || ( isset( $show['patrolled'] ) && isset(
$show['!patrolled'] ) )
) {
$this->dieUsageMsg( 'show' );
}
@@ -311,7 +312,7 @@
/* Iterate through the rows, adding data extracted from them to
our query result. */
foreach ( $res as $row ) {
- if ( ++ $count > $params['limit'] ) {
+ if ( ++$count > $params['limit'] ) {
// We've reached the one extra which shows that
there are additional pages to be had. Stop here...
$this->setContinueEnumParameter( 'continue',
wfTimestamp( TS_ISO_8601, $row->rc_timestamp ) . '|' . $row->rc_id );
break;
@@ -520,6 +521,7 @@
foreach ( $type as $t ) {
$retval[] = $this->parseRCType( $t );
}
+
return $retval;
}
switch ( $type ) {
@@ -549,6 +551,7 @@
// formatComment() calls wfMessage() among other things
return 'anon-public-user-private';
}
+
return 'public';
}
@@ -640,6 +643,7 @@
public function getParamDescription() {
$p = $this->getModulePrefix();
+
return array(
'start' => 'The timestamp to start enumerating from',
'end' => 'The timestamp to end enumerating',
--
To view, visit https://gerrit.wikimedia.org/r/95370
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I8c3a5b4396a1c3bba22f676137f640c6aa3c8960
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