Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
5 / 5
100.00% covered (success)
100.00%
2 / 2
CRAP
100.00% covered (success)
100.00%
1 / 1
HookRunner
100.00% covered (success)
100.00%
5 / 5
100.00% covered (success)
100.00%
2 / 2
2
100.00% covered (success)
100.00%
1 / 1
 __construct
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 onCodeEditorGetPageLanguage
100.00% covered (success)
100.00%
4 / 4
100.00% covered (success)
100.00%
1 / 1
1
1<?php
2
3namespace MediaWiki\Extension\CodeEditor\Hooks;
4
5use MediaWiki\HookContainer\HookContainer;
6use MediaWiki\Title\Title;
7
8/**
9 * This is a hook runner class, see docs/Hooks.md in core.
10 * @internal
11 */
12class HookRunner implements
13    CodeEditorGetPageLanguageHook
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 onCodeEditorGetPageLanguage( Title $title, ?string &$lang, string $model, string $format ) {
25        return $this->hookContainer->run(
26            'CodeEditorGetPageLanguage',
27            [ $title, &$lang, $model, $format ]
28        );
29    }
30}