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