Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
n/a
0 / 0
n/a
0 / 0
CRAP
n/a
0 / 0
1<?php
2
3namespace MediaWiki\Extension\CentralAuth;
4
5use MediaWiki\Config\ServiceOptions;
6use MediaWiki\Extension\CentralAuth\GlobalGroup\GlobalGroupLookup;
7use MediaWiki\Extension\CentralAuth\GlobalRename\GlobalRenameDenylist;
8use MediaWiki\Extension\CentralAuth\GlobalRename\GlobalRenameFactory;
9use MediaWiki\Extension\CentralAuth\GlobalRename\GlobalRenameRequestStore;
10use MediaWiki\Extension\CentralAuth\GlobalRename\GlobalRenameUserValidator;
11use MediaWiki\Extension\CentralAuth\User\CentralAuthAntiSpoofManager;
12use MediaWiki\Extension\CentralAuth\User\CentralAuthForcedLocalCreationService;
13use MediaWiki\Extension\CentralAuth\User\GlobalUserSelectQueryBuilderFactory;
14use MediaWiki\Logger\LoggerFactory;
15use MediaWiki\MediaWikiServices;
16
17// PHPUnit does not understand coverage for this file.
18// It is covered though, see CentralAuthServiceWiringTest.
19// @codeCoverageIgnoreStart
20
21return [
22    'CentralAuth.CentralAuthAntiSpoofManager' => static function (
23        MediaWikiServices $services
24    ): CentralAuthAntiSpoofManager {
25        return new CentralAuthAntiSpoofManager(
26            new ServiceOptions( CentralAuthAntiSpoofManager::CONSTRUCTOR_OPTIONS, $services->getMainConfig() ),
27            LoggerFactory::getInstance( 'antispoof' ),
28            $services->getDBLoadBalancerFactory(),
29            CentralAuthServices::getDatabaseManager( $services )
30        );
31    },
32    'CentralAuth.CentralAuthDatabaseManager' => static function (
33        MediaWikiServices $services
34    ): CentralAuthDatabaseManager {
35        return new CentralAuthDatabaseManager(
36            new ServiceOptions( CentralAuthDatabaseManager::CONSTRUCTOR_OPTIONS, $services->getMainConfig() ),
37            $services->getDBLoadBalancerFactory(),
38            $services->getReadOnlyMode()
39        );
40    },
41    'CentralAuth.CentralAuthEditCounter' => static function (
42        MediaWikiServices $services
43    ): CentralAuthEditCounter {
44        return new CentralAuthEditCounter(
45            CentralAuthServices::getDatabaseManager( $services ),
46            $services->getMainWANObjectCache()
47        );
48    },
49    'CentralAuth.CentralAuthForcedLocalCreationService' => static function (
50        MediaWikiServices $services
51    ): CentralAuthForcedLocalCreationService {
52        return new CentralAuthForcedLocalCreationService(
53            $services->getUserFactory(),
54            CentralAuthServices::getUtilityService( $services )
55        );
56    },
57    'CentralAuth.CentralAuthSessionManager' => static function (
58        MediaWikiServices $services
59    ): CentralAuthSessionManager {
60        return new CentralAuthSessionManager(
61            new ServiceOptions(
62                CentralAuthSessionManager::CONSTRUCTOR_OPTIONS,
63                $services->getMainConfig()
64            ),
65            $services->getStatsdDataFactory(),
66            $services->getStatsFactory(),
67            $services->getMicroStash()
68        );
69    },
70    'CentralAuth.CentralAuthUIService' => static function (
71        MediaWikiServices $services
72    ): CentralAuthUIService {
73        return new CentralAuthUIService(
74            $services->getTitleFactory()
75        );
76    },
77    'CentralAuth.CentralAuthUtilityService' => static function (
78        MediaWikiServices $services
79    ): CentralAuthUtilityService {
80        return new CentralAuthUtilityService(
81            $services->getMainConfig(),
82            $services->getAuthManager(),
83            $services->getTitleFactory(),
84            $services->getJobQueueGroupFactory(),
85            $services->getJobFactory(),
86            LoggerFactory::getInstance( 'CentralAuth' )
87        );
88    },
89    'CentralAuth.CentralAuthWikiListService' => static function (
90        MediaWikiServices $services
91    ): CentralAuthWikiListService {
92        return new CentralAuthWikiListService(
93            new ServiceOptions( CentralAuthWikiListService::CONSTRUCTOR_OPTIONS, $services->getMainConfig() ),
94            $services->getHookContainer()
95        );
96    },
97    'CentralAuth.GlobalRenameDenylist' => static function ( MediaWikiServices $services ): GlobalRenameDenylist {
98        $config = $services->getMainConfig();
99        return new GlobalRenameDenylist(
100            LoggerFactory::getInstance( 'CentralAuth' ),
101            $services->getHttpRequestFactory(),
102            $services->getWikiPageFactory(),
103            $config->get( 'GlobalRenameDenylist' )
104        );
105    },
106    'CentralAuth.GlobalRenameRequestStore' => static function (
107        MediaWikiServices $services
108    ): GlobalRenameRequestStore {
109        return new GlobalRenameRequestStore(
110            CentralAuthServices::getDatabaseManager( $services ),
111            $services->getUserNameUtils()
112        );
113    },
114    'CentralAuth.GlobalRenameUserValidator' => static function (
115        MediaWikiServices $services
116    ): GlobalRenameUserValidator {
117        return new GlobalRenameUserValidator(
118            $services->getUserNameUtils()
119        );
120    },
121    'CentralAuth.GlobalGroupLookup' => static function ( MediaWikiServices $services ): GlobalGroupLookup {
122        return new GlobalGroupLookup(
123            CentralAuthServices::getDatabaseManager( $services )
124        );
125    },
126    'CentralAuth.GlobalRenameFactory' => static function ( MediaWikiServices $services ): GlobalRenameFactory {
127        return new GlobalRenameFactory(
128            $services->getJobQueueGroupFactory(),
129            $services->getUserFactory(),
130            CentralAuthServices::getAntiSpoofManager( $services ),
131            CentralAuthServices::getDatabaseManager( $services )
132        );
133    },
134    'CentralAuth.GlobalUserSelectQueryBuilderFactory' => static function (
135        MediaWikiServices $services
136    ): GlobalUserSelectQueryBuilderFactory {
137        return new GlobalUserSelectQueryBuilderFactory(
138            CentralAuthServices::getDatabaseManager( $services )->getCentralReplicaDB(),
139            $services->getActorStore(),
140            $services->getUserNameUtils(),
141            $services->getTempUserConfig()
142        );
143    },
144];
145
146// @codeCoverageIgnoreEnd