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