1 | <?php |
||
11 | final class MapsMappingServices { |
||
12 | |||
13 | /** |
||
14 | * Associative array containing service identifiers as keys and the names |
||
15 | * of service classes as values. |
||
16 | * |
||
17 | * @var string[] |
||
18 | */ |
||
19 | private static $registeredServices = []; |
||
20 | |||
21 | /** |
||
22 | * Associative with service identifiers as keys containing instances of |
||
23 | * the mapping service classes. |
||
24 | * |
||
25 | * Note: This list only contains the instances, so is not to be used for |
||
26 | * looping over all available services, as not all of them are guaranteed |
||
27 | * to have an instance already, use $registeredServices for this purpose. |
||
28 | * |
||
29 | * @var MapsMappingService[] |
||
30 | */ |
||
31 | private static $services = []; |
||
32 | |||
33 | /** |
||
34 | * Registers a service class linked to an identifier. |
||
35 | */ |
||
36 | public static function registerService( string $serviceIdentifier, string $serviceClassName ) { |
||
39 | |||
40 | /** |
||
41 | * Returns the instance of a service class. This method takes |
||
42 | * care of creating the instance if this is not done yet. |
||
43 | * |
||
44 | * @throws MWException |
||
45 | */ |
||
46 | public static function getServiceInstance( string $serviceIdentifier ): MapsMappingService { |
||
67 | |||
68 | public static function getMainServiceName( string $serviceName ): string { |
||
81 | |||
82 | } |
||
83 |