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