Jdlrobson has uploaded a new change for review.
https://gerrit.wikimedia.org/r/322773
Change subject: Lint PHP code
......................................................................
Lint PHP code
Change-Id: I494b01d1396bec17d2323d585f8594123d3e574b
---
M includes/ApiQueryPageImages.php
M includes/LinksUpdateHookHandler.php
M includes/PageImages.php
M includes/ParserFileProcessingHookHandlers.php
4 files changed, 12 insertions(+), 12 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/PageImages
refs/changes/73/322773/1
diff --git a/includes/ApiQueryPageImages.php b/includes/ApiQueryPageImages.php
index 0c2698c..523985e 100644
--- a/includes/ApiQueryPageImages.php
+++ b/includes/ApiQueryPageImages.php
@@ -43,7 +43,7 @@
$missingTitles = $pageSet->getMissingTitlesByNamespace();
$missingFileTitles = isset( $missingTitles[NS_FILE] )
? $missingTitles[NS_FILE]
- : array();
+ : [];
// $titles is a map of ID to title object, which is ideal,
// whereas $missingFileTitles is a map of title text to ID.
@@ -98,7 +98,7 @@
}
// Find any titles in the file namespace so we can handle those
separately
- $filePageTitles = array();
+ $filePageTitles = [];
foreach ( $titles as $id => $title ) {
if ( $title->inNamespace( NS_FILE ) ) {
$filePageTitles[$id] = $title;
@@ -142,7 +142,7 @@
* @param int $size The thumbsize value from the API request
*/
protected function setResultValues( array $prop, $pageId, $fileName,
$size ) {
- $vals = array();
+ $vals = [];
if ( isset( $prop['thumbnail'] ) || isset( $prop['original'] )
) {
$file = wfFindFile( $fileName );
diff --git a/includes/LinksUpdateHookHandler.php
b/includes/LinksUpdateHookHandler.php
index 52e9c02..3f4a3eb 100644
--- a/includes/LinksUpdateHookHandler.php
+++ b/includes/LinksUpdateHookHandler.php
@@ -42,7 +42,7 @@
return;
}
- $scores = array();
+ $scores = [];
$counter = 0;
foreach ( $images as $image ) {
@@ -148,7 +148,7 @@
$context->setLanguage( 'en' ); // we don't care so avoid
splitting the cache
$format->setContext( $context );
$extmetadata = $format->fetchExtendedMetadata( $file );
- $processedMetadata = array();
+ $processedMetadata = [];
// process copyright metadata from CommonsMetadata, if present
if ( !empty( $extmetadata['NonFree']['value'] ) ) { // not '0'
or unset
@@ -197,7 +197,7 @@
}
wfDebug( __METHOD__ . "(): cache miss\n" );
- $list = array();
+ $list = [];
foreach ( $wgPageImagesBlacklist as $source ) {
switch ( $source['type'] ) {
@@ -228,7 +228,7 @@
private function getDbBlacklist( $dbName, $page ) {
$dbr = wfGetDB( DB_SLAVE, array(), $dbName );
$title = Title::newFromText( $page );
- $list = array();
+ $list = [];
$id = $dbr->selectField(
'page',
@@ -263,7 +263,7 @@
private function getUrlBlacklist( $url ) {
global $wgFileExtensions;
- $list = array();
+ $list = [];
$text = Http::get( $url, 3 );
$regex = '/\[\[:([^|\#]*?\.(?:' . implode( '|',
$wgFileExtensions ) . '))/i';
diff --git a/includes/PageImages.php b/includes/PageImages.php
index 67376fa..0cade7d 100644
--- a/includes/PageImages.php
+++ b/includes/PageImages.php
@@ -107,7 +107,7 @@
public static function onSpecialMobileEditWatchlist_images(
IContextSource $context, array $watchlist,
array &$images
) {
- $ids = array();
+ $ids = [];
foreach ( $watchlist as $ns => $pages ) {
foreach ( array_keys( $pages ) as $dbKey ) {
$title = Title::makeTitle( $ns, $dbKey );
@@ -161,7 +161,7 @@
if ( isset( $data['query']['pages'] ) ) {
return $data['query']['pages'];
}
- return array();
+ return [];
}
}
diff --git a/includes/ParserFileProcessingHookHandlers.php
b/includes/ParserFileProcessingHookHandlers.php
index 2cc5a1e..a971ad8 100644
--- a/includes/ParserFileProcessingHookHandlers.php
+++ b/includes/ParserFileProcessingHookHandlers.php
@@ -93,7 +93,7 @@
$myParams = $handlerParams;
$this->calcWidth( $myParams, $file );
} else {
- $myParams = array();
+ $myParams = [];
}
$myParams['filename'] = $file->getTitle()->getDBkey();
@@ -101,7 +101,7 @@
$myParams['fullheight'] = $file->getHeight();
$out = $parser->getOutput();
- $pageImages = $out->getExtensionData( 'pageImages' ) ?: array();
+ $pageImages = $out->getExtensionData( 'pageImages' ) ?: [];
$pageImages[] = $myParams;
$out->setExtensionData( 'pageImages', $pageImages );
}
--
To view, visit https://gerrit.wikimedia.org/r/322773
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I494b01d1396bec17d2323d585f8594123d3e574b
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/PageImages
Gerrit-Branch: master
Gerrit-Owner: Jdlrobson <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits