@@ -24,17 +24,17 @@ |
||
| 24 | 24 | public function __construct(\ReflectionParameter $param, $value) |
| 25 | 25 | { |
| 26 | 26 | if(is_array($value)) { |
| 27 | - $data = $value; |
|
| 27 | + $data = $value; |
|
| 28 | 28 | } else { |
| 29 | - if(!is_string($value)) { |
|
| 29 | + if(!is_string($value)) { |
|
| 30 | 30 | throw new Exception\InvalidArgument('Parameter '.$param->name.' expects a json string. ' . gettype($value).' given.'); |
| 31 | - } |
|
| 31 | + } |
|
| 32 | 32 | |
| 33 | - $data = json_decode($value); |
|
| 33 | + $data = json_decode($value); |
|
| 34 | 34 | |
| 35 | - if($data === null) { |
|
| 36 | - throw new Exception\InvalidArgument('Parameter '.$param->name.' expects a valid json string. ' . json_last_error_msg()); |
|
| 37 | - } |
|
| 35 | + if($data === null) { |
|
| 36 | + throw new Exception\InvalidArgument('Parameter '.$param->name.' expects a valid json string. ' . json_last_error_msg()); |
|
| 37 | + } |
|
| 38 | 38 | } |
| 39 | 39 | |
| 40 | 40 | return call_user_func_array(array('parent', __FUNCTION__), [$data]); |