| Total Complexity | 8 |
| Total Lines | 55 |
| Duplicated Lines | 0 % |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 8 | final class Container |
||
| 9 | { |
||
| 10 | /** |
||
| 11 | * @var array |
||
| 12 | */ |
||
| 13 | private static $services = []; |
||
| 14 | |||
| 15 | /** |
||
| 16 | * @var ContainerInterface |
||
| 17 | */ |
||
| 18 | protected static $container = null; |
||
| 19 | |||
| 20 | /** |
||
| 21 | * @var ServiceLocator |
||
| 22 | */ |
||
| 23 | protected static $locator = null; |
||
| 24 | |||
| 25 | /** |
||
| 26 | * Get a service using the container or the locator. |
||
| 27 | * |
||
| 28 | * @param string $serviceId |
||
| 29 | * |
||
| 30 | * @return mixed|null |
||
| 31 | */ |
||
| 32 | public static function getService(string $serviceId) |
||
| 49 | } |
||
| 50 | |||
| 51 | /** |
||
| 52 | * Set the container and locator. |
||
| 53 | * |
||
| 54 | * @param ContainerInterface $container |
||
| 55 | * |
||
| 56 | * @return void |
||
| 57 | */ |
||
| 58 | public static function init(ContainerInterface $container) |
||
| 65 |