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 | 51 | public function resolveBundles(Application $application, array $names) |
|
25 | { |
||
26 | 51 | $bundles = $application->getKernel()->getBundles(); |
|
27 | |||
28 | 51 | $result = []; |
|
29 | 51 | foreach ($names as $name) { |
|
30 | 51 | 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 | 51 | $result[$name] = $bundles[$name]; |
|
39 | 51 | } |
|
40 | |||
41 | 51 | return $result; |
|
42 | } |
||
43 | } |
||
44 |