| Conditions | 3 |
| Paths | 4 |
| Total Lines | 14 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 38 | public function getService(string $id) |
||
| 39 | { |
||
| 40 | $container = $this->kernel->getContainer(); |
||
| 41 | |||
| 42 | if ($container->has('test.service_container')) { |
||
| 43 | $container = $container->get('test.service_container'); |
||
| 44 | } |
||
| 45 | |||
| 46 | if (!$container->has($id)) { |
||
| 47 | throw new \DomainException('Could not get the services of kernel\'s container.'); |
||
| 48 | } |
||
| 49 | |||
| 50 | return (new ContainerBasedContainerAccessor($container))->getService($id); |
||
| 51 | } |
||
| 52 | |||
| 67 |