Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
9 / 9
100.00% covered (success)
100.00%
3 / 3
CRAP
100.00% covered (success)
100.00%
1 / 1
HookRunner
100.00% covered (success)
100.00%
9 / 9
100.00% covered (success)
100.00%
3 / 3
3
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
 onCommunityConfigurationSchemaBeforeEditor
100.00% covered (success)
100.00%
4 / 4
100.00% covered (success)
100.00%
1 / 1
1
 onCommunityConfigurationProvider_initList
100.00% covered (success)
100.00%
4 / 4
100.00% covered (success)
100.00%
1 / 1
1
1<?php
2
3namespace MediaWiki\Extension\CommunityConfiguration\Hooks;
4
5use MediaWiki\Extension\CommunityConfiguration\Provider\IConfigurationProvider;
6use MediaWiki\HookContainer\HookContainer;
7
8/**
9 * This is a hook runner class, see docs/Hooks.md in core.
10 *
11 * @internal
12 */
13class HookRunner implements
14    CommunityConfigurationSchemaBeforeEditorHook,
15    CommunityConfigurationProvider_initListHook
16{
17
18    private HookContainer $hookContainer;
19
20    public function __construct( HookContainer $hookContainer ) {
21        $this->hookContainer = $hookContainer;
22    }
23
24    /**
25     * @inheritDoc
26     */
27    public function onCommunityConfigurationSchemaBeforeEditor(
28        IConfigurationProvider $provider,
29        array &$rootSchema
30    ) {
31        return $this->hookContainer->run(
32            'CommunityConfigurationSchemaBeforeEditor',
33            [ $provider, &$rootSchema ]
34        );
35    }
36
37    /**
38     * @inheritDoc
39     */
40    public function onCommunityConfigurationProvider_initList( array &$providers ) {
41        return $this->hookContainer->run(
42            'CommunityConfigurationProvider_initList',
43            [ &$providers ]
44        );
45    }
46}