[MediaWiki-commits] [Gerrit] mediawiki...WikimediaMaintenance[master]: phpcs for WikimediaMaintenance

2017-07-26 Thread jenkins-bot (Code Review)
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', 

[MediaWiki-commits] [Gerrit] mediawiki...WikimediaMaintenance[master]: phpcs for WikimediaMaintenance

2017-07-26 Thread Reedy (Code Review)
Reedy has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/368119 )

Change subject: phpcs for WikimediaMaintenance
..

phpcs for WikimediaMaintenance

Change-Id: I26914255fe19b6723778b6442d0a9b29bfa931fb
---
A composer.json
A phpcs.xml
2 files changed, 27 insertions(+), 0 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/WikimediaMaintenance 
refs/changes/19/368119/1

diff --git a/composer.json b/composer.json
new file mode 100644
index 000..f498b4c
--- /dev/null
+++ b/composer.json
@@ -0,0 +1,20 @@
+{
+   "require-dev": {
+   "jakub-onderka/php-parallel-lint": "0.9.2",
+   "mediawiki/mediawiki-codesniffer": "0.10.1"
+   },
+   "scripts": {
+   "lint": "parallel-lint --exclude vendor --ignore-fails .",
+   "phpcs": "phpcs -p -s",
+   "fix": "phpcbf",
+   "test": [
+   "composer lint",
+   "composer phpcs"
+   ]
+   },
+   "config": {
+   "optimize-autoloader": true,
+   "prepend-autoloader": false
+   }
+}
+
diff --git a/phpcs.xml b/phpcs.xml
new file mode 100644
index 000..c97589d
--- /dev/null
+++ b/phpcs.xml
@@ -0,0 +1,7 @@
+
+
+   
+   .
+   
+   
+

-- 
To view, visit https://gerrit.wikimedia.org/r/368119
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I26914255fe19b6723778b6442d0a9b29bfa931fb
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/WikimediaMaintenance
Gerrit-Branch: master
Gerrit-Owner: Reedy 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits