Conditions | 4 |
Paths | 4 |
Total Lines | 19 |
Code Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
32 | public function checkDependencies(array $requiredBundles, ContainerBuilder $container) |
||
33 | { |
||
34 | if (false === ($this instanceof Bundle)) { |
||
35 | throw new RuntimeException('It is a bundle trait, you shouldn\'t have to use in other instances'); |
||
36 | } |
||
37 | |||
38 | $enabledBundles = $container->getParameter('kernel.bundles'); |
||
39 | foreach ($requiredBundles as $requiredBundle) { |
||
40 | if (!isset($enabledBundles[$requiredBundle])) { |
||
41 | throw new RuntimeException( |
||
42 | sprintf( |
||
43 | 'In order to use "%s" you also need to enable and configure the "%s"', |
||
44 | $this->getName(), |
||
45 | $requiredBundle |
||
46 | ) |
||
47 | ); |
||
48 | } |
||
49 | } |
||
50 | } |
||
51 | } |
||
52 |