Conditions | 4 |
Paths | 5 |
Total Lines | 15 |
Code Lines | 5 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
30 | public static function getFacadeService(string $serviceId) |
||
31 | { |
||
32 | if(self::$container->has($serviceId)) |
||
33 | { |
||
34 | // A public service will be found in the container. |
||
35 | return self::$container->get($serviceId); |
||
36 | } |
||
37 | |||
38 | /** |
||
39 | * @var ServiceLocator |
||
40 | */ |
||
41 | $locator = self::$container->get('lagdo.facades.service_locator', |
||
42 | ContainerInterface::NULL_ON_INVALID_REFERENCE); |
||
43 | // If not found in the container, then look in the service locator. |
||
44 | return ($locator !== null && $locator->has($serviceId)) ? $locator->get($serviceId) : null; |
||
45 | } |
||
47 |