Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
14 / 14
100.00% covered (success)
100.00%
14 / 14
CRAP
100.00% covered (success)
100.00%
1 / 1
GlobalBlockingServices
100.00% covered (success)
100.00%
14 / 14
100.00% covered (success)
100.00%
14 / 14
14
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
 wrap
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 getReasonFormatter
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 getGlobalBlockingConnectionProvider
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 getGlobalBlockingBlockPurger
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 getGlobalBlockLocalStatusLookup
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 getGlobalBlockLocalStatusManager
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 getGlobalBlockLookup
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 getGlobalBlockManager
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 getGlobalBlockingLinkBuilder
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 getGlobalBlockingUserVisibilityLookup
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 getGlobalAutoblockExemptionListProvider
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 getGlobalBlockDetailsRenderer
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 getGlobalBlockingExpirySelectorBuilder
100.00% covered (success)
100.00%
1 / 1
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\GlobalBlocking;
22
23use MediaWiki\Extension\GlobalBlocking\Services\GlobalBlockingBlockPurger;
24use MediaWiki\Extension\GlobalBlocking\Services\GlobalBlockingConnectionProvider;
25use MediaWiki\Extension\GlobalBlocking\Services\GlobalBlockingExpirySelectorBuilder;
26use MediaWiki\Extension\GlobalBlocking\Services\GlobalBlockingGlobalAutoblockExemptionListProvider;
27use MediaWiki\Extension\GlobalBlocking\Services\GlobalBlockingGlobalBlockDetailsRenderer;
28use MediaWiki\Extension\GlobalBlocking\Services\GlobalBlockingLinkBuilder;
29use MediaWiki\Extension\GlobalBlocking\Services\GlobalBlockingUserVisibilityLookup;
30use MediaWiki\Extension\GlobalBlocking\Services\GlobalBlockLocalStatusLookup;
31use MediaWiki\Extension\GlobalBlocking\Services\GlobalBlockLocalStatusManager;
32use MediaWiki\Extension\GlobalBlocking\Services\GlobalBlockLookup;
33use MediaWiki\Extension\GlobalBlocking\Services\GlobalBlockManager;
34use MediaWiki\Extension\GlobalBlocking\Services\GlobalBlockReasonFormatter;
35use MediaWiki\MediaWikiServices;
36
37/**
38 * @author Taavi "Majavah" Väänänen <hi@taavi.wtf>
39 */
40class GlobalBlockingServices {
41
42    /** @var MediaWikiServices */
43    private $serviceContainer;
44
45    /**
46     * @param MediaWikiServices $serviceContainer
47     */
48    public function __construct( MediaWikiServices $serviceContainer ) {
49        $this->serviceContainer = $serviceContainer;
50    }
51
52    /**
53     * Static version of the constructor, for nicer syntax.
54     * @param MediaWikiServices $serviceContainer
55     * @return static
56     */
57    public static function wrap( MediaWikiServices $serviceContainer ): GlobalBlockingServices {
58        return new static( $serviceContainer );
59    }
60
61    public function getReasonFormatter(): GlobalBlockReasonFormatter {
62        return $this->serviceContainer->get( 'GlobalBlocking.GlobalBlockReasonFormatter' );
63    }
64
65    public function getGlobalBlockingConnectionProvider(): GlobalBlockingConnectionProvider {
66        return $this->serviceContainer->get( 'GlobalBlocking.GlobalBlockingConnectionProvider' );
67    }
68
69    public function getGlobalBlockingBlockPurger(): GlobalBlockingBlockPurger {
70        return $this->serviceContainer->get( 'GlobalBlocking.GlobalBlockingBlockPurger' );
71    }
72
73    public function getGlobalBlockLocalStatusLookup(): GlobalBlockLocalStatusLookup {
74        return $this->serviceContainer->get( 'GlobalBlocking.GlobalBlockLocalStatusLookup' );
75    }
76
77    public function getGlobalBlockLocalStatusManager(): GlobalBlockLocalStatusManager {
78        return $this->serviceContainer->get( 'GlobalBlocking.GlobalBlockLocalStatusManager' );
79    }
80
81    public function getGlobalBlockLookup(): GlobalBlockLookup {
82        return $this->serviceContainer->get( 'GlobalBlocking.GlobalBlockLookup' );
83    }
84
85    public function getGlobalBlockManager(): GlobalBlockManager {
86        return $this->serviceContainer->get( 'GlobalBlocking.GlobalBlockManager' );
87    }
88
89    public function getGlobalBlockingLinkBuilder(): GlobalBlockingLinkBuilder {
90        return $this->serviceContainer->get( 'GlobalBlocking.GlobalBlockingLinkBuilder' );
91    }
92
93    public function getGlobalBlockingUserVisibilityLookup(): GlobalBlockingUserVisibilityLookup {
94        return $this->serviceContainer->get( 'GlobalBlocking.GlobalBlockingUserVisibilityLookup' );
95    }
96
97    public function getGlobalAutoblockExemptionListProvider(): GlobalBlockingGlobalAutoblockExemptionListProvider {
98        return $this->serviceContainer->get( 'GlobalBlocking.GlobalBlockingGlobalAutoblockExemptionListProvider' );
99    }
100
101    public function getGlobalBlockDetailsRenderer(): GlobalBlockingGlobalBlockDetailsRenderer {
102        return $this->serviceContainer->get( 'GlobalBlocking.GlobalBlockingGlobalBlockDetailsRenderer' );
103    }
104
105    public function getGlobalBlockingExpirySelectorBuilder(): GlobalBlockingExpirySelectorBuilder {
106        return $this->serviceContainer->get( 'GlobalBlocking.GlobalBlockingExpirySelectorBuilder' );
107    }
108}