Conditions | 2 |
Paths | 2 |
Total Lines | 14 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
15 | public function parseResponse($response): array |
||
16 | { |
||
17 | // Parse predictions |
||
18 | $i = 0; |
||
19 | foreach ($response['predictions'] as $res) { |
||
20 | $this->results[$i]['id'] = $res['description']; |
||
21 | $this->results[$i]['text'] = $res['description']; |
||
22 | $this->results[$i]['place_id'] = $res['place_id']; |
||
23 | $i++; |
||
24 | } |
||
25 | |||
26 | return [ |
||
27 | 'total_count' => count($this->results), |
||
28 | 'items' => $this->results, |
||
29 | ]; |
||
32 |