From 0da6fc8ed2ddc41d35687815d500d80f8f60226e Mon Sep 17 00:00:00 2001 From: Cees-Jan Kiewiet Date: Sat, 26 Oct 2024 23:43:06 +0200 Subject: [PATCH] No relative classnames unless we're doing files or string concats --- src/Internal/Schema/SingleCastUnionToType.php | 2 +- src/Internal/UnionTypeUtils.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Internal/Schema/SingleCastUnionToType.php b/src/Internal/Schema/SingleCastUnionToType.php index d365073..453907a 100644 --- a/src/Internal/Schema/SingleCastUnionToType.php +++ b/src/Internal/Schema/SingleCastUnionToType.php @@ -150,7 +150,7 @@ public static function generate(BuilderFactory $builderFactory, string $pathPref 'hydrateObject', [ $builderFactory->classConstFetch( - $classString->relative, + $classString->fullyQualified->source, 'class', ), $builderFactory->var('value'), diff --git a/src/Internal/UnionTypeUtils.php b/src/Internal/UnionTypeUtils.php index d373d96..42b1275 100644 --- a/src/Internal/UnionTypeUtils.php +++ b/src/Internal/UnionTypeUtils.php @@ -26,7 +26,7 @@ public static function buildUnionType(Representation\Namespaced\Property\Type $t 'string' => $typeInUnion->payload, 'array' => 'array', 'object' => match ($typeInUnion->payload::class) { - Representation\Namespaced\Schema::class => $typeInUnion->payload->className->relative, + Representation\Namespaced\Schema::class => $typeInUnion->payload->className->fullyQualified->source, Representation\Namespaced\Property\Type::class => self::buildUnionType($typeInUnion->payload), }, };