From 5334aa62ed5f6b8f21004fa44ecba982e1fedd6a Mon Sep 17 00:00:00 2001 From: Toon Verwerft Date: Fri, 20 Dec 2024 08:42:02 +0100 Subject: [PATCH] Introduce backed-enum classmaps --- src/EncoderRegistry.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/EncoderRegistry.php b/src/EncoderRegistry.php index 695e7fa..0d998b8 100644 --- a/src/EncoderRegistry.php +++ b/src/EncoderRegistry.php @@ -211,6 +211,19 @@ public function addBackedEnum(string $namespace, string $name, string $enumClass return $this; } + public function addBackedEnumClassMapCollection(ClassMapCollection $classMapCollection): self + { + foreach ($classMapCollection as $classMap) { + $this->addBackedEnum( + $classMap->getXmlNamespace(), + $classMap->getXmlType(), + $classMap->getPhpClassName() + ); + } + + return $this; + } + /** * @param non-empty-string $namespace * @param non-empty-string $name