| Conditions | 3 |
| Paths | 3 |
| Total Lines | 16 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 8 |
| CRAP Score | 3 |
| Changes | 0 | ||
| 1 | <?php |
||
| 12 | 13 | public function getService($name) |
|
| 13 | { |
||
| 14 | 13 | if (empty($name)) { |
|
| 15 | 1 | throw new MissingConfigException( |
|
| 16 | 1 | 'No service name found in config' |
|
| 17 | ); |
||
| 18 | } |
||
| 19 | |||
| 20 | 12 | if (!$this->getContainer()->has($name)) { |
|
| 21 | 1 | throw new MissingServiceException( |
|
| 22 | 1 | 'No service found for :' . $name |
|
| 23 | ); |
||
| 24 | } |
||
| 25 | |||
| 26 | 11 | return $this->getContainer()->get($name); |
|
| 27 | } |
||
| 28 | } |
||
| 29 |