Conditions | 3 |
Paths | 3 |
Total Lines | 15 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
34 | public function __invoke(RequestInterface $request, ResponseInterface $response) |
||
35 | { |
||
36 | $contents = substr($response->getBody()->getContents(), 5); |
||
37 | $json = \GuzzleHttp\json_decode($contents, true); |
||
38 | if (!isset($json[0][2])) { |
||
39 | return [[], null]; |
||
40 | } |
||
41 | $json = \GuzzleHttp\json_decode($json[0][2], true); |
||
42 | |||
43 | if (empty($json[0])) { |
||
44 | return [[], null]; |
||
45 | } |
||
46 | $reviews = ReviewsExtractor::extractReviews($this->requestApp, $json[0]); |
||
47 | $nextToken = $json[1][1] ?? null; |
||
48 | return [$reviews, $nextToken]; |
||
49 | } |
||
51 |