From 9532fb6ac9d8ef26b6211a726e0d791b35f2b42d Mon Sep 17 00:00:00 2001 From: Ian Bentley Date: Fri, 26 Jul 2024 11:56:40 -0600 Subject: [PATCH] style --- src/Handler/UnionHandler.php | 3 ++- src/Metadata/Driver/TypedPropertiesDriver.php | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Handler/UnionHandler.php b/src/Handler/UnionHandler.php index 3e170aedb..f65c8a81a 100644 --- a/src/Handler/UnionHandler.php +++ b/src/Handler/UnionHandler.php @@ -6,12 +6,12 @@ use JMS\Serializer\Context; use JMS\Serializer\DeserializationContext; +use JMS\Serializer\Exception\NonVisitableTypeException; use JMS\Serializer\Exception\RuntimeException; use JMS\Serializer\GraphNavigatorInterface; use JMS\Serializer\SerializationContext; use JMS\Serializer\Visitor\DeserializationVisitorInterface; use JMS\Serializer\Visitor\SerializationVisitorInterface; -use JMS\Serializer\Exception\NonVisitableTypeException; final class UnionHandler implements SubscribingHandlerInterface { @@ -126,6 +126,7 @@ private function matchSimpleType(mixed $data, array $type, Context $context): mi return null; } + private function isPrimitiveType(string $type): bool { return in_array($type, ['int', 'integer', 'float', 'double', 'bool', 'boolean', 'string']); diff --git a/src/Metadata/Driver/TypedPropertiesDriver.php b/src/Metadata/Driver/TypedPropertiesDriver.php index 6227c851d..47741eb34 100644 --- a/src/Metadata/Driver/TypedPropertiesDriver.php +++ b/src/Metadata/Driver/TypedPropertiesDriver.php @@ -105,6 +105,7 @@ public function loadMetadataForClass(ReflectionClass $class): ?ClassMetadata if ('union' === $propertyMetadata->type['name']) { $propertyMetadata->setType($this->reorderTypes($propertyMetadata->type)); } + continue; }