From 6546ac1e7b2da2592618d322daea0333714bf198 Mon Sep 17 00:00:00 2001 From: Andreas Hoffmeyer Date: Mon, 4 Dec 2023 13:57:21 +0100 Subject: [PATCH] Fixing multiple import-tags within imports (#40) --- src/Components/Configuration/ConfigurationLoader.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/Components/Configuration/ConfigurationLoader.php b/src/Components/Configuration/ConfigurationLoader.php index 71035341..af75e193 100644 --- a/src/Components/Configuration/ConfigurationLoader.php +++ b/src/Components/Configuration/ConfigurationLoader.php @@ -126,8 +126,16 @@ private function loadImports(SimpleXMLElement $rootNode) } foreach ($rootNode->imports as $importNode) { - $resource = $this->getAttribute('resource', $importNode->import); - $imports[] = $resource->getValue(); + // if there is more than one import, we have to iterate through them + if ($importNode->import->count() > 1) { + foreach ($importNode->import as $import) { + $resource = $this->getAttribute('resource', $import); + $imports[] = $resource->getValue(); + } + } else { + $resource = $this->getAttribute('resource', $importNode->import); + $imports[] = $resource->getValue(); + } } return $imports;