Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
100.00% |
3 / 3 |
|
100.00% |
3 / 3 |
CRAP | |
100.00% |
1 / 1 |
WikimediaCampaignEventsServices | |
100.00% |
3 / 3 |
|
100.00% |
3 / 3 |
3 | |
100.00% |
1 / 1 |
getGrantsStore | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
getGrantIDLookup | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
getFluxxClient | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 |
1 | <?php |
2 | |
3 | declare( strict_types=1 ); |
4 | |
5 | namespace MediaWiki\Extension\WikimediaCampaignEvents; |
6 | |
7 | use MediaWiki\Extension\WikimediaCampaignEvents\Grants\FluxxClient; |
8 | use MediaWiki\Extension\WikimediaCampaignEvents\Grants\GrantIDLookup; |
9 | use MediaWiki\Extension\WikimediaCampaignEvents\Grants\GrantsStore; |
10 | use MediaWiki\MediaWikiServices; |
11 | use Psr\Container\ContainerInterface; |
12 | |
13 | /** |
14 | * Global service locator for WikimediaCampaignEventsServices services. |
15 | * Should only be used where DI is not possible. |
16 | */ |
17 | class WikimediaCampaignEventsServices { |
18 | public static function getGrantsStore( ContainerInterface $services = null ): GrantsStore { |
19 | return ( $services ?? MediaWikiServices::getInstance() )->get( GrantsStore::SERVICE_NAME ); |
20 | } |
21 | |
22 | public static function getGrantIDLookup( ContainerInterface $services = null ): GrantIDLookup { |
23 | return ( $services ?? MediaWikiServices::getInstance() )->get( GrantIDLookup::SERVICE_NAME ); |
24 | } |
25 | |
26 | public static function getFluxxClient( ContainerInterface $services = null ): FluxxClient { |
27 | return ( $services ?? MediaWikiServices::getInstance() )->get( FluxxClient::SERVICE_NAME ); |
28 | } |
29 | } |