| Total Complexity | 4 |
| Total Lines | 27 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 29 | class DoctrinevizBundleExtension extends Extension implements PrependExtensionInterface |
||
| 30 | { |
||
| 31 | /** |
||
| 32 | * {@inheritdoc} |
||
| 33 | */ |
||
| 34 | public function prepend(ContainerBuilder $container) |
||
| 35 | { |
||
| 36 | $requiredBundles = [ |
||
| 37 | 'DoctrineBundle', |
||
| 38 | ]; |
||
| 39 | // get all bundles |
||
| 40 | $bundles = $container->getParameter('kernel.bundles'); |
||
| 41 | // determine if required bundles are registered |
||
| 42 | foreach ($requiredBundles as $requiredBundle) { |
||
| 43 | if (!isset($bundles[$requiredBundle])) { |
||
| 44 | throw new \RuntimeException($requiredBundle.' must be registered in your application.'); |
||
| 45 | } |
||
| 46 | } |
||
| 47 | } |
||
| 48 | |||
| 49 | /** |
||
| 50 | * {@inheritdoc} |
||
| 51 | */ |
||
| 52 | public function load(array $configs, ContainerBuilder $container) |
||
| 56 | } |
||
| 57 | } |
||
| 58 |