Merge "User: Avoid deprecated Linker::link()"
[lhc/web/wiklou.git] / includes / diff / DifferenceEngine.php
index 148e50c..0b58cc1 100644 (file)
@@ -20,6 +20,7 @@
  * @file
  * @ingroup DifferenceEngine
  */
+use MediaWiki\MediaWikiServices;
 
 /** @deprecated use class constant instead */
 define( 'MW_DIFF_VERSION', '1.11a' );
@@ -846,13 +847,13 @@ class DifferenceEngine extends ContextSource {
         * @return bool|string
         */
        public function generateTextDiffBody( $otext, $ntext ) {
-               $diff = function() use ( $otext, $ntext ) {
+               $diff = function () use ( $otext, $ntext ) {
                        $time = microtime( true );
 
                        $result = $this->textDiff( $otext, $ntext );
 
                        $time = intval( ( microtime( true ) - $time ) * 1000 );
-                       $this->getStats()->timing( 'diff_time', $time );
+                       MediaWikiServices::getInstance()->getStatsdDataFactory()->timing( 'diff_time', $time );
                        // Log requests slower than 99th percentile
                        if ( $time > 100 && $this->mOldPage && $this->mNewPage ) {
                                wfDebugLog( 'diff',
@@ -866,7 +867,7 @@ class DifferenceEngine extends ContextSource {
                 * @param Status $status
                 * @throws FatalError
                 */
-               $error = function( $status ) {
+               $error = function ( $status ) {
                        throw new FatalError( $status->getWikiText() );
                };