Conditions | 2 |
Paths | 2 |
Total Lines | 14 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Tests | 8 |
CRAP Score | 2 |
Changes | 0 |
1 | <?php |
||
10 | 6 | public function resolve(Service $service) |
|
11 | { |
||
12 | 6 | if ($service->classNotExists()) { |
|
13 | 1 | throw new \RuntimeException( |
|
14 | 1 | 'Oops! Class ' . $service->getClass() . |
|
15 | 1 | ' defined as ' . $service->getName() . |
|
16 | 1 | ' not found!!!' |
|
17 | ); |
||
18 | } |
||
19 | |||
20 | 5 | $serviceClass = $service->getClass(); |
|
21 | |||
22 | 5 | return new $serviceClass(); |
|
23 | } |
||
24 | } |
||
25 |