We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3edd1e7 commit 75d71dcCopy full SHA for 75d71dc
1 file changed
src/API/Type.php
@@ -85,11 +85,19 @@ public function castToExchange($value, $type)
85
86
public static function buildFromArray($array)
87
{
88
+ if (!is_array($array)) {
89
+ return $array;
90
+ }
91
+
92
if (!self::arrayIsAssoc($array)) {
93
+ foreach ($array as $key => $value) {
94
+ $array[$key] = self::buildFromArray($value);
95
96
97
return $array;
98
}
99
- $object = new self();
100
+ $object = new static();
101
foreach ($array as $key => $value) {
102
if (is_array($value)) {
103
$value = self::buildFromArray($value);
0 commit comments