Skip to content

Commit

Permalink
iter
Browse files Browse the repository at this point in the history
  • Loading branch information
idbentley committed Jul 26, 2024
1 parent 411c72c commit 687d62c
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions src/Handler/UnionHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
use JMS\Serializer\SerializationContext;
use JMS\Serializer\Visitor\DeserializationVisitorInterface;
use JMS\Serializer\Visitor\SerializationVisitorInterface;
use JMS\Serializer\Exception\NonVisitableTypeException;

final class UnionHandler implements SubscribingHandlerInterface
{
Expand Down Expand Up @@ -66,12 +67,6 @@ public function deserializeUnion(DeserializationVisitorInterface $visitor, mixed
throw new RuntimeException('XML deserialisation into union types is not supported yet.');
}

$alternativeName = null;

if (isset(static::$aliases[$dataType])) {
$alternativeName = static::$aliases[$dataType];
}

foreach ($type['params'] as $possibleType) {
$finalType = null;

Expand Down Expand Up @@ -117,8 +112,6 @@ public function deserializeUnion(DeserializationVisitorInterface $visitor, mixed

private function matchSimpleType(mixed $data, array $type, Context $context): mixed
{
$alternativeName = null;

foreach ($type['params'] as $possibleType) {
if ($this->isPrimitiveType($possibleType['name']) && !$this->testPrimitive($data, $possibleType['name'], $context->getFormat())) {
continue;
Expand Down

0 comments on commit 687d62c

Please sign in to comment.