fix invalid function is_subclass call for php-nextgen (#16712)

This commit is contained in:
Maddin 2023-10-05 06:34:50 +02:00 committed by GitHub
parent 822568b664
commit c306ca3cf2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 3 deletions

View File

@ -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()));

View File

@ -93,7 +93,7 @@ class ObjectSerializer
$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()));

View File

@ -92,7 +92,7 @@ class ObjectSerializer
$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()));