function XmlFileLoader::parseContext
1 call to XmlFileLoader::parseContext()
- XmlFileLoader::loadClassMetadata in vendor/
symfony/ serializer/ Mapping/ Loader/ XmlFileLoader.php
File
-
vendor/
symfony/ serializer/ Mapping/ Loader/ XmlFileLoader.php, line 158
Class
- XmlFileLoader
- Loads XML mapping files.
Namespace
Symfony\Component\Serializer\Mapping\LoaderCode
private function parseContext(\SimpleXMLElement $nodes) : array {
$context = [];
foreach ($nodes as $node) {
if (\count($node) > 0) {
if (\count($node->entry) > 0) {
$value = $this->parseContext($node->entry);
}
else {
$value = [];
}
}
else {
$value = XmlUtils::phpize($node);
}
if (isset($node['name'])) {
$context[(string) $node['name']] = $value;
}
else {
$context[] = $value;
}
}
return $context;
}