mapper.php

Basically a serialization wrapper for netresearch/jsonmapper
git clone git://git.finwo.net/lib/mapper.php
Log | Files | Refs | README

commit 96b8dc67f84b5e2e82c2576f0fd4a7c69c14b71d
parent 25f80a43c9420f7387a47fa64d9b95bd85753e2e
Author: finwo <finwo@pm.me>
Date:   Wed, 21 Dec 2016 10:21:27 +0100

Array fix

Diffstat:
Msrc/Mapper.php | 4++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/Mapper.php b/src/Mapper.php @@ -29,7 +29,7 @@ class Mapper * * @return $this */ - public function map($objectOrString, &$targetObject = array()) + public function map($objectOrString, $targetObject = array()) { // Initialize json-mapper static $mapper = null; @@ -44,7 +44,7 @@ class Mapper // Map into target if (is_array($data)) { $class = is_object($targetObject) ? get_class($targetObject) : is_array($targetObject) ? null : "$targetObject"; - $targetObject = $mapper->mapArray($data, array(), $class); + return $mapper->mapArray($data, array(), $class); } else { $mapper->map($data, $targetObject); }