Skip to content

Commit

Permalink
Fix on check item array is object or not
Browse files Browse the repository at this point in the history
  • Loading branch information
DyanGalih committed Jul 1, 2019
1 parent c959062 commit 8e2fc29
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions src/Tools/PopoTools.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,17 +62,12 @@ public function serialize($object)
if ($value[$i] instanceof Model) {
//nothing todo
} else {
$objectAsArrayChild = (array)$value[$i];
foreach ($objectAsArrayChild as $childKey => $childValue) {
$newChildKey = $this->fixKey($childKey);
if ($newKey != $key) {
$this->replaceKey($objectAsArrayChild, $childKey, $newChildKey);
}
if (is_object($value[$i])) {
$value[$i] = $this->serialize($value[$i]);
}
$value[$i] = $objectAsArrayChild;
}
$objectAsArray[$newKey] = $value;
}
$objectAsArray[$newKey] = $value;
}
}
}
Expand Down

0 comments on commit 8e2fc29

Please sign in to comment.