From 04be2bf3f4e296a601f3231cdf7d95dbbfcada22 Mon Sep 17 00:00:00 2001 From: Christoph Kappestein Date: Sun, 15 Sep 2024 18:55:39 +0200 Subject: [PATCH] use data body --- src/Parser/Attribute.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Parser/Attribute.php b/src/Parser/Attribute.php index cd13316..b21ac18 100644 --- a/src/Parser/Attribute.php +++ b/src/Parser/Attribute.php @@ -362,15 +362,15 @@ private function getSchemaFromTypeHint(?\ReflectionType $type): string|ContentTy return Passthru::class; } elseif ($type->getName() === \DOMDocument::class) { return ContentType::XML; - } elseif ($type->getName() === \stdClass::class) { - return ContentType::JSON; } elseif ($type->getName() === StreamInterface::class) { return ContentType::BINARY; } elseif ($type->getName() === 'string') { return ContentType::TEXT; - } elseif ($type->getName() === 'PSX\\Data\\Multipart\\Body') { + } elseif ($type->getName() === 'PSX\\Data\\Body\\Json') { + return ContentType::JSON; + } elseif ($type->getName() === 'PSX\\Data\\Body\\Multipart') { return ContentType::MULTIPART; - } elseif ($type->getName() === 'array') { + } elseif ($type->getName() === 'PSX\\Data\\Body\\Form') { return ContentType::FORM; } elseif (class_exists($type->getName())) { return $type->getName();