mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Math
synced 2024-11-27 17:01:07 +00:00
Replace deprecated Hooks::run
Bug: T335536 Change-Id: I6968c26df6819f0c83105e92c03d1d204f90db27
This commit is contained in:
parent
037830b2d4
commit
35660f4e78
|
@ -39,7 +39,8 @@
|
|||
"class": "MediaWiki\\Extension\\Math\\HookHandlers\\ParserHooksHandler",
|
||||
"services": [
|
||||
"Math.RendererFactory",
|
||||
"UserOptionsLookup"
|
||||
"UserOptionsLookup",
|
||||
"HookContainer"
|
||||
]
|
||||
},
|
||||
"PreferencesHooksHandler": {
|
||||
|
|
|
@ -3,7 +3,6 @@
|
|||
namespace MediaWiki\Extension\Math\HookHandlers;
|
||||
|
||||
use FatalError;
|
||||
use Hooks as MWHooks;
|
||||
use MediaWiki\Extension\Math\MathConfig;
|
||||
use MediaWiki\Extension\Math\MathMathML;
|
||||
use MediaWiki\Extension\Math\MathMathMLCli;
|
||||
|
@ -12,6 +11,7 @@ use MediaWiki\Extension\Math\Render\RendererFactory;
|
|||
use MediaWiki\Hook\ParserAfterTidyHook;
|
||||
use MediaWiki\Hook\ParserFirstCallInitHook;
|
||||
use MediaWiki\Hook\ParserOptionsRegisterHook;
|
||||
use MediaWiki\HookContainer\HookContainer;
|
||||
use MediaWiki\Logger\LoggerFactory;
|
||||
use MediaWiki\User\UserOptionsLookup;
|
||||
use MWException;
|
||||
|
@ -39,16 +39,22 @@ class ParserHooksHandler implements
|
|||
/** @var UserOptionsLookup */
|
||||
private $userOptionsLookup;
|
||||
|
||||
/** @var HookContainer */
|
||||
private $hookContainer;
|
||||
|
||||
/**
|
||||
* @param RendererFactory $rendererFactory
|
||||
* @param UserOptionsLookup $userOptionsLookup
|
||||
* @param HookContainer $hookContainer
|
||||
*/
|
||||
public function __construct(
|
||||
RendererFactory $rendererFactory,
|
||||
UserOptionsLookup $userOptionsLookup
|
||||
UserOptionsLookup $userOptionsLookup,
|
||||
HookContainer $hookContainer
|
||||
) {
|
||||
$this->rendererFactory = $rendererFactory;
|
||||
$this->userOptionsLookup = $userOptionsLookup;
|
||||
$this->hookContainer = $hookContainer;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -132,8 +138,8 @@ class ParserHooksHandler implements
|
|||
$renderer->addTrackingCategories( $parser );
|
||||
return $renderer->getLastError();
|
||||
}
|
||||
// TODO: Convert to a new style hook system and inject HookContainer
|
||||
MWHooks::run( 'MathFormulaPostRender',
|
||||
// TODO: Convert to a new style hook system
|
||||
$this->hookContainer->run( 'MathFormulaPostRender',
|
||||
[ $parser, $renderer, &$renderedMath ]
|
||||
); // Enables indexing of math formula
|
||||
|
||||
|
|
Loading…
Reference in a new issue