jenkins-bot has submitted this change and it was merged.
Change subject: Fix CodeSniffer errors and warnings (you guessed it, on API
classes)
......................................................................
Fix CodeSniffer errors and warnings (you guessed it, on API classes)
Change-Id: I56f9632975d53bdfe33ff9412e1a4ba010bdb2aa
---
M includes/api/ApiQueryImages.php
M includes/api/ApiQueryInfo.php
M includes/api/ApiQueryLangBacklinks.php
M includes/api/ApiQueryLangLinks.php
M includes/api/ApiQueryLinks.php
M includes/api/ApiQueryLogEvents.php
M includes/api/ApiQueryPagePropNames.php
M includes/api/ApiQueryPageProps.php
8 files changed, 56 insertions(+), 23 deletions(-)
Approvals:
Chad: Looks good to me, approved
jenkins-bot: Verified
diff --git a/includes/api/ApiQueryImages.php b/includes/api/ApiQueryImages.php
index 7ec69b7..a32fb9e 100644
--- a/includes/api/ApiQueryImages.php
+++ b/includes/api/ApiQueryImages.php
@@ -164,7 +164,8 @@
return array(
'limit' => 'How many images to return',
'continue' => 'When more results are available, use
this to continue',
- 'images' => 'Only list these images. Useful for
checking whether a certain page has a certain Image.',
+ 'images' => 'Only list these images. Useful for
checking whether a ' .
+ 'certain page has a certain Image.',
'dir' => 'The direction in which to list',
);
}
@@ -184,8 +185,10 @@
public function getExamples() {
return array(
- 'api.php?action=query&prop=images&titles=Main%20Page'
=> 'Get a list of images used in the [[Main Page]]',
-
'api.php?action=query&generator=images&titles=Main%20Page&prop=info' => 'Get
information about all images used in the [[Main Page]]',
+ 'api.php?action=query&prop=images&titles=Main%20Page'
+ => 'Get a list of images used in the [[Main
Page]]',
+
'api.php?action=query&generator=images&titles=Main%20Page&prop=info'
+ => 'Get information about all images used in
the [[Main Page]]',
);
}
diff --git a/includes/api/ApiQueryInfo.php b/includes/api/ApiQueryInfo.php
index 7890a40..3a1c21a 100644
--- a/includes/api/ApiQueryInfo.php
+++ b/includes/api/ApiQueryInfo.php
@@ -42,7 +42,8 @@
private $pageRestrictions, $pageIsRedir, $pageIsNew, $pageTouched,
$pageLatest, $pageLength;
- private $protections, $watched, $watchers, $notificationtimestamps,
$talkids, $subjectids, $displaytitles;
+ private $protections, $watched, $watchers, $notificationtimestamps,
+ $talkids, $subjectids, $displaytitles;
private $showZeroWatchers = false;
private $tokenFunctions;
@@ -349,7 +350,8 @@
*/
private function extractPageInfo( $pageid, $title ) {
$pageInfo = array();
- $titleExists = $pageid > 0; //$title->exists() needs pageid,
which is not set for all title objects
+ // $title->exists() needs pageid, which is not set for all
title objects
+ $titleExists = $pageid > 0;
$ns = $title->getNamespace();
$dbkey = $title->getDBkey();
@@ -411,7 +413,8 @@
if ( $this->fld_notificationtimestamp ) {
$pageInfo['notificationtimestamp'] = '';
if ( isset( $this->notificationtimestamps[$ns][$dbkey]
) ) {
- $pageInfo['notificationtimestamp'] =
wfTimestamp( TS_ISO_8601, $this->notificationtimestamps[$ns][$dbkey] );
+ $pageInfo['notificationtimestamp'] =
+ wfTimestamp( TS_ISO_8601,
$this->notificationtimestamps[$ns][$dbkey] );
}
}
@@ -698,7 +701,8 @@
$this->watched[$row->wl_namespace][$row->wl_title] = true;
}
if ( $this->fld_notificationtimestamp ) {
-
$this->notificationtimestamps[$row->wl_namespace][$row->wl_title] =
$row->wl_notificationtimestamp;
+
$this->notificationtimestamps[$row->wl_namespace][$row->wl_title] =
+ $row->wl_notificationtimestamp;
}
}
}
diff --git a/includes/api/ApiQueryLangBacklinks.php
b/includes/api/ApiQueryLangBacklinks.php
index 652fa11..e6280c8 100644
--- a/includes/api/ApiQueryLangBacklinks.php
+++ b/includes/api/ApiQueryLangBacklinks.php
@@ -112,9 +112,13 @@
$result = $this->getResult();
foreach ( $res as $row ) {
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}" );
+ // 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}"
+ );
break;
}
@@ -140,7 +144,10 @@
$fit = $result->addValue( array( 'query',
$this->getModuleName() ), null, $entry );
if ( !$fit ) {
- $this->setContinueEnumParameter(
'continue', "{$row->ll_lang}|{$row->ll_title}|{$row->ll_from}" );
+ $this->setContinueEnumParameter(
+ 'continue',
+
"{$row->ll_lang}|{$row->ll_title}|{$row->ll_from}"
+ );
break;
}
}
diff --git a/includes/api/ApiQueryLangLinks.php
b/includes/api/ApiQueryLangLinks.php
index 926a1b6..a20b855 100644
--- a/includes/api/ApiQueryLangLinks.php
+++ b/includes/api/ApiQueryLangLinks.php
@@ -182,7 +182,8 @@
public function getExamples() {
return array(
-
'api.php?action=query&prop=langlinks&titles=Main%20Page&redirects=' => 'Get
interlanguage links from the [[Main Page]]',
+
'api.php?action=query&prop=langlinks&titles=Main%20Page&redirects='
+ => 'Get interlanguage links from the [[Main
Page]]',
);
}
diff --git a/includes/api/ApiQueryLinks.php b/includes/api/ApiQueryLinks.php
index c3a130b..3157a7b 100644
--- a/includes/api/ApiQueryLinks.php
+++ b/includes/api/ApiQueryLinks.php
@@ -43,7 +43,8 @@
$this->prefix = 'pl';
$this->description = 'link';
$this->titlesParam = 'titles';
- $this->titlesParamDescription = 'Only list
links to these titles. Useful for checking whether a certain page links to a
certain title.';
+ $this->titlesParamDescription = 'Only list
links to these titles. Useful ' .
+ 'for checking whether a certain page
links to a certain title.';
$this->helpUrl =
'https://www.mediawiki.org/wiki/API:Properties#links_.2F_pl';
break;
case self::TEMPLATES:
@@ -51,7 +52,8 @@
$this->prefix = 'tl';
$this->description = 'template';
$this->titlesParam = 'templates';
- $this->titlesParamDescription = 'Only list
these templates. Useful for checking whether a certain page uses a certain
template.';
+ $this->titlesParamDescription = 'Only list
these templates. Useful ' .
+ 'for checking whether a certain page
uses a certain template.';
$this->helpUrl =
'https://www.mediawiki.org/wiki/API:Properties#templates_.2F_tl';
break;
default:
@@ -241,8 +243,10 @@
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]]",
-
"api.php?action=query&prop={$name}&titles=Main%20Page&{$this->prefix}namespace=2|10"
=> "Get {$desc}s from the Main Page in the User and Template namespaces",
+
"api.php?action=query&generator={$name}&titles=Main%20Page&prop=info"
+ => "Get information about the {$desc} pages in
the [[Main Page]]",
+
"api.php?action=query&prop={$name}&titles=Main%20Page&{$this->prefix}namespace=2|10"
+ => "Get {$desc}s from the Main Page in the User
and Template namespaces",
);
}
diff --git a/includes/api/ApiQueryLogEvents.php
b/includes/api/ApiQueryLogEvents.php
index d177279..0d2f475 100644
--- a/includes/api/ApiQueryLogEvents.php
+++ b/includes/api/ApiQueryLogEvents.php
@@ -84,7 +84,10 @@
$this->addFieldsIf( array( 'log_id', 'page_id' ),
$this->fld_ids );
$this->addFieldsIf( array( 'log_user', 'log_user_text',
'user_name' ), $this->fld_user );
$this->addFieldsIf( 'log_user', $this->fld_userid );
- $this->addFieldsIf( array( 'log_namespace', 'log_title' ),
$this->fld_title || $this->fld_parsedcomment );
+ $this->addFieldsIf(
+ array( 'log_namespace', 'log_title' ),
+ $this->fld_title || $this->fld_parsedcomment
+ );
$this->addFieldsIf( 'log_comment', $this->fld_comment ||
$this->fld_parsedcomment );
$this->addFieldsIf( 'log_params', $this->fld_details );
@@ -96,7 +99,8 @@
if ( !is_null( $params['tag'] ) ) {
$this->addTables( 'change_tag' );
- $this->addJoinConds( array( 'change_tag' => array(
'INNER JOIN', array( 'log_id=ct_log_id' ) ) ) );
+ $this->addJoinConds( array( 'change_tag' => array(
'INNER JOIN',
+ array( 'log_id=ct_log_id' ) ) ) );
$this->addWhereFld( 'ct_tag', $params['tag'] );
$index['change_tag'] = 'change_tag_tag_id';
}
@@ -110,7 +114,12 @@
$index['logging'] = 'type_time';
}
- $this->addTimestampWhereRange( 'log_timestamp', $params['dir'],
$params['start'], $params['end'] );
+ $this->addTimestampWhereRange(
+ 'log_timestamp',
+ $params['dir'],
+ $params['start'],
+ $params['end']
+ );
$limit = $params['limit'];
$this->addOption( 'LIMIT', $limit + 1 );
@@ -169,7 +178,8 @@
$result = $this->getResult();
foreach ( $res as $row ) {
if ( ++$count > $limit ) {
- // We've reached the one extra which shows that
there are additional pages to be had. Stop here...
+ // 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;
}
@@ -197,7 +207,9 @@
* @param $legacy bool
* @return array
*/
- public static function addLogParams( $result, &$vals, $params, $type,
$action, $ts, $legacy = false ) {
+ public static function addLogParams( $result, &$vals, $params, $type,
+ $action, $ts, $legacy = false
+ ) {
switch ( $type ) {
case 'move':
if ( $legacy ) {
diff --git a/includes/api/ApiQueryPagePropNames.php
b/includes/api/ApiQueryPagePropNames.php
index 08c883d..5438175 100644
--- a/includes/api/ApiQueryPagePropNames.php
+++ b/includes/api/ApiQueryPagePropNames.php
@@ -63,7 +63,8 @@
$count = 0;
foreach ( $this->select( __METHOD__ ) as $row ) {
if ( ++$count > $limit ) {
- // We've reached the one extra which shows that
there are additional pages to be had. Stop here...
+ // We've reached the one extra which shows that
there are
+ // additional pages to be had. Stop here...
$this->setContinueEnumParameter( 'continue',
$row->pp_propname );
break;
}
diff --git a/includes/api/ApiQueryPageProps.php
b/includes/api/ApiQueryPageProps.php
index 91a8090..e51c7ab 100644
--- a/includes/api/ApiQueryPageProps.php
+++ b/includes/api/ApiQueryPageProps.php
@@ -135,7 +135,8 @@
public function getParamDescription() {
return array(
'continue' => 'When more results are available, use
this to continue',
- 'prop' => 'Only list these props. Useful for checking
whether a certain page uses a certain page prop',
+ 'prop' => 'Only list these props. Useful for checking
whether a ' .
+ 'certain page uses a certain page prop',
);
}
--
To view, visit https://gerrit.wikimedia.org/r/95383
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I56f9632975d53bdfe33ff9412e1a4ba010bdb2aa
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Siebrand <[email protected]>
Gerrit-Reviewer: Chad <[email protected]>
Gerrit-Reviewer: jenkins-bot
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits