jenkins-bot has submitted this change and it was merged. (
https://gerrit.wikimedia.org/r/368119 )
Change subject: phpcs for WikimediaMaintenance
..
phpcs for WikimediaMaintenance
Change-Id: I26914255fe19b6723778b6442d0a9b29bfa931fb
---
M addWiki.php
M bug-53687/fixOrphans.php
M changeSkinPref.php
M checkTranscacheEmpty.php
M cleanupBug31576.php
M cleanupBug41615.php
M cleanupMl.php
M cleanupPageProps.php
M cleanupT92775.php
A composer.json
M createExtensionTables.php
M createHumanReadableProjectNameFiles.php
M dumpInterwiki.php
M filebackend/measureZoneSizes.php
M filebackend/setZoneAccess.php
M fixBeXOldRenames.php
M fixBug41778.php
M fixCleanupTitles/revertCleanupTitles.php
M fixJobQueueExplosion.php
M fixUsabilityPrefs.php
M fixUsabilityPrefs2.php
M getJobQueueLengths.php
M getPageCounts.php
M importUseModWikipedia.php
M makeDumpList.php
M makeSizeDBLists.php
M migrateWlmUploads.php
M ourUsers.php
M passwordAudit.php
A phpcs.xml
M purgeStaleMemcachedText.php
M purgeUrls.php
M rcParamsTypeCheck.php
M removeDeletedWikis.php
M renameInvalidUsernames.php
M renameWiki.php
M sanityCheck.php
M socket-test.php
M storage/testRctComplete.php
M unsuppressCrossWiki.php
40 files changed, 440 insertions(+), 414 deletions(-)
Approvals:
Krinkle: Looks good to me, approved
jenkins-bot: Verified
diff --git a/addWiki.php b/addWiki.php
index 968e6e4..360a5a8 100644
--- a/addWiki.php
+++ b/addWiki.php
@@ -87,7 +87,7 @@
null,
null,
__METHOD__,
- array( $this, 'noExecuteCommands' )
+ [ $this, 'noExecuteCommands' ]
);
$dbw->sourceFile(
"$IP/extensions/AntiSpoof/sql/patch-antispoof.mysql.sql" );
$dbw->sourceFile( "$IP/extensions/Babel/babel.sql" );
@@ -153,18 +153,18 @@
if ( is_array( $wgDefaultExternalStore ) ) {
$stores = $wgDefaultExternalStore;
} elseif ( $wgDefaultExternalStore ) {
- $stores = array( $wgDefaultExternalStore );
+ $stores = [ $wgDefaultExternalStore ];
} else {
- $stores = array();
+ $stores = [];
}
// Flow External Store (may be the same, so there is an
array_unique)
if ( is_array( $wgFlowExternalStore ) ) {
$flowStores = $wgFlowExternalStore;
} elseif ( $wgFlowExternalStore ) {
- $flowStores = array( $wgFlowExternalStore );
+ $flowStores = [ $wgFlowExternalStore ];
} else {
- $flowStores = array();
+ $flowStores = [];
}
$stores = array_unique( array_merge( $stores, $flowStores ) );
@@ -172,7 +172,7 @@
if ( count( $stores ) ) {
global $wgDBuser, $wgDBpassword, $wgExternalServers;
foreach ( $stores as $storeURL ) {
- $m = array();
+ $m = [];
if ( !preg_match( '!^DB://(.*)$!', $storeURL,
$m ) ) {
continue;
}
@@ -337,7 +337,6 @@
* @return Status
*/
private function setFundraisingLink( $domain, $language ) {
-
$title = Title::newFromText( "Mediawiki:Sitesupport-url" );
$this->output( "Writing sidebar donate link to " .
$title->getPrefixedDBkey() . "\n" );
$article = WikiPage::factory( $title );
diff --git a/bug-53687/fixOrphans.php b/bug-53687/fixOrphans.php
index 6b6bdf9..ad18695 100644
--- a/bug-53687/fixOrphans.php
+++ b/bug-53687/fixOrphans.php
@@ -23,7 +23,7 @@
}
$dbw = wfGetDB( DB_MASTER );
- $verifyPairs = array(
+ $verifyPairs = [
'ar_comment' => 'rev_comment',
'ar_user' => 'rev_user',
'ar_user_text' => 'rev_user_text',
@@ -35,7 +35,7 @@
'ar_page_id' => 'rev_page',
'ar_parent_id' => 'rev_parent_id',
'ar_sha1' => 'rev_sha1',
- );
+ ];
while ( !feof( $f ) ) {
$line = fgets( $f );
@@ -52,23 +52,23 @@
$this->error( "XXX: ERROR Invalid line
$lineNumber\n" );
continue;
}
- $info = array_combine( array( 'up_page',
'up_timestamp', 'log_namespace',
- 'log_title', 'rev_id', 'ar_rev_match',
'ar_text_match' ), $parts );
+ $info = array_combine( [ 'up_page',