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

Change subject: Make use of the …::class feature
......................................................................


Make use of the …::class feature

Change-Id: I198e34d12aa2a1ee92b644d726ac6564e78a2957
---
M common/Hooks.php
1 file changed, 4 insertions(+), 2 deletions(-)

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



diff --git a/common/Hooks.php b/common/Hooks.php
index cf27836..9dda4b4 100644
--- a/common/Hooks.php
+++ b/common/Hooks.php
@@ -20,6 +20,8 @@
  * http://www.gnu.org/copyleft/gpl.html
  */
 
+use RunningStat\PSquare;
+
 /**
  * Hooks for the Scribunto extension.
  */
@@ -197,7 +199,7 @@
                // observations in APC, and extract the Nth percentile 
(specified
                // via $wgScribuntoSlowFunctionThreshold; defaults to 0.90).
                // We need APC and \RunningStat\PSquare to do that.
-               if ( !class_exists( '\RunningStat\PSquare' ) || $cache 
instanceof EmptyBagOStuff ) {
+               if ( !class_exists( PSquare::class ) || $cache instanceof 
EmptyBagOStuff ) {
                        return;
                }
 
@@ -207,7 +209,7 @@
                // mutual exclusion, but the only consequence is that some 
samples
                // will be dropped. We only need enough samples to estimate the
                // the shape of the data, so that's fine.
-               $ps = $cache->get( $key ) ?: new \RunningStat\PSquare( 
$threshold );
+               $ps = $cache->get( $key ) ?: new PSquare( $threshold );
                $ps->addObservation( $timing );
                $cache->set( $key, $ps, 60 );
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I198e34d12aa2a1ee92b644d726ac6564e78a2957
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Scribunto
Gerrit-Branch: master
Gerrit-Owner: Thiemo Mättig (WMDE) <thiemo.maet...@wikimedia.de>
Gerrit-Reviewer: Anomie <bjor...@wikimedia.org>
Gerrit-Reviewer: Hoo man <h...@online.de>
Gerrit-Reviewer: Jackmcbarn <jackmcb...@gmail.com>
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