jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/371294 )

Change subject: build: Updating mediawiki/mediawiki-codesniffer to 0.11.0
......................................................................


build: Updating mediawiki/mediawiki-codesniffer to 0.11.0

The following sniffs now pass and were enabled:
* MediaWiki.Commenting.FunctionComment.ExtraParamComment

Change-Id: I01ac0b7b3f2c2609de37730cd77633c24db1b091
---
M FlaggedRevs.setup.php
M api/reports/ApiQueryReviewedpages.php
M api/reports/ApiQueryUnreviewedpages.php
M backend/FRUserActivity.php
M backend/FlaggedRevs.hooks.php
M backend/FlaggedRevsStats.php
M composer.json
M frontend/FlaggedRevsReviewLogFormatter.php
M frontend/specialpages/reports/ValidationStatistics_body.php
M phpcs.xml
M tests/FRUserCountersTest.php
11 files changed, 25 insertions(+), 26 deletions(-)

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



diff --git a/FlaggedRevs.setup.php b/FlaggedRevs.setup.php
index 06c5347..61251d3 100644
--- a/FlaggedRevs.setup.php
+++ b/FlaggedRevs.setup.php
@@ -59,16 +59,16 @@
                $req = $wgFlaggedRevsAutoconfirm; // convenience
                if ( is_array( $req ) ) {
                        $criteria = [ '&', // AND
-                               [ APCOND_AGE, $req['days']*86400 ],
+                               [ APCOND_AGE, $req['days'] * 86400 ],
                                [ APCOND_EDITCOUNT, $req['edits'] ],
                                [ APCOND_FR_EDITSUMMARYCOUNT, 
$req['editComments'] ],
                                [ APCOND_FR_UNIQUEPAGECOUNT, 
$req['uniqueContentPages'] ],
                                [ APCOND_FR_EDITSPACING, $req['spacing'], 
$req['benchmarks'] ],
                                [ '|', // OR
                                        [ APCOND_FR_CONTENTEDITCOUNT,
-                                               $req['totalContentEdits'], 
$req['excludeLastDays']*86400 ],
+                                               $req['totalContentEdits'], 
$req['excludeLastDays'] * 86400 ],
                                        [ APCOND_FR_CHECKEDEDITCOUNT,
-                                               $req['totalCheckedEdits'], 
$req['excludeLastDays']*86400 ]
+                                               $req['totalCheckedEdits'], 
$req['excludeLastDays'] * 86400 ]
                                ],
                        ];
                        if ( $req['email'] ) {
@@ -85,8 +85,8 @@
                $req = $wgFlaggedRevsAutopromote; // convenience
                if ( is_array( $req ) ) {
                        $criteria = [ '&', // AND
-                               [ APCOND_AGE, $req['days']*86400 ],
-                               [ APCOND_FR_EDITCOUNT, $req['edits'], 
$req['excludeLastDays']*86400 ],
+                               [ APCOND_AGE, $req['days'] * 86400 ],
+                               [ APCOND_FR_EDITCOUNT, $req['edits'], 
$req['excludeLastDays'] * 86400 ],
                                [ APCOND_FR_EDITSUMMARYCOUNT, 
$req['editComments'] ],
                                [ APCOND_FR_UNIQUEPAGECOUNT, 
$req['uniqueContentPages'] ],
                                [ APCOND_FR_USERPAGEBYTES, 
$req['userpageBytes'] ],
@@ -94,9 +94,9 @@
                                [ APCOND_FR_EDITSPACING, $req['spacing'], 
$req['benchmarks'] ],
                                [ '|', // OR
                                        [ APCOND_FR_CONTENTEDITCOUNT,
-                                               $req['totalContentEdits'], 
$req['excludeLastDays']*86400 ],
+                                               $req['totalContentEdits'], 
$req['excludeLastDays'] * 86400 ],
                                        [ APCOND_FR_CHECKEDEDITCOUNT,
-                                               $req['totalCheckedEdits'], 
$req['excludeLastDays']*86400 ]
+                                               $req['totalCheckedEdits'], 
$req['excludeLastDays'] * 86400 ]
                                ],
                                [ APCOND_FR_MAXREVERTEDEDITRATIO, 
$req['maxRevertedEditRatio'] ],
                                [ '!', APCOND_ISBOT ]
diff --git a/api/reports/ApiQueryReviewedpages.php 
b/api/reports/ApiQueryReviewedpages.php
index 8ee191c..26e62ba 100644
--- a/api/reports/ApiQueryReviewedpages.php
+++ b/api/reports/ApiQueryReviewedpages.php
@@ -153,7 +153,7 @@
                                        'all'
                                ]
                        ],
-                       'filterlevel' =>  [
+                       'filterlevel' => [
                                ApiBase::PARAM_DFLT => null,
                                ApiBase::PARAM_TYPE => 'integer',
                                ApiBase::PARAM_MIN  => 0,
diff --git a/api/reports/ApiQueryUnreviewedpages.php 
b/api/reports/ApiQueryUnreviewedpages.php
index b394e65..8807c26 100644
--- a/api/reports/ApiQueryUnreviewedpages.php
+++ b/api/reports/ApiQueryUnreviewedpages.php
@@ -147,7 +147,7 @@
                                        'all'
                                ]
                        ],
-                       'filterlevel' =>  [
+                       'filterlevel' => [
                                ApiBase::PARAM_DFLT => 0,
                                ApiBase::PARAM_TYPE => 'integer',
                                ApiBase::PARAM_MIN  => 0,
diff --git a/backend/FRUserActivity.php b/backend/FRUserActivity.php
index c0c2043..fd1dc7c 100644
--- a/backend/FRUserActivity.php
+++ b/backend/FRUserActivity.php
@@ -41,7 +41,7 @@
                );
 
                # Save new value to cache (more aggresive for larger counts)
-               $wgMemc->set( $key, $count, ( $count > 100 ) ? 30*60 : 5*60 );
+               $wgMemc->set( $key, $count, ( $count > 100 ) ? 30 * 60 : 5 * 60 
);
 
                return $count;
        }
diff --git a/backend/FlaggedRevs.hooks.php b/backend/FlaggedRevs.hooks.php
index b7b7114..58f2698 100644
--- a/backend/FlaggedRevs.hooks.php
+++ b/backend/FlaggedRevs.hooks.php
@@ -1003,7 +1003,7 @@
                                break;
                        case APCOND_FR_MAXREVERTEDEDITRATIO:
                                $p = FRUserCounters::getParams( $user );
-                               $result = ( $p && 
$params[0]*$user->getEditCount() >= $p['revertedEdits'] );
+                               $result = ( $p && $params[0] * 
$user->getEditCount() >= $p['revertedEdits'] );
                                break;
                        case APCOND_FR_NEVERDEMOTED: // b/c
                                $p = FRUserCounters::getParams( $user );
diff --git a/backend/FlaggedRevsStats.php b/backend/FlaggedRevsStats.php
index 6f56139..2136e64 100644
--- a/backend/FlaggedRevsStats.php
+++ b/backend/FlaggedRevsStats.php
@@ -318,7 +318,7 @@
                $encMaxTS = $dbr->addQuotes( $dbr->timestamp( $maxTSUnix ) );
                # Use a one week time range
                $days = 7;
-               $minTSUnix = $maxTSUnix - $days*86400;
+               $minTSUnix = $maxTSUnix - $days * 86400;
                $encMinTS = $dbr->addQuotes( $dbr->timestamp( $minTSUnix ) );
                # Approximate the number rows to scan
                $rows = $dbr->estimateRowCount( 'revision', '1',
@@ -326,7 +326,7 @@
                # If the range doesn't have many rows (like on small wikis), 
use 30 days
                if ( $rows < 500 ) {
                        $days = 30;
-                       $minTSUnix = $maxTSUnix - $days*86400;
+                       $minTSUnix = $maxTSUnix - $days * 86400;
                        $encMinTS = $dbr->addQuotes( $dbr->timestamp( 
$minTSUnix ) );
                        # Approximate rows to scan
                        $rows = $dbr->estimateRowCount( 'revision', '1',
@@ -334,7 +334,7 @@
                        # If the range doesn't have many rows (like on really 
tiny wikis), use 90 days
                        if ( $rows < 500 ) {
                                $days = 90;
-                               $minTSUnix = $maxTSUnix - $days*86400;
+                               $minTSUnix = $maxTSUnix - $days * 86400;
                        }
                }
                $sampleSize = 1500; // sample size
@@ -356,9 +356,9 @@
                                        'page_namespace' => 
FlaggedRevs::getReviewNamespaces()
                                ]
                        );
-                       $stash->set( $ecKey, $edits, 14*24*3600 ); // cache for 
2 weeks
+                       $stash->set( $ecKey, $edits, 14 * 24 * 3600 ); // cache 
for 2 weeks
                }
-               $mod = max( floor( $edits/$sampleSize ), 1 ); # $mod >= 1
+               $mod = max( floor( $edits / $sampleSize ), 1 ); # $mod >= 1
                # For edits that started off pending, how long do they take to 
get reviewed?
                # Edits started off pending if made when a flagged rev of the 
page already existed.
                # Get the *first* reviewed rev *after* each edit and get the 
time difference.
@@ -406,15 +406,15 @@
                                $times[] = $time;
                        }
                        $sampleSize = count( $times );
-                       $aveRT = ( $secondsR + $secondsP )/$sampleSize; // 
sample mean
+                       $aveRT = ( $secondsR + $secondsP ) / $sampleSize; // 
sample mean
                        sort( $times ); // order smallest -> largest
                        // Sample median
-                       $rank = intval( round( count( $times )/2 + .5 ) - 1 );
+                       $rank = intval( round( count( $times ) / 2 + .5 ) - 1 );
                        $medianRT = $times[$rank];
                        // Make percentile tabulation data
                        $doPercentiles = [ 35, 45, 55, 65, 75, 85, 90, 95 ];
                        foreach ( $doPercentiles as $percentile ) {
-                               $rank = intval( round( $percentile*count( 
$times )/100 + .5 ) - 1 );
+                               $rank = intval( round( $percentile * count( 
$times ) / 100 + .5 ) - 1 );
                                $rPerTable[$percentile] = $times[$rank];
                        }
                        $result['average']       = $aveRT;
diff --git a/composer.json b/composer.json
index 91c6304..eff2a81 100644
--- a/composer.json
+++ b/composer.json
@@ -1,7 +1,7 @@
 {
        "require-dev": {
                "jakub-onderka/php-parallel-lint": "0.9.2",
-               "mediawiki/mediawiki-codesniffer": "0.10.1",
+               "mediawiki/mediawiki-codesniffer": "0.11.0",
                "jakub-onderka/php-console-highlighter": "0.3.2"
        },
        "scripts": {
diff --git a/frontend/FlaggedRevsReviewLogFormatter.php 
b/frontend/FlaggedRevsReviewLogFormatter.php
index 6a24363..ee76184 100644
--- a/frontend/FlaggedRevsReviewLogFormatter.php
+++ b/frontend/FlaggedRevsReviewLogFormatter.php
@@ -22,7 +22,7 @@
 
        public function getActionLinks() {
                $title = $this->entry->getTarget();
-               $params =  $this->entry->getParameters();
+               $params = $this->entry->getParameters();
                $links = '';
                # Show link to page with oldid=x as well as the diff to the 
former stable rev.
                # Param format is <rev id, last stable id, rev timestamp>.
diff --git a/frontend/specialpages/reports/ValidationStatistics_body.php 
b/frontend/specialpages/reports/ValidationStatistics_body.php
index 8f71023..67f68b9 100644
--- a/frontend/specialpages/reports/ValidationStatistics_body.php
+++ b/frontend/specialpages/reports/ValidationStatistics_body.php
@@ -314,7 +314,7 @@
 
                $dbr = wfGetDB( DB_SLAVE, 'vslow' );
                $limit = (int)$wgFlaggedRevsStats['topReviewersCount'];
-               $seconds = 3600*$wgFlaggedRevsStats['topReviewersHours'];
+               $seconds = 3600 * $wgFlaggedRevsStats['topReviewersHours'];
                $cutoff = $dbr->timestamp( time() - $seconds );
                $res = $dbr->select( 'logging',
                        [ 'log_user', 'COUNT(*) AS reviews' ],
diff --git a/phpcs.xml b/phpcs.xml
index 7bde2b2..1e52c60 100644
--- a/phpcs.xml
+++ b/phpcs.xml
@@ -3,7 +3,6 @@
        <rule ref="./vendor/mediawiki/mediawiki-codesniffer/MediaWiki">
                <exclude 
name="Generic.CodeAnalysis.ForLoopWithTestFunctionCall.NotAllowed"/>
                <exclude name="Squiz.Classes.ValidClassName.NotCamelCaps"/>
-               <exclude 
name="MediaWiki.Commenting.FunctionComment.ExtraParamComment" />
                <exclude 
name="MediaWiki.Commenting.FunctionComment.MissingParamComment" />
                <exclude 
name="MediaWiki.Commenting.FunctionComment.MissingParamName" />
                <exclude 
name="MediaWiki.Commenting.FunctionComment.MissingParamTag" />
diff --git a/tests/FRUserCountersTest.php b/tests/FRUserCountersTest.php
index 897a58c..ee41636 100644
--- a/tests/FRUserCountersTest.php
+++ b/tests/FRUserCountersTest.php
@@ -64,7 +64,7 @@
 
                $copyP = $p;
                FRUserCounters::updateUserParams( $copyP, $article, "Manual 
edit comment" );
-               $this->assertEquals( $p['editComments']+1, 
$copyP['editComments'], "Manual summary" );
+               $this->assertEquals( $p['editComments'] + 1, 
$copyP['editComments'], "Manual summary" );
 
                $copyP = $p;
                FRUserCounters::updateUserParams( $copyP, $article, "/* section 
*/" );
@@ -72,7 +72,7 @@
 
                $copyP = $p;
                FRUserCounters::updateUserParams( $copyP, $article, "edit 
summary" );
-               $this->assertEquals( $p['totalContentEdits']+1, 
$copyP['totalContentEdits'],
+               $this->assertEquals( $p['totalContentEdits'] + 1, 
$copyP['totalContentEdits'],
                        "Content edit count on content edit" );
 
                $expected = $p['uniqueContentPages'];
@@ -85,7 +85,7 @@
 
                $copyP = $p;
                FRUserCounters::updateUserParams( $copyP, $article, "Manual 
edit comment" );
-               $this->assertEquals( $p['editComments']+1, 
$copyP['editComments'], "Manual summary" );
+               $this->assertEquals( $p['editComments'] + 1, 
$copyP['editComments'], "Manual summary" );
 
                $copyP = $p;
                FRUserCounters::updateUserParams( $copyP, $article, "/* section 
*/" );

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I01ac0b7b3f2c2609de37730cd77633c24db1b091
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/FlaggedRevs
Gerrit-Branch: master
Gerrit-Owner: Legoktm <lego...@member.fsf.org>
Gerrit-Reviewer: Jackmcbarn <jackmcb...@gmail.com>
Gerrit-Reviewer: Legoktm <lego...@member.fsf.org>
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