Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
100.00% |
9 / 9 |
|
100.00% |
3 / 3 |
CRAP | |
100.00% |
1 / 1 |
HookRunner | |
100.00% |
9 / 9 |
|
100.00% |
3 / 3 |
3 | |
100.00% |
1 / 1 |
__construct | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
onScribuntoExternalLibraries | |
100.00% |
4 / 4 |
|
100.00% |
1 / 1 |
1 | |||
onScribuntoExternalLibraryPaths | |
100.00% |
4 / 4 |
|
100.00% |
1 / 1 |
1 |
1 | <?php |
2 | |
3 | namespace MediaWiki\Extension\Scribunto\Hooks; |
4 | |
5 | use MediaWiki\HookContainer\HookContainer; |
6 | |
7 | /** |
8 | * This is a hook runner class, see docs/Hooks.md in core. |
9 | * @internal |
10 | */ |
11 | class HookRunner implements |
12 | ScribuntoExternalLibrariesHook, |
13 | ScribuntoExternalLibraryPathsHook |
14 | { |
15 | private HookContainer $hookContainer; |
16 | |
17 | public function __construct( HookContainer $hookContainer ) { |
18 | $this->hookContainer = $hookContainer; |
19 | } |
20 | |
21 | /** |
22 | * @inheritDoc |
23 | */ |
24 | public function onScribuntoExternalLibraries( string $engine, array &$extraLibraries ) { |
25 | return $this->hookContainer->run( |
26 | 'ScribuntoExternalLibraries', |
27 | [ $engine, &$extraLibraries ] |
28 | ); |
29 | } |
30 | |
31 | /** |
32 | * @inheritDoc |
33 | */ |
34 | public function onScribuntoExternalLibraryPaths( string $engine, array &$extraLibraryPaths ) { |
35 | return $this->hookContainer->run( |
36 | 'ScribuntoExternalLibraryPaths', |
37 | [ $engine, &$extraLibraryPaths ] |
38 | ); |
39 | } |
40 | } |