| Conditions | 2 |
| Paths | 2 |
| Total Lines | 11 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 56 | protected function handleResponse($response, $class, $isArray = false) |
||
| 57 | { |
||
| 58 | $object = json_decode($response, true); |
||
| 59 | if ($isArray) { |
||
| 60 | return array_map(function ($entity) use ($class) { |
||
| 61 | return new $class($entity); |
||
| 62 | }, $object); |
||
| 63 | } |
||
| 64 | |||
| 65 | return new $class($object); |
||
| 66 | } |
||
| 67 | } |
||
| 68 |