Skip to content

Commit

Permalink
[php] fix 'mixed' invalid for settype() (#10576)
Browse files Browse the repository at this point in the history
Signed-off-by: Nick Ufer <nick@ufer.dev>
  • Loading branch information
NickUfer committed Oct 12, 2021
1 parent b4206ad commit 80c3a0e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,9 @@ class ObjectSerializer
if ($class === 'object') {
settype($data, 'array');
return $data;
} else if ($class === 'mixed') {
settype($data, gettype($data));
return $data;
}

if ($class === '\DateTime') {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,9 @@ public static function deserialize($data, $class, $httpHeaders = null)
if ($class === 'object') {
settype($data, 'array');
return $data;
} else if ($class === 'mixed') {
settype($data, gettype($data));
return $data;
}

if ($class === '\DateTime') {
Expand Down

0 comments on commit 80c3a0e

Please sign in to comment.