Skip to content

Commit

Permalink
Fixing multiple import-tags within imports (#40)
Browse files Browse the repository at this point in the history
  • Loading branch information
ahoffmeyer authored Dec 4, 2023
1 parent 4395bf3 commit 6546ac1
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/Components/Configuration/ConfigurationLoader.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 6546ac1

Please sign in to comment.