| Conditions | 3 |
| Paths | 3 |
| Total Lines | 19 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 13 |
| CRAP Score | 3 |
| Changes | 2 | ||
| Bugs | 1 | Features | 1 |
| 1 | <?php |
||
| 24 | 27 | public function resolveBundles(Application $application, array $names) |
|
| 25 | { |
||
| 26 | 27 | $bundles = $application->getKernel()->getBundles(); |
|
| 27 | |||
| 28 | 27 | $result = []; |
|
| 29 | 27 | foreach ($names as $name) { |
|
| 30 | 27 | if (false === isset($bundles[$name])) { |
|
| 31 | 3 | throw new \RuntimeException(sprintf( |
|
| 32 | 3 | 'The bundle "%s" was not found. Bundles available are: %s.', |
|
| 33 | 3 | $name, |
|
| 34 | 3 | implode('", "', array_keys($bundles)) |
|
| 35 | 3 | )); |
|
| 36 | } |
||
| 37 | |||
| 38 | 27 | $result[$name] = $bundles[$name]; |
|
| 39 | 27 | } |
|
| 40 | |||
| 41 | 27 | return $result; |
|
| 42 | } |
||
| 43 | } |
||
| 44 |