| @@ 293-297 (lines=5) @@ | ||
| 290 | $return = static::create(); |
|
| 291 | $jsonObject = \json_decode($json, false); |
|
| 292 | $mapper = new \Arrayy\Mapper\Json(); |
|
| 293 | $mapper->undefinedPropertyHandler = static function ($object, $key, $jsonValue) use ($return) { |
|
| 294 | if ($return->checkForMissingPropertiesInConstructor) { |
|
| 295 | throw new \TypeError('Property mismatch - input: ' . \print_r(['key' => $key, 'jsonValue' => $jsonValue], true) . ' for object: ' . \get_class($object)); |
|
| 296 | } |
|
| 297 | }; |
|
| 298 | ||
| 299 | $type = $return->getType(); |
|
| 300 | ||
| @@ 2720-2724 (lines=5) @@ | ||
| 2717 | $jsonObject = \json_decode($json, false); |
|
| 2718 | ||
| 2719 | $mapper = new \Arrayy\Mapper\Json(); |
|
| 2720 | $mapper->undefinedPropertyHandler = static function ($object, $key, $jsonValue) use ($class) { |
|
| 2721 | if ($class->checkPropertiesMismatchInConstructor) { |
|
| 2722 | throw new \TypeError('Property mismatch - input: ' . \print_r(['key' => $key, 'jsonValue' => $jsonValue], true) . ' for object: ' . \get_class($object)); |
|
| 2723 | } |
|
| 2724 | }; |
|
| 2725 | ||
| 2726 | return $mapper->map($jsonObject, $class); |
|
| 2727 | } |
|