Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
0.00% |
0 / 49 |
n/a |
0 / 0 |
CRAP | n/a |
0 / 0 |
1 | <?php |
2 | |
3 | namespace MediaWiki\Extension\Wikistories; |
4 | |
5 | use MediaWiki\Config\ServiceOptions; |
6 | use MediaWiki\Logger\LoggerFactory; |
7 | use MediaWiki\MediaWikiServices; |
8 | use Psr\Log\LoggerInterface; |
9 | |
10 | return [ |
11 | |
12 | 'Wikistories.Cache' => static function ( MediaWikiServices $services ): StoriesCache { |
13 | return new StoriesCache( |
14 | $services->getMainWANObjectCache(), |
15 | $services->get( 'Wikistories.PageLinksSearch' ), |
16 | $services->getWikiPageFactory(), |
17 | $services->get( 'Wikistories.StoryRenderer' ) |
18 | ); |
19 | }, |
20 | |
21 | 'Wikistories.StoryConverter' => static function (): StoryConverter { |
22 | return new StoryConverter(); |
23 | }, |
24 | |
25 | 'Wikistories.StoryValidator' => static function ( MediaWikiServices $services ): StoryValidator { |
26 | return new StoryValidator( |
27 | new ServiceOptions( |
28 | StoryValidator::CONSTRUCTOR_OPTIONS, |
29 | $services->getMainConfig() |
30 | ), |
31 | $services->getRepoGroup(), |
32 | $services->getPageStore() |
33 | ); |
34 | }, |
35 | |
36 | 'Wikistories.StoryRenderer' => static function ( MediaWikiServices $services ): StoryRenderer { |
37 | return new StoryRenderer( |
38 | $services->getRepoGroup(), |
39 | $services->getRedirectLookup(), |
40 | $services->getPageStore(), |
41 | $services->get( 'Wikistories.Analyzer' ), |
42 | $services->get( 'Wikistories.TrackingCategories' ) |
43 | ); |
44 | }, |
45 | |
46 | 'Wikistories.Logger' => static function (): LoggerInterface { |
47 | return LoggerFactory::getInstance( 'Wikistories' ); |
48 | }, |
49 | |
50 | 'Wikistories.PageLinksSearch' => static function ( MediaWikiServices $services ): PageLinksSearch { |
51 | return new PageLinksSearch( |
52 | $services->getDBLoadBalancer(), |
53 | $services->getLinksMigration() |
54 | ); |
55 | }, |
56 | |
57 | 'Wikistories.Analyzer' => static function ( MediaWikiServices $services ): StoryContentAnalyzer { |
58 | return new StoryContentAnalyzer( |
59 | $services->getWikiPageFactory() |
60 | ); |
61 | }, |
62 | |
63 | 'Wikistories.TrackingCategories' => static function (): StoryTrackingCategories { |
64 | return new StoryTrackingCategories(); |
65 | } |
66 | |
67 | ]; |