Skip to content

Commit

Permalink
avoid to cast other values than object in the DataMapper
Browse files Browse the repository at this point in the history
  • Loading branch information
Raphhh committed May 7, 2015
1 parent 5a6de9b commit 546ada1
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Mapper/DataMapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,10 @@ public function unmapObject($object)
if ($object instanceof IArrayCastable) {
return $object->toArray();
}
return (array)$object;
if(is_object($object)){
return (array)$object;
}
return $object;
}

/**
Expand Down

0 comments on commit 546ada1

Please sign in to comment.