Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
idangozlan committed Dec 24, 2014
2 parents a00c8ab + 299b4b4 commit 7795d74
Showing 1 changed file with 22 additions and 21 deletions.
43 changes: 22 additions & 21 deletions zray.php
Original file line number Diff line number Diff line change
Expand Up @@ -239,27 +239,28 @@ private function collectConfig($config, &$storage) {
*
* @return array
*/
private function makeArraySerializable($data)
{
$serializable = array();

foreach (ArrayUtils::iteratorToArray($data) as $key => $value) {
if ($value instanceof Traversable || is_array($value)) {
$serializable[$key] = $this->makeArraySerializable($value);

continue;
}

if ($value instanceof Closure) {
$serializable[$key] = new ClosureStub();

continue;
}

$serializable[$key] = $value;
}

return $serializable;
private function makeArraySerializable($data) {
$serializable = array();
try {
foreach (ArrayUtils::iteratorToArray($data) as $key => $value) {
if ($value instanceof Traversable || is_array($value)) {
$serializable[$key] = $this->makeArraySerializable($value);

continue;
}

if ($value instanceof Closure) {
$serializable[$key] = new ClosureStub();
continue;
}

$serializable[$key] = $value;
}
} catch (\InvalidArgumentException $e) {
return $serializable;
}

return $serializable;
}

private function reorderArray($config) {
Expand Down

0 comments on commit 7795d74

Please sign in to comment.