jenkins-bot has submitted this change and it was merged.

Change subject: Pass phpcs-strict on maintenance/ (1/8)
......................................................................


Pass phpcs-strict on maintenance/ (1/8)

Change-Id: Ib68a7cf4251e8f4c71233df869673f4c5d3cf84c
---
M maintenance/showSiteStats.php
M maintenance/sql.php
M maintenance/sqlite.php
M maintenance/update.php
M maintenance/updateArticleCount.php
M maintenance/updateDoubleWidthSearch.php
M maintenance/updateRestrictions.php
M maintenance/updateSearchIndex.php
M maintenance/userDupes.inc
M maintenance/userOptions.inc
10 files changed, 77 insertions(+), 18 deletions(-)

Approvals:
  Krinkle: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/maintenance/showSiteStats.php b/maintenance/showSiteStats.php
index 49148b3..6bf4daa 100644
--- a/maintenance/showSiteStats.php
+++ b/maintenance/showSiteStats.php
@@ -65,7 +65,11 @@
 
                // Show them
                foreach ( $fields as $field => $desc ) {
-                       $this->output( sprintf( "%-{$max_length_desc}s: 
%{$max_length_value}d\n", $desc, $stats->$field ) );
+                       $this->output( sprintf(
+                               "%-{$max_length_desc}s: 
%{$max_length_value}d\n",
+                               $desc,
+                               $stats->$field
+                       ) );
                }
        }
 }
diff --git a/maintenance/sql.php b/maintenance/sql.php
index d43c8dc..b20b0cf 100644
--- a/maintenance/sql.php
+++ b/maintenance/sql.php
@@ -53,7 +53,8 @@
                                $index = DB_SLAVE;
                        } else {
                                $index = null;
-                               for ( $i = 0; $i < $lb->getServerCount(); ++$i 
) {
+                               $serverCount = $lb->getServerCount();
+                               for ( $i = 0; $i < $serverCount; ++$i ) {
                                        if ( $lb->getServerName( $i ) === 
$server ) {
                                                $index = $i;
                                                break;
diff --git a/maintenance/sqlite.php b/maintenance/sqlite.php
index 8a78524..dbd8ed1 100644
--- a/maintenance/sqlite.php
+++ b/maintenance/sqlite.php
@@ -32,7 +32,10 @@
        public function __construct() {
                parent::__construct();
                $this->mDescription = "Performs some operations specific to 
SQLite database backend";
-               $this->addOption( 'vacuum', 'Clean up database by removing 
deleted pages. Decreases database file size' );
+               $this->addOption(
+                       'vacuum',
+                       'Clean up database by removing deleted pages. Decreases 
database file size'
+               );
                $this->addOption( 'integrity', 'Check database for integrity' );
                $this->addOption( 'backup-to', 'Backup database to the given 
file', false, true );
                $this->addOption( 'check-syntax', 'Check SQL file(s) for syntax 
errors', false, true );
diff --git a/maintenance/update.php b/maintenance/update.php
index 8c1ad17..f96ee39 100644
--- a/maintenance/update.php
+++ b/maintenance/update.php
@@ -47,13 +47,19 @@
                $this->addOption( 'doshared', 'Also update shared tables' );
                $this->addOption( 'nopurge', 'Do not purge the objectcache 
table after updates' );
                $this->addOption( 'noschema', 'Only do the updates that are not 
done during schema updates' );
-               $this->addOption( 'schema', 'Output SQL to do the schema 
updates instead of doing them.  Works even when $wgAllowSchemaUpdates is 
false', false, true );
+               $this->addOption(
+                       'schema',
+                       'Output SQL to do the schema updates instead of doing 
them. Works '
+                               . 'even when $wgAllowSchemaUpdates is false',
+                       false,
+                       true
+               );
                $this->addOption( 'force', 'Override when $wgAllowSchemaUpdates 
disables this script' );
        }
 
        function getDbType() {
                /* If we used the class constant PHP4 would give a parser error 
here */
-               return 2 /* Maintenance::DB_ADMIN */;
+               return 2; /* Maintenance::DB_ADMIN */
        }
 
        function compatChecks() {
@@ -85,7 +91,11 @@
        function execute() {
                global $wgVersion, $wgLang, $wgAllowSchemaUpdates;
 
-               if ( !$wgAllowSchemaUpdates && !( $this->hasOption( 'force' ) 
|| $this->hasOption( 'schema' ) || $this->hasOption( 'noschema' ) ) ) {
+               if ( !$wgAllowSchemaUpdates
+                       && !( $this->hasOption( 'force' )
+                               || $this->hasOption( 'schema' )
+                               || $this->hasOption( 'noschema' ) )
+               ) {
                        $this->error( "Do not run update.php on this wiki. If 
you're seeing this you should\n"
                                . "probably ask for some help in performing 
your schema updates or use\n"
                                . "the --noschema and --schema options to get 
an SQL file for someone\n"
@@ -131,7 +141,8 @@
                $this->output( "Depending on the size of your database this may 
take a while!\n" );
 
                if ( !$this->hasOption( 'quick' ) ) {
-                       $this->output( "Abort with control-c in the next five 
seconds (skip this countdown with --quick) ... " );
+                       $this->output( "Abort with control-c in the next five 
seconds "
+                               . "(skip this countdown with --quick) ... " );
                        wfCountDown( 5 );
                }
 
diff --git a/maintenance/updateArticleCount.php 
b/maintenance/updateArticleCount.php
index 7964a21..470647a 100644
--- a/maintenance/updateArticleCount.php
+++ b/maintenance/updateArticleCount.php
@@ -49,10 +49,16 @@
                if ( $this->hasOption( 'update' ) ) {
                        $this->output( "Updating site statistics table... " );
                        $dbw = wfGetDB( DB_MASTER );
-                       $dbw->update( 'site_stats', array( 'ss_good_articles' 
=> $result ), array( 'ss_row_id' => 1 ), __METHOD__ );
+                       $dbw->update(
+                               'site_stats',
+                               array( 'ss_good_articles' => $result ),
+                               array( 'ss_row_id' => 1 ),
+                               __METHOD__
+                       );
                        $this->output( "done.\n" );
                } else {
-                       $this->output( "To update the site statistics table, 
run the script with the --update option.\n" );
+                       $this->output( "To update the site statistics table, 
run the script "
+                               . "with the --update option.\n" );
                }
        }
 }
diff --git a/maintenance/updateDoubleWidthSearch.php 
b/maintenance/updateDoubleWidthSearch.php
index 41988d1..f863697 100644
--- a/maintenance/updateDoubleWidthSearch.php
+++ b/maintenance/updateDoubleWidthSearch.php
@@ -36,7 +36,12 @@
                parent::__construct();
                $this->mDescription = "Script to normalize double-byte latin 
UTF-8 characters";
                $this->addOption( 'q', 'quiet', false, true );
-               $this->addOption( 'l', 'How long the searchindex and revision 
tables will be locked for', false, true );
+               $this->addOption(
+                       'l',
+                       'How long the searchindex and revision tables will be 
locked for',
+                       false,
+                       true
+               );
        }
 
        public function getDbType() {
diff --git a/maintenance/updateRestrictions.php 
b/maintenance/updateRestrictions.php
index 175447e7..5b5cc04 100644
--- a/maintenance/updateRestrictions.php
+++ b/maintenance/updateRestrictions.php
@@ -59,7 +59,12 @@
                while ( $blockEnd <= $end ) {
                        $this->output( "...doing page_id from $blockStart to 
$blockEnd\n" );
                        $cond = "page_id BETWEEN $blockStart AND $blockEnd AND 
page_restrictions !=''";
-                       $res = $db->select( 'page', array( 'page_id', 
'page_namespace', 'page_restrictions' ), $cond, __METHOD__ );
+                       $res = $db->select(
+                               'page',
+                               array( 'page_id', 'page_namespace', 
'page_restrictions' ),
+                               $cond,
+                               __METHOD__
+                       );
                        $batch = array();
                        foreach ( $res as $row ) {
                                $oldRestrictions = array();
@@ -108,7 +113,13 @@
                // Kill any broken rows from previous imports
                $db->delete( 'page_restrictions', array( 'pr_level' => '' ) );
                // Kill other invalid rows
-               $db->deleteJoin( 'page_restrictions', 'page', 'pr_page', 
'page_id', array( 'page_namespace' => NS_MEDIAWIKI ) );
+               $db->deleteJoin(
+                       'page_restrictions',
+                       'page',
+                       'pr_page',
+                       'page_id',
+                       array( 'page_namespace' => NS_MEDIAWIKI )
+               );
                $this->output( "...Done!\n" );
        }
 }
diff --git a/maintenance/updateSearchIndex.php 
b/maintenance/updateSearchIndex.php
index 0691bee..68a51bd 100644
--- a/maintenance/updateSearchIndex.php
+++ b/maintenance/updateSearchIndex.php
@@ -42,8 +42,18 @@
                $this->mDescription = "Script for periodic off-peak updating of 
the search index";
                $this->addOption( 's', 'starting timestamp', false, true );
                $this->addOption( 'e', 'Ending timestamp', false, true );
-               $this->addOption( 'p', 'File for saving/loading timestamps, 
searchUpdate.WIKI_ID.pos by default', false, true );
-               $this->addOption( 'l', 'How long the searchindex and revision 
tables will be locked for', false, true );
+               $this->addOption(
+                       'p',
+                       'File for saving/loading timestamps, 
searchUpdate.WIKI_ID.pos by default',
+                       false,
+                       true
+               );
+               $this->addOption(
+                       'l',
+                       'How long the searchindex and revision tables will be 
locked for',
+                       false,
+                       true
+               );
        }
 
        public function getDbType() {
diff --git a/maintenance/userDupes.inc b/maintenance/userDupes.inc
index bd3338a..bc8fbcf 100644
--- a/maintenance/userDupes.inc
+++ b/maintenance/userDupes.inc
@@ -125,7 +125,8 @@
 
                if ( $this->reassigned > 0 ) {
                        if ( $doDelete ) {
-                               $this->out( "$this->reassigned duplicate 
accounts had edits reassigned to a canonical record id.\n" );
+                               $this->out( "$this->reassigned duplicate 
accounts had edits "
+                                       . "reassigned to a canonical record 
id.\n" );
                        } else {
                                $this->out( "$this->reassigned duplicate 
accounts need to have edits reassigned.\n" );
                        }
@@ -133,9 +134,11 @@
 
                if ( $this->trimmed > 0 ) {
                        if ( $doDelete ) {
-                               $this->out( "$this->trimmed duplicate user 
records were deleted from " . wfWikiID() . ".\n" );
+                               $this->out( "$this->trimmed duplicate user 
records were deleted from "
+                                       . wfWikiID() . ".\n" );
                        } else {
-                               $this->out( "$this->trimmed duplicate user 
accounts were found on " . wfWikiID() . " which can be removed safely.\n" );
+                               $this->out( "$this->trimmed duplicate user 
accounts were found on "
+                                       . wfWikiID() . " which can be removed 
safely.\n" );
                        }
                }
 
diff --git a/maintenance/userOptions.inc b/maintenance/userOptions.inc
index 5d11352..5998cb5 100644
--- a/maintenance/userOptions.inc
+++ b/maintenance/userOptions.inc
@@ -155,7 +155,9 @@
 
                                $userValue = $user->getOption( $this->mAnOption 
);
                                if ( $userValue <> 
$defaultOptions[$this->mAnOption] ) {
+                                       // @codingStandardsIgnoreStart Ignore 
silencing errors is discouraged warning
                                        @$ret[$this->mAnOption][$userValue]++;
+                                       // @codingStandardsIgnoreEnd
                                }
 
                        } else {
@@ -163,7 +165,9 @@
                                foreach ( $defaultOptions as $name => 
$defaultValue ) {
                                        $userValue = $user->getOption( $name );
                                        if ( $userValue <> $defaultValue ) {
+                                               // @codingStandardsIgnoreStart 
Ignore silencing errors is discouraged warning
                                                @$ret[$name][$userValue]++;
+                                               // @codingStandardsIgnoreEnd
                                        }
                                }
                        }
@@ -200,7 +204,8 @@
                        if ( $curValue == $this->mOldValue ) {
 
                                if ( !$this->mQuiet ) {
-                                       print "Setting {$this->mAnOption} for 
$username from '{$this->mOldValue}' to '{$this->mNewValue}'): ";
+                                       print "Setting {$this->mAnOption} for 
$username from '{$this->mOldValue}' " .
+                                               "to '{$this->mNewValue}'): ";
                                }
 
                                // Change value

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ib68a7cf4251e8f4c71233df869673f4c5d3cf84c
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Siebrand <siebr...@kitano.nl>
Gerrit-Reviewer: Chad <ch...@wikimedia.org>
Gerrit-Reviewer: Krinkle <krinklem...@gmail.com>
Gerrit-Reviewer: Parent5446 <tylerro...@gmail.com>
Gerrit-Reviewer: Siebrand <siebr...@kitano.nl>
Gerrit-Reviewer: jenkins-bot <>

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

Reply via email to