forked from loafle/openapi-generator-original
fix invalid function is_subclass call for php-nextgen (#16712)
This commit is contained in:
parent
822568b664
commit
c306ca3cf2
@ -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()));
|
||||
|
@ -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()));
|
||||
|
@ -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()));
|
||||
|
Loading…
x
Reference in New Issue
Block a user