Skip to content

Commit

Permalink
primitives have been changed
Browse files Browse the repository at this point in the history
  • Loading branch information
jablan committed Oct 13, 2023
1 parent 630860f commit b48ecbf
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions openapi-generator/templates/php/ObjectSerializer.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -286,9 +286,6 @@ class ObjectSerializer
} else {
return null;
}
} elseif (in_array($class, [{{&primitives}}], true)) {
settype($data, $class);
return $data;
} elseif ($class === '\SplFileObject') {
/** @var \Psr\Http\Message\StreamInterface $data */
Expand All @@ -307,6 +304,9 @@ class ObjectSerializer
fclose($file);

return new \SplFileObject($filename, 'r');
} elseif (in_array($class, [{{&primitives}}], true)) {
settype($data, $class);
return $data;
} elseif (method_exists($class, 'getAllowableEnumValues')) {
if (!in_array($data, $class::getAllowableEnumValues(), true)) {
$imploded = implode("', '", $class::getAllowableEnumValues());
Expand Down

0 comments on commit b48ecbf

Please sign in to comment.