Skip to content

Commit

Permalink
update samples
Browse files Browse the repository at this point in the history
  • Loading branch information
wing328 committed Jul 2, 2020
1 parent 40a0052 commit ede2150
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,11 @@ public static function deserialize($data, $class, $httpHeaders = null)
return null;
} elseif (strcasecmp(substr($class, -2), '[]') === 0) {
$data = is_string($data) ? json_decode($data) : $data;

if (!is_array($data)) {
throw new \InvalidArgumentException("Invalid array '$class'");
}

$subClass = substr($class, 0, -2);
$values = [];
foreach ($data as $key => $value) {
Expand Down

0 comments on commit ede2150

Please sign in to comment.