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\Config\CAMainConfigNames;
7use MediaWiki\Extension\CentralAuth\GlobalGroup\GlobalGroupLookup;
8use MediaWiki\Extension\CentralAuth\GlobalRename\GlobalRenameDenylist;
9use MediaWiki\Extension\CentralAuth\GlobalRename\GlobalRenameFactory;
10use MediaWiki\Extension\CentralAuth\GlobalRename\GlobalRenameRequestStore;
11use MediaWiki\Extension\CentralAuth\GlobalRename\GlobalRenameUserValidator;
12use MediaWiki\Extension\CentralAuth\User\CentralAuthAntiSpoofManager;
13use MediaWiki\Extension\CentralAuth\User\CentralAuthForcedLocalCreationService;
14use MediaWiki\Extension\CentralAuth\User\GlobalUserSelectQueryBuilderFactory;
15use MediaWiki\Logger\LoggerFactory;
16use MediaWiki\MediaWikiServices;
17
18// PHPUnit does not understand coverage for this file.
19// It is covered though, see CentralAuthServiceWiringTest.
20// @codeCoverageIgnoreStart
21
22return [
23
24    'CentralAuth.FilteredRequestTracker' => static function (
25        MediaWikiServices $services
26    ): FilteredRequestTracker {
27        return new FilteredRequestTracker();
28    },
29
30    'CentralAuth.CentralAuthAntiSpoofManager' => static function (
31        MediaWikiServices $services
32    ): CentralAuthAntiSpoofManager {
33        return new CentralAuthAntiSpoofManager(
34            new ServiceOptions( CentralAuthAntiSpoofManager::CONSTRUCTOR_OPTIONS, $services->getMainConfig() ),
35            LoggerFactory::getInstance( 'antispoof' ),
36            $services->getDBLoadBalancerFactory(),
37            CentralAuthServices::getDatabaseManager( $services )
38        );
39    },
40
41    'CentralAuth.CentralAuthApiTokenGenerator' => static function (
42        MediaWikiServices $services
43    ): CentralAuthApiTokenGenerator {
44        return new CentralAuthApiTokenGenerator(
45            CentralAuthServices::getTokenManager( $services )
46        );
47    },
48
49    'CentralAuth.CentralAuthDatabaseManager' => static function (
50        MediaWikiServices $services
51    ): CentralAuthDatabaseManager {
52        return new CentralAuthDatabaseManager(
53            new ServiceOptions( CentralAuthDatabaseManager::CONSTRUCTOR_OPTIONS, $services->getMainConfig() ),
54            $services->getDBLoadBalancerFactory(),
55            $services->getReadOnlyMode()
56        );
57    },
58
59    'CentralAuth.CentralAuthEditCounter' => static function (
60        MediaWikiServices $services
61    ): CentralAuthEditCounter {
62        return new CentralAuthEditCounter(
63            CentralAuthServices::getDatabaseManager( $services ),
64            $services->getMainWANObjectCache()
65        );
66    },
67
68    'CentralAuth.CentralAuthForcedLocalCreationService' => static function (
69        MediaWikiServices $services
70    ): CentralAuthForcedLocalCreationService {
71        return new CentralAuthForcedLocalCreationService(
72            $services->getUserFactory(),
73            CentralAuthServices::getUtilityService( $services )
74        );
75    },
76
77    'CentralAuth.CentralAuthSessionManager' => static function (
78        MediaWikiServices $services
79    ): CentralAuthSessionManager {
80        return new CentralAuthSessionManager(
81            new ServiceOptions(
82                CentralAuthSessionManager::CONSTRUCTOR_OPTIONS,
83                $services->getMainConfig()
84            ),
85            $services->getStatsdDataFactory(),
86            $services->getStatsFactory()
87        );
88    },
89
90    'CentralAuth.CentralAuthTokenManager' => static function (
91        MediaWikiServices $services
92    ): CentralAuthTokenManager {
93        return new CentralAuthTokenManager(
94            $services->getMicroStash(),
95            LoggerFactory::getInstance( 'CentralAuth' )
96        );
97    },
98
99    'CentralAuth.CentralAuthUIService' => static function (
100        MediaWikiServices $services
101    ): CentralAuthUIService {
102        return new CentralAuthUIService(
103            $services->getTitleFactory()
104        );
105    },
106
107    'CentralAuth.CentralAuthUtilityService' => static function (
108        MediaWikiServices $services
109    ): CentralAuthUtilityService {
110        return new CentralAuthUtilityService(
111            $services->getMainConfig(),
112            $services->getAuthManager(),
113            $services->getTitleFactory(),
114            $services->getJobQueueGroupFactory(),
115            $services->getJobFactory()
116        );
117    },
118
119    'CentralAuth.CentralAuthWikiListService' => static function (
120        MediaWikiServices $services
121    ): CentralAuthWikiListService {
122        return new CentralAuthWikiListService(
123            new ServiceOptions( CentralAuthWikiListService::CONSTRUCTOR_OPTIONS, $services->getMainConfig() ),
124            $services->getHookContainer()
125        );
126    },
127
128    'CentralAuth.GlobalRenameDenylist' => static function ( MediaWikiServices $services ): GlobalRenameDenylist {
129        $config = $services->getMainConfig();
130        return new GlobalRenameDenylist(
131            LoggerFactory::getInstance( 'CentralAuth' ),
132            $services->getHttpRequestFactory(),
133            $services->getWikiPageFactory(),
134            $config->get( CAMainConfigNames::GlobalRenameDenylist )
135        );
136    },
137
138    'CentralAuth.GlobalRenameRequestStore' => static function (
139        MediaWikiServices $services
140    ): GlobalRenameRequestStore {
141        return new GlobalRenameRequestStore(
142            CentralAuthServices::getDatabaseManager( $services ),
143            $services->getUserNameUtils()
144        );
145    },
146
147    'CentralAuth.GlobalRenameUserValidator' => static function (
148        MediaWikiServices $services
149    ): GlobalRenameUserValidator {
150        return new GlobalRenameUserValidator(
151            $services->getUserNameUtils()
152        );
153    },
154
155    'CentralAuth.GlobalGroupLookup' => static function ( MediaWikiServices $services ): GlobalGroupLookup {
156        return new GlobalGroupLookup(
157            CentralAuthServices::getDatabaseManager( $services )
158        );
159    },
160
161    'CentralAuth.GlobalRenameFactory' => static function ( MediaWikiServices $services ): GlobalRenameFactory {
162        return new GlobalRenameFactory(
163            $services->getJobQueueGroupFactory(),
164            $services->getUserFactory(),
165            CentralAuthServices::getAntiSpoofManager( $services ),
166            CentralAuthServices::getDatabaseManager( $services )
167        );
168    },
169
170    'CentralAuth.GlobalUserSelectQueryBuilderFactory' => static function (
171        MediaWikiServices $services
172    ): GlobalUserSelectQueryBuilderFactory {
173        return new GlobalUserSelectQueryBuilderFactory(
174            CentralAuthServices::getDatabaseManager( $services )->getCentralReplicaDB(),
175            $services->getActorStore(),
176            $services->getUserNameUtils(),
177            $services->getTempUserConfig()
178        );
179    },
180
181    'CentralAuth.SharedDomainUtils' => static function ( MediaWikiServices $services ): SharedDomainUtils {
182        return new SharedDomainUtils(
183            $services->getMainConfig(),
184            $services->getTitleFactory(),
185            $services->has( "MobileFrontend.Context" ) ? $services->get( "MobileFrontend.Context" ) : null
186        );
187    },
188
189    ];
190
191// @codeCoverageIgnoreEnd