| @@ 29-34 (lines=6) @@ | ||
| 26 | */ |
|
| 27 | public function map($json, $object) |
|
| 28 | { |
|
| 29 | if (!is_object($json)) { |
|
| 30 | throw new InvalidArgumentException( |
|
| 31 | 'JsonMapper::map() requires first argument to be an object' |
|
| 32 | . ', ' . gettype($json) . ' given.' |
|
| 33 | ); |
|
| 34 | } |
|
| 35 | if (!is_object($object)) { |
|
| 36 | throw new InvalidArgumentException( |
|
| 37 | 'JsonMapper::map() requires second argument to be an object' |
|
| @@ 35-40 (lines=6) @@ | ||
| 32 | . ', ' . gettype($json) . ' given.' |
|
| 33 | ); |
|
| 34 | } |
|
| 35 | if (!is_object($object)) { |
|
| 36 | throw new InvalidArgumentException( |
|
| 37 | 'JsonMapper::map() requires second argument to be an object' |
|
| 38 | . ', ' . gettype($object) . ' given.' |
|
| 39 | ); |
|
| 40 | } |
|
| 41 | ||
| 42 | foreach ($json as $key => $jvalue) { |
|
| 43 | $key = $this->getSafeName($key); |
|