Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
0.00% covered (danger)
0.00%
0 / 2
0.00% covered (danger)
0.00%
0 / 2
CRAP
0.00% covered (danger)
0.00%
0 / 1
ResourceLoaderConfigHandler
0.00% covered (danger)
0.00%
0 / 2
0.00% covered (danger)
0.00%
0 / 2
6
0.00% covered (danger)
0.00%
0 / 1
 __construct
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 onResourceLoaderGetConfigVars
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
1<?php
2
3namespace MediaWiki\Extension\Math\HookHandlers;
4
5use MediaWiki\Config\Config;
6use MediaWiki\Extension\Math\MathConfig;
7use MediaWiki\ResourceLoader\Hook\ResourceLoaderGetConfigVarsHook;
8
9class ResourceLoaderConfigHandler implements
10    ResourceLoaderGetConfigVarsHook
11{
12
13    /** @var MathConfig */
14    private $mathConfig;
15
16    /**
17     * @param MathConfig $mathConfig
18     */
19    public function __construct(
20        MathConfig $mathConfig
21    ) {
22        $this->mathConfig = $mathConfig;
23    }
24
25    public function onResourceLoaderGetConfigVars( array &$vars, $skin, Config $config ): void {
26        $vars['wgMathEntitySelectorUrl'] = $this->mathConfig->getMathEntitySelectorUrl();
27    }
28}