Skip to content

Commit 8d1461e

Browse files
committed
array to object normalizer update
1 parent d68d65f commit 8d1461e

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "hostinger/api-php-sdk",
3-
"version": "0.0.38",
3+
"version": "0.0.39",
44
"description": "Hostinger API PHP SDK",
55
"keywords": [
66
"hostinger",

src/Normalizers/ArrayToObjectNormalizer.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,10 @@ public function supportsDenormalization(mixed $data, string $type, ?string $form
4747
$reflection = new \ReflectionClass($type);
4848

4949
foreach ($data as $key => $value) {
50+
if (!is_string($key)) {
51+
continue;
52+
}
53+
5054
if (is_array($value) && $this->shouldBeObject($reflection, $key)) {
5155
return true;
5256
}

0 commit comments

Comments
 (0)