| @@ -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; | 
| @@ -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( | 
| @@ -48,7 +48,7 @@ | ||
| 48 | 48 | public static function extractReview(AppId $requestApp, $reviewData): Review | 
| 49 | 49 |      { | 
| 50 | 50 | $reviewId = $reviewData[0]; | 
| 51 | - $reviewUrl = $requestApp->getUrl() . '&reviewId=' . urlencode($reviewId); | |
| 51 | + $reviewUrl = $requestApp->getUrl().'&reviewId='.urlencode($reviewId); | |
| 52 | 52 | $userName = $reviewData[1][0]; | 
| 53 | 53 | $avatar = (new GoogleImage($reviewData[1][1][3][2]))->setSize(64); | 
| 54 | 54 | $date = DateStringFormatter::unixTimeToDateTime($reviewData[5][0]); |