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

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


build: Updating mediawiki/mediawiki-codesniffer to 0.12.0

Change-Id: Iefaae5043fa77d5d556c31079549dab8f61bd3ef
---
M composer.json
M includes/OutputPage.php
M includes/libs/filebackend/FileBackendStore.php
M includes/libs/objectcache/BagOStuff.php
M includes/libs/objectcache/MemcachedBagOStuff.php
M includes/libs/objectcache/WANObjectCache.php
M includes/libs/rdbms/TransactionProfiler.php
M includes/libs/rdbms/database/Database.php
M includes/libs/rdbms/loadmonitor/LoadMonitor.php
M includes/parser/ParserOutput.php
M phpcs.xml
M tests/phpunit/includes/GlobalFunctions/wfTimestampTest.php
M tests/phpunit/includes/libs/objectcache/WANObjectCacheTest.php
M tests/phpunit/includes/libs/rdbms/TransactionProfilerTest.php
M tests/phpunit/includes/libs/rdbms/database/DatabaseMysqlBaseTest.php
15 files changed, 34 insertions(+), 31 deletions(-)

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



diff --git a/composer.json b/composer.json
index dd7567c..70d2e8f 100644
--- a/composer.json
+++ b/composer.json
@@ -54,7 +54,7 @@
                "jakub-onderka/php-parallel-lint": "0.9.2",
                "jetbrains/phpstorm-stubs": 
"dev-master#1b9906084d6635456fcf3f3a01f0d7d5b99a578a",
                "justinrainbow/json-schema": "~5.2",
-               "mediawiki/mediawiki-codesniffer": "0.11.0",
+               "mediawiki/mediawiki-codesniffer": "0.12.0",
                "monolog/monolog": "~1.22.1",
                "nikic/php-parser": "2.1.0",
                "nmred/kafka-php": "0.1.5",
diff --git a/includes/OutputPage.php b/includes/OutputPage.php
index dd21194..b71ae89 100644
--- a/includes/OutputPage.php
+++ b/includes/OutputPage.php
@@ -2013,7 +2013,7 @@
                }
 
                $age = time() - wfTimestamp( TS_UNIX, $mtime );
-               $adaptiveTTL = max( .9 * $age, $minTTL );
+               $adaptiveTTL = max( 0.9 * $age, $minTTL );
                $adaptiveTTL = min( $adaptiveTTL, $maxTTL );
 
                $this->lowerCdnMaxage( (int)$adaptiveTTL );
diff --git a/includes/libs/filebackend/FileBackendStore.php 
b/includes/libs/filebackend/FileBackendStore.php
index 77473d1..b8eec3f 100644
--- a/includes/libs/filebackend/FileBackendStore.php
+++ b/includes/libs/filebackend/FileBackendStore.php
@@ -1714,7 +1714,7 @@
                        return; // invalid storage path
                }
                $mtime = ConvertibleTimestamp::convert( TS_UNIX, $val['mtime'] 
);
-               $ttl = $this->memCache->adaptiveTTL( $mtime, 7 * 86400, 300, .1 
);
+               $ttl = $this->memCache->adaptiveTTL( $mtime, 7 * 86400, 300, 
0.1 );
                $key = $this->fileCacheKey( $path );
                // Set the cache unless it is currently salted.
                $this->memCache->set( $key, $val, $ttl );
diff --git a/includes/libs/objectcache/BagOStuff.php 
b/includes/libs/objectcache/BagOStuff.php
index f834ccf..8a23db5 100644
--- a/includes/libs/objectcache/BagOStuff.php
+++ b/includes/libs/objectcache/BagOStuff.php
@@ -476,7 +476,7 @@
                $lSince = microtime( true ); // lock timestamp
 
                return new ScopedCallback( function () use ( $key, $lSince, 
$expiry ) {
-                       $latency = .050; // latency skew (err towards keeping 
lock present)
+                       $latency = 0.050; // latency skew (err towards keeping 
lock present)
                        $age = ( microtime( true ) - $lSince + $latency );
                        if ( ( $age + $latency ) >= $expiry ) {
                                $this->logger->warning( "Lock for $key held too 
long ($age sec)." );
diff --git a/includes/libs/objectcache/MemcachedBagOStuff.php 
b/includes/libs/objectcache/MemcachedBagOStuff.php
index 5128d82..0188991 100644
--- a/includes/libs/objectcache/MemcachedBagOStuff.php
+++ b/includes/libs/objectcache/MemcachedBagOStuff.php
@@ -45,7 +45,7 @@
        protected function applyDefaultParams( $params ) {
                return $params + [
                        'compress_threshold' => 1500,
-                       'connect_timeout' => .5,
+                       'connect_timeout' => 0.5,
                        'debug' => false
                ];
        }
diff --git a/includes/libs/objectcache/WANObjectCache.php 
b/includes/libs/objectcache/WANObjectCache.php
index c1c9cc1..1f757a4 100644
--- a/includes/libs/objectcache/WANObjectCache.php
+++ b/includes/libs/objectcache/WANObjectCache.php
@@ -1424,7 +1424,7 @@
         * @return int Adaptive TTL
         * @since 1.28
         */
-       public function adaptiveTTL( $mtime, $maxTTL, $minTTL = 30, $factor = 
.2 ) {
+       public function adaptiveTTL( $mtime, $maxTTL, $minTTL = 30, $factor = 
0.2 ) {
                if ( is_float( $mtime ) || ctype_digit( $mtime ) ) {
                        $mtime = (int)$mtime; // handle fractional seconds and 
string integers
                }
diff --git a/includes/libs/rdbms/TransactionProfiler.php 
b/includes/libs/rdbms/TransactionProfiler.php
index af431a6..57a12a4 100644
--- a/includes/libs/rdbms/TransactionProfiler.php
+++ b/includes/libs/rdbms/TransactionProfiler.php
@@ -39,7 +39,7 @@
        /** @var float Seconds */
        protected $dbLockThreshold = 3.0;
        /** @var float Seconds */
-       protected $eventThreshold = .25;
+       protected $eventThreshold = 0.25;
        /** @var bool */
        protected $silenced = false;
 
diff --git a/includes/libs/rdbms/database/Database.php 
b/includes/libs/rdbms/database/Database.php
index 2c66d74..c904092 100644
--- a/includes/libs/rdbms/database/Database.php
+++ b/includes/libs/rdbms/database/Database.php
@@ -54,8 +54,8 @@
        const PING_TTL = 1.0;
        const PING_QUERY = 'SELECT 1 AS ping';
 
-       const TINY_WRITE_SEC = .010;
-       const SLOW_WRITE_SEC = .500;
+       const TINY_WRITE_SEC = 0.010;
+       const SLOW_WRITE_SEC = 0.500;
        const SMALL_WRITE_ROWS = 100;
 
        /** @var string SQL query */
diff --git a/includes/libs/rdbms/loadmonitor/LoadMonitor.php 
b/includes/libs/rdbms/loadmonitor/LoadMonitor.php
index fdc5ac8..8292c03 100644
--- a/includes/libs/rdbms/loadmonitor/LoadMonitor.php
+++ b/includes/libs/rdbms/loadmonitor/LoadMonitor.php
@@ -157,7 +157,7 @@
                        $newWeight = $movAveRatio * $coefficient + ( 1 - 
$movAveRatio ) * $lastWeight;
 
                        // Scale from 10% to 100% of nominal weight
-                       $weightScales[$i] = max( $newWeight, .10 );
+                       $weightScales[$i] = max( $newWeight, 0.10 );
 
                        if ( !$conn ) {
                                $lagTimes[$i] = false;
diff --git a/includes/parser/ParserOutput.php b/includes/parser/ParserOutput.php
index 2981748..06319e5 100644
--- a/includes/parser/ParserOutput.php
+++ b/includes/parser/ParserOutput.php
@@ -223,7 +223,7 @@
        // finalizeAdaptiveCacheExpiry() uses TTL = MAX( m * PARSE_TIME + b, 
MIN_AR_TTL)
        // Current values imply that m=3933.333333 and b=-333.333333
        // See https://www.nngroup.com/articles/website-response-times/
-       const PARSE_FAST_SEC = .100; // perceived "fast" page parse
+       const PARSE_FAST_SEC = 0.100; // perceived "fast" page parse
        const PARSE_SLOW_SEC = 1.0; // perceived "slow" page parse
        const FAST_AR_TTL = 60; // adaptive TTL for "fast" pages
        const SLOW_AR_TTL = 3600; // adaptive TTL for "slow" pages
diff --git a/phpcs.xml b/phpcs.xml
index 4c5266e..bd9890b 100644
--- a/phpcs.xml
+++ b/phpcs.xml
@@ -20,6 +20,9 @@
                <exclude name="MediaWiki.Usage.DbrQueryUsage.DbrQueryFound" />
                <exclude 
name="MediaWiki.Usage.ExtendClassUsage.FunctionVarUsage" />
                <exclude name="MediaWiki.Usage.SuperGlobalsUsage.SuperGlobals" 
/>
+               <exclude name="MediaWiki.Files.ClassMatchesFilename.WrongCase" 
/>
+               <exclude name="MediaWiki.Files.ClassMatchesFilename.NotMatch" />
+               <exclude name="MediaWiki.Files.OneClassPerFile.MultipleFound" />
        </rule>
        <rule ref="MediaWiki.NamingConventions.PrefixedGlobalFunctions">
                <properties>
diff --git a/tests/phpunit/includes/GlobalFunctions/wfTimestampTest.php 
b/tests/phpunit/includes/GlobalFunctions/wfTimestampTest.php
index b6682f7..a70f136 100644
--- a/tests/phpunit/includes/GlobalFunctions/wfTimestampTest.php
+++ b/tests/phpunit/includes/GlobalFunctions/wfTimestampTest.php
@@ -21,7 +21,7 @@
                        [ -30281104, TS_MW, '19690115123456', 'Negative TS_UNIX 
to TS_MW' ],
                        [ $t, TS_UNIX, 979562096, 'TS_UNIX to TS_UNIX' ],
                        [ $t, TS_DB, '2001-01-15 12:34:56', 'TS_UNIX to TS_DB' 
],
-                       [ $t + .01, TS_MW, '20010115123456', 'TS_UNIX float to 
TS_MW' ],
+                       [ $t + 0.01, TS_MW, '20010115123456', 'TS_UNIX float to 
TS_MW' ],
 
                        [ $t, TS_ISO_8601_BASIC, '20010115T123456Z', 
'TS_ISO_8601_BASIC to TS_DB' ],
 
diff --git a/tests/phpunit/includes/libs/objectcache/WANObjectCacheTest.php 
b/tests/phpunit/includes/libs/objectcache/WANObjectCacheTest.php
index 881ace2..c762aa7 100644
--- a/tests/phpunit/includes/libs/objectcache/WANObjectCacheTest.php
+++ b/tests/phpunit/includes/libs/objectcache/WANObjectCacheTest.php
@@ -1184,11 +1184,11 @@
 
        public static function provideAdaptiveTTL() {
                return [
-                       [ 3600, 900, 30, .2, 720 ],
-                       [ 3600, 500, 30, .2, 500 ],
-                       [ 3600, 86400, 800, .2, 800 ],
-                       [ false, 86400, 800, .2, 800 ],
-                       [ null, 86400, 800, .2, 800 ]
+                       [ 3600, 900, 30, 0.2, 720 ],
+                       [ 3600, 500, 30, 0.2, 500 ],
+                       [ 3600, 86400, 800, 0.2, 800 ],
+                       [ false, 86400, 800, 0.2, 800 ],
+                       [ null, 86400, 800, 0.2, 800 ]
                ];
        }
 
diff --git a/tests/phpunit/includes/libs/rdbms/TransactionProfilerTest.php 
b/tests/phpunit/includes/libs/rdbms/TransactionProfilerTest.php
index cb18fb3..b6ea426 100644
--- a/tests/phpunit/includes/libs/rdbms/TransactionProfilerTest.php
+++ b/tests/phpunit/includes/libs/rdbms/TransactionProfilerTest.php
@@ -112,10 +112,10 @@
                $tp->setLogger( $logger );
                $tp->setExpectation( 'queries', 2, __METHOD__ );
 
-               $tp->recordQueryCompletion( "SQL 1", microtime( true ) - .01, 
false, 0 );
-               $tp->recordQueryCompletion( "SQL 2", microtime( true ) - .01, 
false, 0 );
-               $tp->recordQueryCompletion( "SQL 3", microtime( true ) - .01, 
false, 0 ); // warn
-               $tp->recordQueryCompletion( "SQL 4", microtime( true ) - .01, 
false, 0 ); // warn
+               $tp->recordQueryCompletion( "SQL 1", microtime( true ) - 0.01, 
false, 0 );
+               $tp->recordQueryCompletion( "SQL 2", microtime( true ) - 0.01, 
false, 0 );
+               $tp->recordQueryCompletion( "SQL 3", microtime( true ) - 0.01, 
false, 0 ); // warn
+               $tp->recordQueryCompletion( "SQL 4", microtime( true ) - 0.01, 
false, 0 ); // warn
        }
 
        public function testWriteQueryCount() {
@@ -126,16 +126,16 @@
                $tp->setLogger( $logger );
                $tp->setExpectation( 'writes', 2, __METHOD__ );
 
-               $tp->recordQueryCompletion( "SQL 1", microtime( true ) - .01, 
false, 0 );
-               $tp->recordQueryCompletion( "SQL 2", microtime( true ) - .01, 
false, 0 );
-               $tp->recordQueryCompletion( "SQL 3", microtime( true ) - .01, 
false, 0 );
-               $tp->recordQueryCompletion( "SQL 4", microtime( true ) - .01, 
false, 0 );
+               $tp->recordQueryCompletion( "SQL 1", microtime( true ) - 0.01, 
false, 0 );
+               $tp->recordQueryCompletion( "SQL 2", microtime( true ) - 0.01, 
false, 0 );
+               $tp->recordQueryCompletion( "SQL 3", microtime( true ) - 0.01, 
false, 0 );
+               $tp->recordQueryCompletion( "SQL 4", microtime( true ) - 0.01, 
false, 0 );
 
                $tp->transactionWritingIn( 'srv1', 'db1', '123' );
-               $tp->recordQueryCompletion( "SQL 1w", microtime( true ) - .01, 
true, 2 );
-               $tp->recordQueryCompletion( "SQL 2w", microtime( true ) - .01, 
true, 5 );
-               $tp->recordQueryCompletion( "SQL 3w", microtime( true ) - .01, 
true, 3 );
-               $tp->recordQueryCompletion( "SQL 4w", microtime( true ) - .01, 
true, 1 );
+               $tp->recordQueryCompletion( "SQL 1w", microtime( true ) - 0.01, 
true, 2 );
+               $tp->recordQueryCompletion( "SQL 2w", microtime( true ) - 0.01, 
true, 5 );
+               $tp->recordQueryCompletion( "SQL 3w", microtime( true ) - 0.01, 
true, 3 );
+               $tp->recordQueryCompletion( "SQL 4w", microtime( true ) - 0.01, 
true, 1 );
                $tp->transactionWritingOut( 'srv1', 'db1', '123', 1, 1 );
        }
 }
diff --git 
a/tests/phpunit/includes/libs/rdbms/database/DatabaseMysqlBaseTest.php 
b/tests/phpunit/includes/libs/rdbms/database/DatabaseMysqlBaseTest.php
index b564310..456447f 100644
--- a/tests/phpunit/includes/libs/rdbms/database/DatabaseMysqlBaseTest.php
+++ b/tests/phpunit/includes/libs/rdbms/database/DatabaseMysqlBaseTest.php
@@ -352,8 +352,8 @@
                $db->setLBInfo( 'clusterMasterHost', 'db1052' );
                $lagEst = $db->getLag();
 
-               $this->assertGreaterThan( $lag - .010, $lagEst, "Correct 
heatbeat lag" );
-               $this->assertLessThan( $lag + .010, $lagEst, "Correct heatbeat 
lag" );
+               $this->assertGreaterThan( $lag - 0.010, $lagEst, "Correct 
heatbeat lag" );
+               $this->assertLessThan( $lag + 0.010, $lagEst, "Correct heatbeat 
lag" );
        }
 
        public static function provideLagAmounts() {

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Iefaae5043fa77d5d556c31079549dab8f61bd3ef
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Umherirrender <umherirrender_de...@web.de>
Gerrit-Reviewer: C. Scott Ananian <canan...@wikimedia.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