From 980c46f2c1a758b93c7f67604289110a19bdfccd Mon Sep 17 00:00:00 2001 From: Reinfi Date: Tue, 3 Oct 2023 13:19:16 +0200 Subject: [PATCH] fix invalid function is_subclass call for php-nextgen --- .../src/main/resources/php-nextgen/ObjectSerializer.mustache | 2 +- samples/client/echo_api/php-nextgen/src/ObjectSerializer.php | 2 +- .../php-nextgen/OpenAPIClient-php/src/ObjectSerializer.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/php-nextgen/ObjectSerializer.mustache b/modules/openapi-generator/src/main/resources/php-nextgen/ObjectSerializer.mustache index 31649766e300..1e3d50271107 100644 --- a/modules/openapi-generator/src/main/resources/php-nextgen/ObjectSerializer.mustache +++ b/modules/openapi-generator/src/main/resources/php-nextgen/ObjectSerializer.mustache @@ -83,7 +83,7 @@ class ObjectSerializer $getter = $data::getters()[$property]; $value = $data->$getter(); if ($value !== null && !in_array($openAPIType, [{{&primitives}}], true)) { - if (is_sublass_of($openAPIType, '\BackedEnum')) { + if (is_subclass_of($openAPIType, '\BackedEnum')) { $data = $openAPIType::tryFrom($data); if ($data === null) { $imploded = implode("', '", array_map(fn($case) => $case->value, $openAPIType::cases())); diff --git a/samples/client/echo_api/php-nextgen/src/ObjectSerializer.php b/samples/client/echo_api/php-nextgen/src/ObjectSerializer.php index 0ce7e928bb65..06314dec577c 100644 --- a/samples/client/echo_api/php-nextgen/src/ObjectSerializer.php +++ b/samples/client/echo_api/php-nextgen/src/ObjectSerializer.php @@ -93,7 +93,7 @@ public static function sanitizeForSerialization(mixed $data, string $type = null $getter = $data::getters()[$property]; $value = $data->$getter(); if ($value !== null && !in_array($openAPIType, ['\DateTime', '\SplFileObject', 'array', 'bool', 'boolean', 'byte', 'float', 'int', 'integer', 'mixed', 'number', 'object', 'string', 'void'], true)) { - if (is_sublass_of($openAPIType, '\BackedEnum')) { + if (is_subclass_of($openAPIType, '\BackedEnum')) { $data = $openAPIType::tryFrom($data); if ($data === null) { $imploded = implode("', '", array_map(fn($case) => $case->value, $openAPIType::cases())); diff --git a/samples/client/petstore/php-nextgen/OpenAPIClient-php/src/ObjectSerializer.php b/samples/client/petstore/php-nextgen/OpenAPIClient-php/src/ObjectSerializer.php index 4da34a502aa2..afee7e684f27 100644 --- a/samples/client/petstore/php-nextgen/OpenAPIClient-php/src/ObjectSerializer.php +++ b/samples/client/petstore/php-nextgen/OpenAPIClient-php/src/ObjectSerializer.php @@ -92,7 +92,7 @@ public static function sanitizeForSerialization(mixed $data, string $type = null $getter = $data::getters()[$property]; $value = $data->$getter(); if ($value !== null && !in_array($openAPIType, ['\DateTime', '\SplFileObject', 'array', 'bool', 'boolean', 'byte', 'float', 'int', 'integer', 'mixed', 'number', 'object', 'string', 'void'], true)) { - if (is_sublass_of($openAPIType, '\BackedEnum')) { + if (is_subclass_of($openAPIType, '\BackedEnum')) { $data = $openAPIType::tryFrom($data); if ($data === null) { $imploded = implode("', '", array_map(fn($case) => $case->value, $openAPIType::cases()));