From 6c781c421672f91b4c7e6adc9df7a6e4bc29729e Mon Sep 17 00:00:00 2001 From: Timm Friebe Date: Fri, 29 Mar 2024 10:04:17 +0100 Subject: [PATCH] Make compatible with PHP 7.0 - 7.3 --- composer.json | 2 +- src/main/php/xml/meta/Marshaller.class.php | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/composer.json b/composer.json index 314e6834..6e432f75 100755 --- a/composer.json +++ b/composer.json @@ -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" : { diff --git a/src/main/php/xml/meta/Marshaller.class.php b/src/main/php/xml/meta/Marshaller.class.php index 5ce031cd..a68c9638 100755 --- a/src/main/php/xml/meta/Marshaller.class.php +++ b/src/main/php/xml/meta/Marshaller.class.php @@ -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())); } } @@ -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(), []);