diff --git a/src/Symfony/Component/HttpKernel/Kernel.php b/src/Symfony/Component/HttpKernel/Kernel.php index 85483fd3c2..80dd8a0129 100644 --- a/src/Symfony/Component/HttpKernel/Kernel.php +++ b/src/Symfony/Component/HttpKernel/Kernel.php @@ -640,7 +640,7 @@ abstract class Kernel implements KernelInterface, TerminableInterface } } - $container = new ContainerBuilder(new ParameterBag($this->getKernelParameters())); + $container = $this->getContainerBuilder(); $extensions = array(); foreach ($this->bundles as $bundle) { if ($extension = $bundle->getContainerExtension()) { @@ -671,6 +671,16 @@ abstract class Kernel implements KernelInterface, TerminableInterface return $container; } + /** + * Gets a new ContainerBuilder instance used to build the service container. + * + * @return ContainerBuilder + */ + protected function getContainerBuilder() + { + return new ContainerBuilder(new ParameterBag($this->getKernelParameters())); + } + /** * Dumps the service container to PHP code in the cache. *