Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
6 / 6
100.00% covered (success)
100.00%
1 / 1
CRAP
100.00% covered (success)
100.00%
1 / 1
Hooks
100.00% covered (success)
100.00%
6 / 6
100.00% covered (success)
100.00%
1 / 1
2
100.00% covered (success)
100.00%
1 / 1
 onScribuntoExternalLibraries
100.00% covered (success)
100.00%
6 / 6
100.00% covered (success)
100.00%
1 / 1
2
1<?php
2declare( strict_types = 1 );
3/**
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License along
15 * with this program; if not, write to the Free Software Foundation, Inc.,
16 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17 *
18 * @file
19 */
20
21namespace MediaWiki\Extension\Toolhub;
22
23class Hooks {
24
25    /**
26     * Register external libraries for Scribunto.
27     *
28     * @param string $engine
29     * @param string[] &$extraLibraries
30     */
31    public function onScribuntoExternalLibraries(
32        string $engine,
33        array &$extraLibraries
34    ): void {
35        if ( $engine !== 'lua' ) {
36            return;
37        }
38        $extraLibraries[ 'mw.ext.toolhub' ] = [
39            'class' => CoreLibrary::class,
40            'deferLoad' => true,
41        ];
42    }
43
44}