Conditions | 3 |
Paths | 3 |
Total Lines | 14 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Tests | 7 |
CRAP Score | 3 |
1 | <?php |
||
27 | 3 | public function getValue(ServiceLocatorInterface $sm) |
|
28 | { |
||
29 | 3 | $serviceName = $this->value; |
|
30 | |||
31 | 3 | if ($this->invokable) { |
|
32 | 1 | return new $serviceName; |
|
33 | } |
||
34 | |||
35 | try { |
||
36 | 2 | return $sm->get($serviceName); |
|
37 | 1 | } catch (\Exception $e) { |
|
38 | 1 | throw CannotGetValue::of($this->value, $e); |
|
39 | } |
||
40 | } |
||
41 | } |
||
42 |