@@ -48,9 +48,9 @@ |
||
| 48 | 48 | |
| 49 | 49 | foreach ($scriptData as $key => $scriptValue) { |
| 50 | 50 | if (isset($scriptValue[1][1][0][0][3][4][2])) { |
| 51 | - return GPlayApps::GOOGLE_PLAY_URL . $scriptValue[1][1][0][0][3][4][2] . |
|
| 52 | - '&' . GPlayApps::REQ_PARAM_LOCALE . '=' . urlencode($this->appId->getLocale()) . |
|
| 53 | - '&' . GPlayApps::REQ_PARAM_COUNTRY . '=' . urlencode($this->appId->getCountry()); |
|
| 51 | + return GPlayApps::GOOGLE_PLAY_URL.$scriptValue[1][1][0][0][3][4][2]. |
|
| 52 | + '&'.GPlayApps::REQ_PARAM_LOCALE.'='.urlencode($this->appId->getLocale()). |
|
| 53 | + '&'.GPlayApps::REQ_PARAM_COUNTRY.'='.urlencode($this->appId->getCountry()); |
|
| 54 | 54 | break; |
| 55 | 55 | } |
| 56 | 56 | } |
@@ -51,7 +51,7 @@ |
||
| 51 | 51 | } |
| 52 | 52 | |
| 53 | 53 | if (isset($scriptDataApps[0][1][0][0][3][4][2])) { |
| 54 | - return GPlayApps::GOOGLE_PLAY_URL . $scriptDataApps[0][1][0][0][3][4][2]; |
|
| 54 | + return GPlayApps::GOOGLE_PLAY_URL.$scriptDataApps[0][1][0][0][3][4][2]; |
|
| 55 | 55 | } |
| 56 | 56 | |
| 57 | 57 | return null; |
@@ -214,8 +214,7 @@ discard block |
||
| 214 | 214 | LocaleHelper::findPreferredLanguage( |
| 215 | 215 | $locale, |
| 216 | 216 | $scriptDataInfo[0][19][1] |
| 217 | - ) : |
|
| 218 | - null; |
|
| 217 | + ) : null; |
|
| 219 | 218 | } |
| 220 | 219 | |
| 221 | 220 | /** |
@@ -251,7 +250,7 @@ discard block |
||
| 251 | 250 | */ |
| 252 | 251 | private function extractDeveloper(array $scriptDataInfo): Developer |
| 253 | 252 | { |
| 254 | - $developerPage = GPlayApps::GOOGLE_PLAY_URL . $scriptDataInfo[0][12][5][5][4][2]; |
|
| 253 | + $developerPage = GPlayApps::GOOGLE_PLAY_URL.$scriptDataInfo[0][12][5][5][4][2]; |
|
| 255 | 254 | $developerId = parse_query(parse_url($developerPage, \PHP_URL_QUERY))[GPlayApps::REQ_PARAM_ID]; |
| 256 | 255 | $developerName = $scriptDataInfo[0][12][5][1]; |
| 257 | 256 | $developerEmail = $scriptDataInfo[0][12][5][2][0] ?? null; |
@@ -311,8 +310,7 @@ discard block |
||
| 311 | 310 | protected function extractPrice(array $scriptDataPrice): ?float |
| 312 | 311 | { |
| 313 | 312 | return isset($scriptDataPrice[0][2][0][0][0][1][0][0]) ? |
| 314 | - (float) ($scriptDataPrice[0][2][0][0][0][1][0][0] / 1000000) : |
|
| 315 | - 0.0; |
|
| 313 | + (float) ($scriptDataPrice[0][2][0][0][0][1][0][0] / 1000000) : 0.0; |
|
| 316 | 314 | } |
| 317 | 315 | |
| 318 | 316 | /** |
@@ -347,7 +345,7 @@ discard block |
||
| 347 | 345 | private function extractScreenshots(array $scriptDataInfo): array |
| 348 | 346 | { |
| 349 | 347 | return !empty($scriptDataInfo[0][12][0]) ? array_map( |
| 350 | - static function (array $v) { |
|
| 348 | + static function(array $v) { |
|
| 351 | 349 | return new GoogleImage($v[3][2]); |
| 352 | 350 | }, |
| 353 | 351 | $scriptDataInfo[0][12][0] |
@@ -57,11 +57,11 @@ discard block |
||
| 57 | 57 | 'soc-platform' => 1, |
| 58 | 58 | 'soc-device' => 1, |
| 59 | 59 | ]; |
| 60 | - $url = GPlayApps::GOOGLE_PLAY_URL . '/_/PlayStoreUi/data/batchexecute?' . http_build_query($queryParams); |
|
| 60 | + $url = GPlayApps::GOOGLE_PLAY_URL.'/_/PlayStoreUi/data/batchexecute?'.http_build_query($queryParams); |
|
| 61 | 61 | $formParams = [ |
| 62 | - 'f.req' => '[[["' . self::RPC_ID_REVIEWS . '","[null,null,[2,' . $sort->value( |
|
| 63 | - ) . ',[' . $limit . ',null,' . ($token === null ? 'null' : '\\"' . $token . '\\"') . ']],[\\"' . $requestApp->getId( |
|
| 64 | - ) . '\\",7]]",null,"generic"]]]', |
|
| 62 | + 'f.req' => '[[["'.self::RPC_ID_REVIEWS.'","[null,null,[2,'.$sort->value( |
|
| 63 | + ).',['.$limit.',null,'.($token === null ? 'null' : '\\"'.$token.'\\"').']],[\\"'.$requestApp->getId( |
|
| 64 | + ).'\\",7]]",null,"generic"]]]', |
|
| 65 | 65 | ]; |
| 66 | 66 | $headers = [ |
| 67 | 67 | 'Content-Type' => 'application/x-www-form-urlencoded;charset=utf-8', |
@@ -90,9 +90,9 @@ discard block |
||
| 90 | 90 | 'soc-platform' => 1, |
| 91 | 91 | 'soc-device' => 1, |
| 92 | 92 | ]; |
| 93 | - $url = GPlayApps::GOOGLE_PLAY_URL . '/_/PlayStoreUi/data/batchexecute?' . http_build_query($queryParams); |
|
| 93 | + $url = GPlayApps::GOOGLE_PLAY_URL.'/_/PlayStoreUi/data/batchexecute?'.http_build_query($queryParams); |
|
| 94 | 94 | $formParams = [ |
| 95 | - 'f.req' => '[[["' . self::RPC_ID_APPS . '","[[null,[[10,[10,' . $limit . ']],true,null,[1]],null,\\"' . $token . '\\"]]",null,"generic"]]]', |
|
| 95 | + 'f.req' => '[[["'.self::RPC_ID_APPS.'","[[null,[[10,[10,'.$limit.']],true,null,[1]],null,\\"'.$token.'\\"]]",null,"generic"]]]', |
|
| 96 | 96 | ]; |
| 97 | 97 | $headers = [ |
| 98 | 98 | 'Content-Type' => 'application/x-www-form-urlencoded;charset=utf-8', |
@@ -119,10 +119,10 @@ discard block |
||
| 119 | 119 | 'soc-platform' => 1, |
| 120 | 120 | 'soc-device' => 1, |
| 121 | 121 | ]; |
| 122 | - $url = GPlayApps::GOOGLE_PLAY_URL . '/_/PlayStoreUi/data/batchexecute?' . http_build_query($queryParams); |
|
| 122 | + $url = GPlayApps::GOOGLE_PLAY_URL.'/_/PlayStoreUi/data/batchexecute?'.http_build_query($queryParams); |
|
| 123 | 123 | $formParams = [ |
| 124 | - 'f.req' => '[[["' . self::RPC_ID_PERMISSIONS . '","[[null,[\"' . |
|
| 125 | - $requestApp->getId() . '\",7],[]]]",null,"1"]]]', |
|
| 124 | + 'f.req' => '[[["'.self::RPC_ID_PERMISSIONS.'","[[null,[\"'. |
|
| 125 | + $requestApp->getId().'\",7],[]]]",null,"1"]]]', |
|
| 126 | 126 | ]; |
| 127 | 127 | $headers = [ |
| 128 | 128 | 'Content-Type' => 'application/x-www-form-urlencoded;charset=utf-8', |
@@ -34,7 +34,7 @@ discard block |
||
| 34 | 34 | $json = \GuzzleHttp\json_decode($contents, true); |
| 35 | 35 | $data = \GuzzleHttp\json_decode($json[0][2], true); |
| 36 | 36 | |
| 37 | - $permissionMapFn = static function (array $v): string { |
|
| 37 | + $permissionMapFn = static function(array $v): string { |
|
| 38 | 38 | return (string) $v[1]; |
| 39 | 39 | }; |
| 40 | 40 | |
@@ -65,7 +65,7 @@ discard block |
||
| 65 | 65 | } |
| 66 | 66 | |
| 67 | 67 | return array_map( |
| 68 | - static function (array $data) { |
|
| 68 | + static function(array $data) { |
|
| 69 | 69 | return new Permission($data['name'], $data['icon'], $data['permissions']); |
| 70 | 70 | }, |
| 71 | 71 | $permissions |
@@ -24,7 +24,7 @@ |
||
| 24 | 24 | $json = \GuzzleHttp\json_decode($response->getBody()->getContents(), true); |
| 25 | 25 | |
| 26 | 26 | return array_map( |
| 27 | - static function (array $v) { |
|
| 27 | + static function(array $v) { |
|
| 28 | 28 | return $v['s']; |
| 29 | 29 | }, |
| 30 | 30 | $json |
@@ -41,7 +41,7 @@ |
||
| 41 | 41 | if (isset($a[0][1], $a[0][3][4][2])) { |
| 42 | 42 | $results[] = [ |
| 43 | 43 | 'name' => trim($a[0][1]), |
| 44 | - 'url' => GPlayApps::GOOGLE_PLAY_URL . $a[0][3][4][2], |
|
| 44 | + 'url' => GPlayApps::GOOGLE_PLAY_URL.$a[0][3][4][2], |
|
| 45 | 45 | ]; |
| 46 | 46 | } |
| 47 | 47 | } |
@@ -52,10 +52,10 @@ |
||
| 52 | 52 | ; |
| 53 | 53 | } |
| 54 | 54 | |
| 55 | - $parseCategories = static function (array $items) use (&$parseCategories): array { |
|
| 55 | + $parseCategories = static function(array $items) use (&$parseCategories): array { |
|
| 56 | 56 | return array_reduce( |
| 57 | 57 | $items, |
| 58 | - static function ($results, $item) use (&$parseCategories) { |
|
| 58 | + static function($results, $item) use (&$parseCategories) { |
|
| 59 | 59 | if (\is_array($item)) { |
| 60 | 60 | if ( |
| 61 | 61 | \count($item) === 6 && |
@@ -62,7 +62,7 @@ |
||
| 62 | 62 | private static function extractDeveloper(array $data): Developer |
| 63 | 63 | { |
| 64 | 64 | $developerName = $data[4][0][0][0]; |
| 65 | - $developerPage = GPlayApps::GOOGLE_PLAY_URL . $data[4][0][0][1][4][2]; |
|
| 65 | + $developerPage = GPlayApps::GOOGLE_PLAY_URL.$data[4][0][0][1][4][2]; |
|
| 66 | 66 | $developerId = parse_query(parse_url($developerPage, \PHP_URL_QUERY))[GPlayApps::REQ_PARAM_ID]; |
| 67 | 67 | |
| 68 | 68 | return new Developer( |