Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
0.00% covered (danger)
0.00%
0 / 23
0.00% covered (danger)
0.00%
0 / 2
CRAP
0.00% covered (danger)
0.00%
0 / 1
SpecialPageInitHookHandler
0.00% covered (danger)
0.00%
0 / 23
0.00% covered (danger)
0.00%
0 / 2
12
0.00% covered (danger)
0.00%
0 / 1
 __construct
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 onSpecialPage_initList
0.00% covered (danger)
0.00%
0 / 22
0.00% covered (danger)
0.00%
0 / 1
6
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\CentralAuth\Hooks\Handlers;
22
23use MediaWiki\Config\Config;
24use MediaWiki\Extension\CentralAuth\Special\SpecialGlobalRenameQueue;
25use MediaWiki\Extension\CentralAuth\Special\SpecialGlobalRenameRequest;
26use MediaWiki\SpecialPage\Hook\SpecialPage_initListHook;
27
28class SpecialPageInitHookHandler implements
29    SpecialPage_initListHook
30{
31    /** @var Config */
32    private $config;
33
34    /**
35     * @param Config $config
36     */
37    public function __construct( Config $config ) {
38        $this->config = $config;
39    }
40
41    /**
42     * @param array &$list
43     */
44    public function onSpecialPage_initList( &$list ) {
45        if ( $this->config->get( 'CentralAuthEnableGlobalRenameRequest' ) ) {
46            $list['GlobalRenameRequest'] = [
47                'class' => SpecialGlobalRenameRequest::class,
48                'services' => [
49                    'CentralAuth.GlobalRenameDenylist',
50                    'UserNameUtils',
51                    'CentralAuth.GlobalRenameRequestStore',
52                ]
53            ];
54            $list['GlobalRenameQueue'] = [
55                'class' => SpecialGlobalRenameQueue::class,
56                'services' => [
57                    'UserNameUtils',
58                    'DBLoadBalancerFactory',
59                    'CentralAuth.CentralAuthDatabaseManager',
60                    'CentralAuth.CentralAuthUIService',
61                    'CentralAuth.GlobalRenameRequestStore',
62                    'JobQueueGroupFactory',
63                    'CentralAuth.CentralAuthAntiSpoofManager',
64                    'CentralAuth.GlobalRenameFactory',
65                ],
66            ];
67        }
68    }
69}