Skip to content

Commit

Permalink
Make compatible with PHP 7.0 - 7.3
Browse files Browse the repository at this point in the history
  • Loading branch information
thekid committed Mar 29, 2024
1 parent 49ac1ea commit 6c781c4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"require" : {
"xp-framework/core": "^12.0 | ^11.0 | ^10.0",
"xp-framework/collections": "^10.0 | ^9.0 | ^8.0",
"xp-framework/reflection": "^3.1",
"xp-framework/reflection": "^3.0 | ^2.0",
"php" : ">=7.0.0"
},
"require-dev" : {
Expand Down
6 changes: 3 additions & 3 deletions src/main/php/xml/meta/Marshaller.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ protected static function recurse($instance, $type, $node, $inject) {
if (($factory= $type->annotation(Xmlfactory::class)) && ($element= $factory->argument('element'))) {
$node->setName($element);
} else {
$node->setName(strtolower($type->declaredName()));
$node->setName(strtolower($type->class()->getSimpleName()));
}
}

Expand Down Expand Up @@ -140,9 +140,9 @@ public static function marshal($instance, $qname= null) {
$tree->root()->setName($prefix.':'.$qname->localpart);
$tree->root()->setAttribute('xmlns:'.$prefix, $qname->namespace);
} else if ($type->annotation(Xmlns::class)) {
$tree->root()->setName($type->declaredName());
$tree->root()->setName($type->class()->getSimpleName());
} else {
$tree->root()->setName(strtolower($type->declaredName()));
$tree->root()->setName(strtolower($type->class()->getSimpleName()));
}

self::recurse($instance, $type, $tree->root(), []);
Expand Down

0 comments on commit 6c781c4

Please sign in to comment.