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