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