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