Skip to content

Commit 56a347a

Browse files
committed
fix: fixed object normalization
1 parent 0b36059 commit 56a347a

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
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.40",
3+
"version": "0.0.41",
44
"description": "Hostinger API PHP SDK",
55
"keywords": [
66
"hostinger",

src/Configuration.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class Configuration
2020

2121
protected string $host = 'https://developers.hostinger.com';
2222

23-
protected string $userAgent = 'hostinger-php-sdk/0.0.40';
23+
protected string $userAgent = 'hostinger-php-sdk/0.0.41';
2424

2525
protected bool $debug = false;
2626

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)