| Conditions | 4 |
| Paths | 3 |
| Total Lines | 8 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 16 | public static function getService($serviceName, array $services) |
||
| 17 | { |
||
| 18 | if ($serviceName && isset($services[$serviceName])) { |
||
| 19 | return $services[$serviceName]; |
||
| 20 | } elseif ($serviceName) { |
||
| 21 | throw new ServiceNotFoundException("The service named $serviceName can not be found"); |
||
| 22 | } else { |
||
| 23 | return reset($services); |
||
| 24 | } |
||
| 45 |