Skip to content

Commit a184992

Browse files
committed
Patch to avoid exception
1 parent 26add87 commit a184992

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/Symfony/Component/HttpKernel/Kernel.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -424,9 +424,13 @@ protected function initializeBundles()
424424
$this->topMostBundles = array();
425425
$this->directChildrenBundles = array();
426426

427+
// Register root bundles
427428
foreach ($this->registerBundles() as $bundle) {
428429
$this->addBundle($bundle);
430+
}
429431

432+
// Register dependencies
433+
foreach ($this->bundles as $bundle) {
430434
foreach ($bundle->getBundleDependencies() as $bundleDependency) {
431435
$this->addBundle($bundleDependency, true);
432436
}
@@ -466,11 +470,7 @@ protected function addBundle($bundle, $dependency = false)
466470
{
467471
$name = $bundle->getName();
468472

469-
// Register dependencies only if not already registered
470-
if (isset($this->bundles[$name]) && true === $dependency) {
471-
return;
472-
}
473-
if (isset($this->bundles[$name])) {
473+
if (isset($this->bundles[$name]) && false === $dependency) {
474474
throw new \LogicException(sprintf('Trying to register two bundles with the same name "%s"', $name));
475475
}
476476
$this->bundles[$name] = $bundle;

0 commit comments

Comments
 (0)