| Conditions | 6 |
| Paths | 6 |
| Total Lines | 21 |
| Code Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 11 |
| CRAP Score | 6.0208 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 48 | 2 | public function __invoke(RequestInterface $request, ResponseInterface $response, array &$options = []): ?string |
|
| 49 | { |
||
| 50 | 2 | $scriptData = ScraperUtil::extractScriptData($response->getBody()->getContents()); |
|
| 51 | 2 | $url = null; |
|
| 52 | |||
| 53 | 2 | foreach ($scriptData as $value) { |
|
| 54 | if ( |
||
| 55 | 2 | isset($value[1][1][1][21][1][2][4][2]) |
|
| 56 | 2 | && \is_string($value[1][1][1][21][1][2][4][2]) |
|
| 57 | 2 | && strpos($value[1][1][1][21][1][2][4][2], 'cluster') !== false |
|
| 58 | ) { |
||
| 59 | 2 | $url = $value[1][1][1][21][1][2][4][2]; |
|
| 60 | 2 | break; |
|
| 61 | } |
||
| 62 | } |
||
| 63 | |||
| 64 | 2 | if ($url !== null) { |
|
| 65 | 2 | return GPlayApps::GOOGLE_PLAY_URL . $url; |
|
| 66 | } |
||
| 67 | |||
| 68 | return null; |
||
| 69 | } |
||
| 71 |