From b654cc2b0a0e1ba99870436eb21614fae1dbb501 Mon Sep 17 00:00:00 2001 From: Umherirrender Date: Thu, 27 Apr 2023 22:51:38 +0200 Subject: [PATCH] Replace deprecated Hooks::run Bug: T335536 Change-Id: I6ef724346dd82147ef22af23833c6a0af8bc9054 --- src/MathLaTeXML.php | 4 ++-- src/MathMathML.php | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/MathLaTeXML.php b/src/MathLaTeXML.php index 860ef4bcc..15bfbe394 100644 --- a/src/MathLaTeXML.php +++ b/src/MathLaTeXML.php @@ -2,8 +2,8 @@ namespace MediaWiki\Extension\Math; -use Hooks; use MediaWiki\Logger\LoggerFactory; +use MediaWiki\MediaWikiServices; use StatusValue; /** @@ -117,7 +117,7 @@ class MathLaTeXML extends MathMathML { $this->setMathml( $jsonResult->result ); // Avoid PHP 7.1 warning from passing $this by reference $renderer = $this; - Hooks::run( 'MathRenderingResultRetrieved', + MediaWikiServices::getInstance()->getHookContainer()->run( 'MathRenderingResultRetrieved', [ &$renderer, &$jsonResult ] ); // Enables debugging of server results return StatusValue::newGood(); diff --git a/src/MathMathML.php b/src/MathMathML.php index 57110c304..067978df9 100644 --- a/src/MathMathML.php +++ b/src/MathMathML.php @@ -8,7 +8,6 @@ namespace MediaWiki\Extension\Math; -use Hooks; use Html; use MediaWiki\Logger\LoggerFactory; use MediaWiki\MediaWikiServices; @@ -548,7 +547,7 @@ class MathMathML extends MathRenderer { } // Avoid PHP 7.1 warning from passing $this by reference $renderer = $this; - Hooks::run( 'MathRenderingResultRetrieved', + MediaWikiServices::getInstance()->getHookContainer()->run( 'MathRenderingResultRetrieved', [ &$renderer, &$jsonResult ] ); // Enables debugging of server results return StatusValue::newGood(); // FIXME: empty?