Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
9 / 9
100.00% covered (success)
100.00%
2 / 2
CRAP
100.00% covered (success)
100.00%
1 / 1
HookRunner
100.00% covered (success)
100.00%
9 / 9
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
 onConfirmEditTriggersCaptcha
100.00% covered (success)
100.00%
8 / 8
100.00% covered (success)
100.00%
1 / 1
1
1<?php
2/**
3 * This program is free software; you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation; either version 2 of the License, or
6 * (at your option) any later version.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License along
14 * with this program; if not, write to the Free Software Foundation, Inc.,
15 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
16 * http://www.gnu.org/copyleft/gpl.html
17 *
18 * @file
19 */
20
21namespace MediaWiki\Extension\ConfirmEdit\Hooks;
22
23use MediaWiki\HookContainer\HookContainer;
24use MediaWiki\Page\PageIdentity;
25
26/**
27 * Run hooks provided by ConfirmEdit.
28 *
29 * @author Zabe
30 */
31class HookRunner implements
32    ConfirmEditTriggersCaptchaHook
33{
34    /** @var HookContainer */
35    private $hookContainer;
36
37    /**
38     * @param HookContainer $hookContainer
39     */
40    public function __construct( HookContainer $hookContainer ) {
41        $this->hookContainer = $hookContainer;
42    }
43
44    /**
45     * @inheritDoc
46     */
47    public function onConfirmEditTriggersCaptcha(
48        string $action,
49        ?PageIdentity $page,
50        bool &$result
51    ) {
52        $this->hookContainer->run(
53            'ConfirmEditTriggersCaptcha',
54            [
55                $action,
56                $page,
57                &$result
58            ]
59        );
60    }
61}