Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
3 / 3
100.00% covered (success)
100.00%
3 / 3
CRAP
100.00% covered (success)
100.00%
1 / 1
WikimediaCampaignEventsServices
100.00% covered (success)
100.00%
3 / 3
100.00% covered (success)
100.00%
3 / 3
3
100.00% covered (success)
100.00%
1 / 1
 getGrantsStore
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 getGrantIDLookup
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 getFluxxClient
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
1<?php
2
3declare( strict_types=1 );
4
5namespace MediaWiki\Extension\WikimediaCampaignEvents;
6
7use MediaWiki\Extension\WikimediaCampaignEvents\Grants\FluxxClient;
8use MediaWiki\Extension\WikimediaCampaignEvents\Grants\GrantIDLookup;
9use MediaWiki\Extension\WikimediaCampaignEvents\Grants\GrantsStore;
10use MediaWiki\MediaWikiServices;
11use Psr\Container\ContainerInterface;
12
13/**
14 * Global service locator for WikimediaCampaignEventsServices services.
15 * Should only be used where DI is not possible.
16 */
17class 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}