8000 [DependencyInjection] fixed Extension conversion from XML to PHP when… · Dahipster/symfony@392ab46 · GitHub
[go: up one dir, main page]

Skip to content

Commit 392ab46

Browse files
committed
[DependencyInjection] fixed Extension conversion from XML to PHP when the same tag is used more than once
1 parent 0aa5041 commit 392ab46

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

src/Symfony/Components/DependencyInjection/Loader/XmlFileLoader.php

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,19 @@ static public function convertDomElementToArray(\DomElement $element)
382382
}
383383
elseif (!$node instanceof \DOMComment)
384384
{
385-
$config[$node->localName] = static::convertDomElementToArray($node);
385+
if (isset($config[$node->localName]))
386+
{
387+
if (!is_array($config[$node->localName]))
388+
{
389+
$config[$node->localName] = array($config[$node->localName]);
390+
}
391+
$config[$node->localName][] = static::convertDomElementToArray($node);
392+
}
393+
else
394+
{
395+
$config[$node->localName] = static::convertDomElementToArray($node);
396+
}
397+
386398
$empty = false;
387399
}
388400
}

0 commit comments

Comments
 (0)
0