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