Skip to content

Commit

Permalink
fix invalid function is_subclass call for php-nextgen
Browse files Browse the repository at this point in the history
  • Loading branch information
reinfi committed Oct 3, 2023
1 parent baf33f0 commit 980c46f
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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()));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()));
Expand Down

0 comments on commit 980c46f

Please sign in to comment.