Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
0.00% |
0 / 30 |
n/a |
0 / 0 |
CRAP | n/a |
0 / 0 |
1 | <?php |
2 | /** |
3 | * List of services in this extension with construction instructions. |
4 | * |
5 | * @file |
6 | * @author Abijeet Patro |
7 | * @license GPL-2.0-or-later |
8 | * @since 2022.01 |
9 | */ |
10 | |
11 | declare( strict_types = 1 ); |
12 | |
13 | use MediaWiki\MassMessage\MessageContentFetcher\LabeledSectionContentFetcher; |
14 | use MediaWiki\MassMessage\MessageContentFetcher\LocalMessageContentFetcher; |
15 | use MediaWiki\MassMessage\MessageContentFetcher\RemoteMessageContentFetcher; |
16 | use MediaWiki\MassMessage\PageMessage\PageMessageBuilder; |
17 | use MediaWiki\MediaWikiServices; |
18 | use MediaWiki\WikiMap\WikiMap; |
19 | |
20 | /** @phpcs-require-sorted-array */ |
21 | return [ |
22 | 'MassMessage:LabeledSectionContentFetcher' => static function (): LabeledSectionContentFetcher { |
23 | return new LabeledSectionContentFetcher(); |
24 | }, |
25 | |
26 | 'MassMessage:LocalMessageContentFetcher' => static function ( |
27 | MediaWikiServices $services |
28 | ): LocalMessageContentFetcher { |
29 | return new LocalMessageContentFetcher( $services->getRevisionStore() ); |
30 | }, |
31 | |
32 | 'MassMessage:PageMessageBuilder' => static function ( MediaWikiServices $services ): PageMessageBuilder { |
33 | return new PageMessageBuilder( |
34 | $services->get( 'MassMessage:LocalMessageContentFetcher' ), |
35 | $services->get( 'MassMessage:LabeledSectionContentFetcher' ), |
36 | $services->get( 'MassMessage:RemoteMessageContentFetcher' ), |
37 | $services->getLanguageNameUtils(), |
38 | $services->getLanguageFallback(), |
39 | WikiMap::getCurrentWikiId() |
40 | ); |
41 | }, |
42 | |
43 | 'MassMessage:RemoteMessageContentFetcher' => static function ( |
44 | MediaWikiServices $services |
45 | ): RemoteMessageContentFetcher { |
46 | $config = $services->getMainConfig(); |
47 | $siteConfiguration = $config->get( 'Conf' ); |
48 | |
49 | return new RemoteMessageContentFetcher( |
50 | $services->getHttpRequestFactory(), |
51 | $siteConfiguration |
52 | ); |
53 | }, |
54 | ]; |