Siebrand has uploaded a new change for review.
https://gerrit.wikimedia.org/r/95369
Change subject: Update formatting
......................................................................
Update formatting
Change-Id: Iaa1cfaaffc7c55bb7670dfbff3f063cf22434f09
---
M includes/api/ApiQueryDeletedrevs.php
M includes/api/ApiQueryExtLinksUsage.php
M includes/api/ApiQueryExternalLinks.php
M includes/api/ApiQueryFileRepoInfo.php
M includes/api/ApiQueryFilearchive.php
M includes/api/ApiQueryIWBacklinks.php
M includes/api/ApiQueryIWLinks.php
M includes/api/ApiQueryImageInfo.php
M includes/api/ApiQueryImages.php
M includes/api/ApiQueryInfo.php
10 files changed, 49 insertions(+), 34 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core
refs/changes/69/95369/1
diff --git a/includes/api/ApiQueryDeletedrevs.php
b/includes/api/ApiQueryDeletedrevs.php
index 8273313..0eb1ec7 100644
--- a/includes/api/ApiQueryDeletedrevs.php
+++ b/includes/api/ApiQueryDeletedrevs.php
@@ -172,10 +172,10 @@
$ts = $db->addQuotes( $db->timestamp( $cont[2] ) );
$op = ( $dir == 'newer' ? '>' : '<' );
$this->addWhere( "ar_namespace $op $ns OR " .
- "(ar_namespace = $ns AND " .
- "(ar_title $op $title OR " .
- "(ar_title = $title AND " .
- "ar_timestamp $op= $ts)))" );
+ "(ar_namespace = $ns AND " .
+ "(ar_title $op $title OR " .
+ "(ar_title = $title AND " .
+ "ar_timestamp $op= $ts)))" );
}
$this->addOption( 'LIMIT', $limit + 1 );
@@ -188,7 +188,7 @@
$this->addOption( 'ORDER BY', array(
'ar_title' . $sort,
'ar_timestamp' . $sort
- ));
+ ) );
}
} else {
if ( $mode == 'revs' ) {
@@ -385,6 +385,7 @@
public function getDescription() {
$p = $this->getModulePrefix();
+
return array(
'List deleted revisions.',
'Operates in three modes:',
diff --git a/includes/api/ApiQueryExtLinksUsage.php
b/includes/api/ApiQueryExtLinksUsage.php
index 456e87b..ae42bf7 100644
--- a/includes/api/ApiQueryExtLinksUsage.php
+++ b/includes/api/ApiQueryExtLinksUsage.php
@@ -101,7 +101,7 @@
$result = $this->getResult();
$count = 0;
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( 'offset',
$offset + $limit );
break;
@@ -140,7 +140,7 @@
if ( is_null( $resultPageSet ) ) {
$result->setIndexedTagName_internal( array( 'query',
$this->getModuleName() ),
- $this->getModulePrefix() );
+ $this->getModulePrefix() );
}
}
@@ -186,6 +186,7 @@
$protocols[] = substr( $p, 0, strpos( $p, ':' )
);
}
}
+
return $protocols;
}
diff --git a/includes/api/ApiQueryExternalLinks.php
b/includes/api/ApiQueryExternalLinks.php
index 583ef69..fb132c0 100644
--- a/includes/api/ApiQueryExternalLinks.php
+++ b/includes/api/ApiQueryExternalLinks.php
@@ -127,6 +127,7 @@
public function getParamDescription() {
$p = $this->getModulePrefix();
+
return array(
'limit' => 'How many links to return',
'offset' => 'When more results are available, use this
to continue',
diff --git a/includes/api/ApiQueryFileRepoInfo.php
b/includes/api/ApiQueryFileRepoInfo.php
index 3a35353..9a12ba1 100644
--- a/includes/api/ApiQueryFileRepoInfo.php
+++ b/includes/api/ApiQueryFileRepoInfo.php
@@ -91,6 +91,7 @@
public function getParamDescription() {
$p = $this->getModulePrefix();
+
return array(
'prop' => array(
'Which repository properties to get (there may
be more available on some wikis):',
diff --git a/includes/api/ApiQueryFilearchive.php
b/includes/api/ApiQueryFilearchive.php
index f53cd38..1b2da26 100644
--- a/includes/api/ApiQueryFilearchive.php
+++ b/includes/api/ApiQueryFilearchive.php
@@ -180,8 +180,8 @@
}
if ( $fld_metadata ) {
$file['metadata'] = $row->fa_metadata
- ?
ApiQueryImageInfo::processMetaData( unserialize( $row->fa_metadata ), $result )
- : null;
+ ? ApiQueryImageInfo::processMetaData(
unserialize( $row->fa_metadata ), $result )
+ : null;
}
if ( $fld_bitdepth ) {
$file['bitdepth'] = $row->fa_bits;
diff --git a/includes/api/ApiQueryIWBacklinks.php
b/includes/api/ApiQueryIWBacklinks.php
index ebae3e7..bb6a23a 100644
--- a/includes/api/ApiQueryIWBacklinks.php
+++ b/includes/api/ApiQueryIWBacklinks.php
@@ -92,14 +92,14 @@
$this->addOption( 'ORDER BY', array(
'iwl_title' . $sort,
'iwl_from' . $sort
- ));
+ ) );
}
} else {
$this->addOption( 'ORDER BY', array(
'iwl_prefix' . $sort,
'iwl_title' . $sort,
'iwl_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->iwl_prefix}|{$row->iwl_title}|{$row->iwl_from}" );
diff --git a/includes/api/ApiQueryIWLinks.php b/includes/api/ApiQueryIWLinks.php
index be53931..a339868 100644
--- a/includes/api/ApiQueryIWLinks.php
+++ b/includes/api/ApiQueryIWLinks.php
@@ -81,9 +81,9 @@
$this->addOption( 'ORDER BY', 'iwl_from' .
$sort );
} else {
$this->addOption( 'ORDER BY', array(
- 'iwl_from' . $sort,
- 'iwl_title' . $sort
- ));
+ 'iwl_from' . $sort,
+ 'iwl_title' . $sort
+ ) );
}
} else {
// Don't order by iwl_from if it's constant in the
WHERE clause
@@ -91,10 +91,10 @@
$this->addOption( 'ORDER BY', 'iwl_prefix' .
$sort );
} else {
$this->addOption( 'ORDER BY', array(
- 'iwl_from' . $sort,
- 'iwl_prefix' . $sort,
- 'iwl_title' . $sort
- ));
+ 'iwl_from' . $sort,
+ 'iwl_prefix' . $sort,
+ 'iwl_title' . $sort
+ ) );
}
}
diff --git a/includes/api/ApiQueryImageInfo.php
b/includes/api/ApiQueryImageInfo.php
index 81c9faf..990130f 100644
--- a/includes/api/ApiQueryImageInfo.php
+++ b/includes/api/ApiQueryImageInfo.php
@@ -267,6 +267,7 @@
if ( !$h ) {
$this->setWarning( 'Could not create thumbnail because
' .
$image->getName() . ' does not have an
associated image handler' );
+
return $thumbParams;
}
@@ -278,6 +279,7 @@
// handlers.
$this->setWarning( "Could not parse {$p}urlparam for "
. $image->getName()
. '. Using only width and height' );
+
return $thumbParams;
}
@@ -389,7 +391,8 @@
$uploadwarning = isset( $prop['uploadwarning'] );
if ( ( $url || $sha1 || $meta || $mime || $mediatype ||
$archive || $bitdepth )
- && $file->isDeleted( File::DELETED_FILE ) ) {
+ && $file->isDeleted( File::DELETED_FILE )
+ ) {
$vals['filehidden'] = '';
//Early return, tidier than indenting all following
things one level
@@ -505,6 +508,7 @@
}
}
$result->setIndexedTagName( $retval, 'metadata' );
+
return $retval;
}
@@ -521,11 +525,13 @@
if ( $start === null ) {
$start = $img->getTimestamp();
}
+
return $img->getOriginalTitle()->getDBkey() . '|' . $start;
}
public function getAllowedParams() {
global $wgContLang;
+
return array(
'prop' => array(
ApiBase::PARAM_ISMULTI => true,
@@ -634,6 +640,7 @@
*/
public function getParamDescription() {
$p = $this->getModulePrefix();
+
return array(
'prop' => self::getPropertyDescriptions( array(), $p ),
'urlwidth' => array( "If {$p}prop=url is set, a URL to
an image scaled to this width will be returned.",
@@ -646,10 +653,10 @@
'start' => 'Timestamp to start listing from',
'end' => 'Timestamp to stop listing at',
'metadataversion' => array( "Version of metadata to
use. if 'latest' is specified, use latest version.",
- "Defaults to '1' for backwards
compatibility" ),
+ "Defaults to '1' for backwards compatibility" ),
'extmetadatalanguage' => array( 'What language to fetch
extmetadata in. This affects both which',
- 'translation to fetch, if
multiple are available, as well as how things',
- 'like numbers and various
values are formatted.' ),
+ 'translation to fetch, if multiple are
available, as well as how things',
+ 'like numbers and various values are
formatted.' ),
'extmetadatamultilang' => 'If translations for
extmetadata property are available, fetch all of them.',
'continue' => 'If the query response includes a
continue value, use it here to get another page of results',
'localonly' => 'Look only for files in the local
repository',
@@ -773,6 +780,7 @@
)
),
);
+
return array_diff_key( $props, array_flip( $filter ) );
}
@@ -786,6 +794,7 @@
public function getPossibleErrors() {
$p = $this->getModulePrefix();
+
return array_merge( parent::getPossibleErrors(), array(
array( 'code' => "{$p}urlwidth", 'info' =>
"{$p}urlheight cannot be used without {$p}urlwidth" ),
array( 'code' => 'urlparam', 'info' => "Invalid value
for {$p}urlparam" ),
diff --git a/includes/api/ApiQueryImages.php b/includes/api/ApiQueryImages.php
index f2bf0a7..7ec69b7 100644
--- a/includes/api/ApiQueryImages.php
+++ b/includes/api/ApiQueryImages.php
@@ -79,9 +79,9 @@
$this->addOption( 'ORDER BY', 'il_to' . $sort );
} else {
$this->addOption( 'ORDER BY', array(
- 'il_from' . $sort,
- 'il_to' . $sort
- ));
+ 'il_from' . $sort,
+ 'il_to' . $sort
+ ) );
}
$this->addOption( 'LIMIT', $params['limit'] + 1 );
diff --git a/includes/api/ApiQueryInfo.php b/includes/api/ApiQueryInfo.php
index 017684e..7890a40 100644
--- a/includes/api/ApiQueryInfo.php
+++ b/includes/api/ApiQueryInfo.php
@@ -104,6 +104,7 @@
'watch' => array( 'ApiQueryInfo', 'getWatchToken' ),
);
wfRunHooks( 'APIQueryInfoTokens', array( &$this->tokenFunctions
) );
+
return $this->tokenFunctions;
}
@@ -333,8 +334,8 @@
), $pageid, $pageInfo );
if ( !$fit ) {
$this->setContinueEnumParameter( 'continue',
- $title->getNamespace() . '|' .
- $title->getText() );
+ $title->getNamespace() . '|' .
+ $title->getText() );
break;
}
}
@@ -465,7 +466,7 @@
$this->resetQueryParams();
$this->addTables( 'page_restrictions' );
$this->addFields( array( 'pr_page', 'pr_type',
'pr_level',
- 'pr_expiry', 'pr_cascade' ) );
+ 'pr_expiry', 'pr_cascade' ) );
$this->addWhereFld( 'pr_page', array_keys(
$this->titles ) );
$res = $this->select( __METHOD__ );
@@ -556,8 +557,8 @@
$this->resetQueryParams();
$this->addTables( array( 'page_restrictions', 'page',
'templatelinks' ) );
$this->addFields( array( 'pr_type', 'pr_level',
'pr_expiry',
- 'page_title', 'page_namespace',
- 'tl_title', 'tl_namespace' ) );
+ 'page_title', 'page_namespace',
+ 'tl_title', 'tl_namespace' ) );
$this->addWhere( $lb->constructSet( 'tl', $db ) );
$this->addWhere( 'pr_page = page_id' );
$this->addWhere( 'pr_page = tl_from' );
@@ -580,7 +581,7 @@
$this->resetQueryParams();
$this->addTables( array( 'page_restrictions', 'page',
'imagelinks' ) );
$this->addFields( array( 'pr_type', 'pr_level',
'pr_expiry',
- 'page_title', 'page_namespace', 'il_to'
) );
+ 'page_title', 'page_namespace', 'il_to' ) );
$this->addWhere( 'pr_page = page_id' );
$this->addWhere( 'pr_page = il_from' );
$this->addWhereFld( 'pr_cascade', 1 );
@@ -633,10 +634,10 @@
foreach ( $res as $row ) {
if ( MWNamespace::isTalk( $row->page_namespace ) ) {
$this->talkids[MWNamespace::getSubject(
$row->page_namespace )][$row->page_title] =
- intval( $row->page_id );
+ intval( $row->page_id );
} else {
$this->subjectids[MWNamespace::getTalk(
$row->page_namespace )][$row->page_title] =
- intval( $row->page_id );
+ intval( $row->page_id );
}
}
}
@@ -761,6 +762,7 @@
if ( !is_null( $params['token'] ) ) {
return 'private';
}
+
return 'public';
}
--
To view, visit https://gerrit.wikimedia.org/r/95369
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Iaa1cfaaffc7c55bb7670dfbff3f063cf22434f09
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