| Conditions | 3 |
| Paths | 3 |
| Total Lines | 17 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 9 |
| CRAP Score | 3.054 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 44 | 1 | public function __invoke(RequestInterface $request, ResponseInterface $response) |
|
| 45 | { |
||
| 46 | 1 | $contents = substr($response->getBody()->getContents(), 5); |
|
| 47 | 1 | $json = \GuzzleHttp\json_decode($contents, true); |
|
| 48 | |||
| 49 | 1 | if (!isset($json[0][2])) { |
|
| 50 | return [[], null]; |
||
| 51 | } |
||
| 52 | 1 | $json = \GuzzleHttp\json_decode($json[0][2], true); |
|
| 53 | |||
| 54 | 1 | if (empty($json[0])) { |
|
| 55 | return [[], null]; |
||
| 56 | } |
||
| 57 | 1 | $reviews = ReviewsExtractor::extractReviews($this->requestApp, $json[0]); |
|
| 58 | 1 | $nextToken = $json[1][1] ?? null; |
|
| 59 | |||
| 60 | 1 | return [$reviews, $nextToken]; |
|
| 61 | } |
||
| 63 |