Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
0.00% |
0 / 4 |
|
0.00% |
0 / 4 |
CRAP | |
0.00% |
0 / 1 |
PageTriageServices | |
0.00% |
0 / 4 |
|
0.00% |
0 / 4 |
20 | |
0.00% |
0 / 1 |
__construct | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
wrap | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
getQueueManager | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
getQueueLookup | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 |
1 | <?php |
2 | |
3 | namespace MediaWiki\Extension\PageTriage; |
4 | |
5 | use MediaWiki\MediaWikiServices; |
6 | |
7 | /** |
8 | * A simple wrapper for MediaWikiServices, to support type safety when accessing |
9 | * services defined by this extension. |
10 | */ |
11 | class PageTriageServices { |
12 | |
13 | /** @var MediaWikiServices */ |
14 | private MediaWikiServices $coreServices; |
15 | |
16 | /** |
17 | * @param MediaWikiServices $coreServices |
18 | */ |
19 | public function __construct( MediaWikiServices $coreServices ) { |
20 | $this->coreServices = $coreServices; |
21 | } |
22 | |
23 | /** |
24 | * Static version of the constructor, for nicer syntax. |
25 | * @param MediaWikiServices $coreServices |
26 | * @return static |
27 | */ |
28 | public static function wrap( MediaWikiServices $coreServices ): PageTriageServices { |
29 | return new static( $coreServices ); |
30 | } |
31 | |
32 | /** |
33 | * @return QueueManager |
34 | */ |
35 | public function getQueueManager(): QueueManager { |
36 | return $this->coreServices->get( 'PageTriageQueueManager' ); |
37 | } |
38 | |
39 | /** |
40 | * @return QueueLookup |
41 | */ |
42 | public function getQueueLookup(): QueueLookup { |
43 | return $this->coreServices->get( 'PageTriageQueueLookup' ); |
44 | } |
45 | } |