| Total Complexity | 7 |
| Total Lines | 55 |
| Duplicated Lines | 0 % |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 8 | final class Container |
||
| 9 | { |
||
| 10 | /** |
||
| 11 | * @var ContainerInterface |
||
| 12 | */ |
||
| 13 | protected $container; |
||
| 14 | |||
| 15 | /** |
||
| 16 | * @param ContainerInterface $container |
||
| 17 | */ |
||
| 18 | public function __construct(ContainerInterface $container) |
||
| 19 | { |
||
| 20 | $this->container = $container; |
||
| 21 | } |
||
| 22 | |||
| 23 | /** |
||
| 24 | * Get a service from the container. |
||
| 25 | * |
||
| 26 | * @param string $serviceId |
||
| 27 | * |
||
| 28 | * @return mixed|null |
||
| 29 | */ |
||
| 30 | private function get(string $serviceId) |
||
| 33 | } |
||
| 34 | |||
| 35 | /** |
||
| 36 | * Get the locator. |
||
| 37 | * |
||
| 38 | * @return ServiceLocator |
||
| 39 | */ |
||
| 40 | public function locator() |
||
| 41 | { |
||
| 42 | return $this->get('lagdo.facades.service_locator'); |
||
| 43 | } |
||
| 44 | |||
| 45 | /** |
||
| 46 | * Get a service using the container or the locator. |
||
| 47 | * |
||
| 48 | * @param string $serviceId |
||
| 49 | * |
||
| 50 | * @return mixed|null |
||
| 51 | */ |
||
| 52 | public function getService(string $serviceId) |
||
| 63 | } |
||
| 64 | } |
||
| 65 |