for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/*
* This file is part of the doctrineviz package
*
* Copyright (c) 2017 Pierre Hennequart
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
* Feel free to edit as you please, and have fun.
* @author Pierre Hennequart <[email protected]>
*/
declare(strict_types=1);
namespace Janalis\Doctrineviz\DependencyInjection;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Extension\PrependExtensionInterface;
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
/**
* This is the class that loads and manages your bundle configuration.
* @see http://symfony.com/doc/current/cookbook/bundles/extension.html
class DoctrinevizBundleExtension extends Extension implements PrependExtensionInterface
{
* {@inheritdoc}
public function prepend(ContainerBuilder $container)
$requiredBundles = [
'DoctrineBundle',
];
// get all bundles
$bundles = $container->getParameter('kernel.bundles');
// determine if required bundles are registered
foreach ($requiredBundles as $requiredBundle) {
if (!isset($bundles[$requiredBundle])) {
throw new \RuntimeException($requiredBundle.' must be registered in your application.');
}
public function load(array $configs, ContainerBuilder $container)
$configuration = new Configuration($this->getAlias());
$this->processConfiguration($configuration, $configs);