8000 [HttpKernel] Allow override of ContainerBuilder instance used to buil… · kimhemsoe/symfony@82bbf3b · GitHub
[go: up one dir, main page]

Skip to content

Commit 82bbf3b

Browse files
author
Drak
committed
[HttpKernel] Allow override of ContainerBuilder instance used to build container
1 parent b2af6b4 commit 82bbf3b

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/Symfony/Component/HttpKernel/Kernel.php

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -640,7 +640,7 @@ protected function buildContainer()
640640
}
641641
}
642642

643-
$container = new ContainerBuilder(new ParameterBag($this->getKernelParameters()));
643+
$container = $this->getContainerBuilder();
644644
$extensions = array();
645645
foreach ($this->bundles as $bundle) {
646646
if ($extension = $bundle->getContainerExtension()) {
@@ -671,6 +671,16 @@ protected function buildContainer()
671671
return $container;
672672
}
673673

674+
/**
675+
* Gets a new ContainerBuilder instance used to build the service container.
676+
*
677+
* @return ContainerBuilder
678+
*/
679+
protected function getContainerBuilder()
680+
{
681+
return new ContainerBuilder(new ParameterBag($this->getKernelParameters()));
682+
}
683+
674684
/**
675685
* Dumps the service container to PHP code in the cache.
676686
*

0 commit comments

Comments
 (0)
0