From 04853fc5c39e2b3c8ec819d4ac16b11cfbe6d9f9 Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Wed, 1 Feb 2017 14:00:02 +0100 Subject: [PATCH] [DI] Deduplicate resource while adding them --- .../Component/DependencyInjection/ContainerBuilder.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Symfony/Component/DependencyInjection/ContainerBuilder.php b/src/Symfony/Component/DependencyInjection/ContainerBuilder.php index f13b29b2207d..7fe137ac72d8 100644 --- a/src/Symfony/Component/DependencyInjection/ContainerBuilder.php +++ b/src/Symfony/Component/DependencyInjection/ContainerBuilder.php @@ -202,7 +202,7 @@ public function hasExtension($name) */ public function getResources() { - return array_unique($this->resources); + return array_values($this->resources); } /** @@ -218,7 +218,7 @@ public function addResource(ResourceInterface $resource) return $this; } - $this->resources[] = $resource; + $this->resources[(string) $resource] = $resource; return $this; }