@@ -191,7 +191,7 @@ discard block |
||
191 | 191 | } |
192 | 192 | $parts = \array_slice($parts, 0, 4); |
193 | 193 | $path = implode('/', $parts); |
194 | - $url = $httpComponents['scheme'] . '://' . $httpComponents['host'] . '/' . $path . '/'; |
|
194 | + $url = $httpComponents['scheme'].'://'.$httpComponents['host'].'/'.$path.'/'; |
|
195 | 195 | $this->variantOfUrlWithFileName = true; |
196 | 196 | } elseif (($pos = strpos($url, '=')) !== false) { |
197 | 197 | $paramString = substr($url, $pos + 1); |
@@ -272,14 +272,14 @@ discard block |
||
272 | 272 | $params = []; |
273 | 273 | |
274 | 274 | if ($this->size !== null) { |
275 | - $params[] = self::PARAM_SIZE . $this->size; |
|
275 | + $params[] = self::PARAM_SIZE.$this->size; |
|
276 | 276 | } else { |
277 | 277 | if ($this->width !== null) { |
278 | - $params[] = self::PARAM_WIDTH . $this->width; |
|
278 | + $params[] = self::PARAM_WIDTH.$this->width; |
|
279 | 279 | } |
280 | 280 | |
281 | 281 | if ($this->height !== null) { |
282 | - $params[] = self::PARAM_HEIGHT . $this->height; |
|
282 | + $params[] = self::PARAM_HEIGHT.$this->height; |
|
283 | 283 | } |
284 | 284 | } |
285 | 285 | |
@@ -294,11 +294,11 @@ discard block |
||
294 | 294 | return $this->baseUrl; |
295 | 295 | } |
296 | 296 | |
297 | - return $this->baseUrl . implode('-', $params) . '/'; |
|
297 | + return $this->baseUrl.implode('-', $params).'/'; |
|
298 | 298 | } |
299 | 299 | |
300 | 300 | if ($this->border !== null) { |
301 | - $params[] = self::PARAM_BORDER . $this->border; |
|
301 | + $params[] = self::PARAM_BORDER.$this->border; |
|
302 | 302 | } |
303 | 303 | |
304 | 304 | if ($this->verticalFlip) { |
@@ -313,7 +313,7 @@ discard block |
||
313 | 313 | return $this->baseUrl; |
314 | 314 | } |
315 | 315 | |
316 | - return $this->baseUrl . '=' . implode('-', $params); |
|
316 | + return $this->baseUrl.'='.implode('-', $params); |
|
317 | 317 | } |
318 | 318 | |
319 | 319 | /** |
@@ -335,13 +335,13 @@ discard block |
||
335 | 335 | */ |
336 | 336 | public function getOriginalSizeUrl(): string |
337 | 337 | { |
338 | - $params = [self::PARAM_SIZE . '0']; |
|
338 | + $params = [self::PARAM_SIZE.'0']; |
|
339 | 339 | |
340 | 340 | if ($this->variantOfUrlWithFileName) { |
341 | - return $this->baseUrl . implode('-', $params) . '/'; |
|
341 | + return $this->baseUrl.implode('-', $params).'/'; |
|
342 | 342 | } |
343 | 343 | |
344 | - return $this->baseUrl . '=' . implode('-', $params); |
|
344 | + return $this->baseUrl.'='.implode('-', $params); |
|
345 | 345 | } |
346 | 346 | |
347 | 347 | /** |
@@ -366,7 +366,7 @@ discard block |
||
366 | 366 | for ($i = 0; $i < $parts; $i++) { |
367 | 367 | $partsBuild[] = substr($hash, $i * $partLength, $partLength); |
368 | 368 | } |
369 | - $hash = implode('/', $partsBuild) . '/' . $hash; |
|
369 | + $hash = implode('/', $partsBuild).'/'.$hash; |
|
370 | 370 | } |
371 | 371 | |
372 | 372 | return $hash; |
@@ -631,7 +631,7 @@ discard block |
||
631 | 631 | RequestOptions::COOKIES => null, |
632 | 632 | RequestOptions::HTTP_ERRORS => true, |
633 | 633 | RequestOptions::SINK => $stream, |
634 | - RequestOptions::ON_HEADERS => static function (ResponseInterface $response) use ( |
|
634 | + RequestOptions::ON_HEADERS => static function(ResponseInterface $response) use ( |
|
635 | 635 | $url, |
636 | 636 | $stream |
637 | 637 | ): void { |
@@ -668,7 +668,7 @@ discard block |
||
668 | 668 | $contentType = $response->getHeaderLine('Content-Type'); |
669 | 669 | |
670 | 670 | if (!preg_match('~\bimage/.*\b~i', $contentType, $match)) { |
671 | - throw new GooglePlayException('Url ' . $url . ' is not image'); |
|
671 | + throw new GooglePlayException('Url '.$url.' is not image'); |
|
672 | 672 | } |
673 | 673 | $contentType = $match[0]; |
674 | 674 | $imageType = self::getImageExtension($contentType); |
@@ -51,7 +51,7 @@ |
||
51 | 51 | $imageInfo = getimagesize($filename); |
52 | 52 | |
53 | 53 | if (!$imageInfo) { |
54 | - throw new \RuntimeException('Invalid image: ' . $filename); |
|
54 | + throw new \RuntimeException('Invalid image: '.$filename); |
|
55 | 55 | } |
56 | 56 | $this->filename = $filename; |
57 | 57 | $this->mimeType = $imageInfo['mime']; |
@@ -519,7 +519,7 @@ discard block |
||
519 | 519 | $diff = array_udiff( |
520 | 520 | $otherApp->screenshots, |
521 | 521 | $this->screenshots, |
522 | - static function (GoogleImage $a, GoogleImage $b) { |
|
522 | + static function(GoogleImage $a, GoogleImage $b) { |
|
523 | 523 | return strcmp($a->getOriginalSizeUrl(), $b->getOriginalSizeUrl()); |
524 | 524 | } |
525 | 525 | ); |
@@ -539,7 +539,7 @@ discard block |
||
539 | 539 | $array['translatedFromLocale'] = $this->translatedFromLocale; |
540 | 540 | $array['cover'] = $this->cover !== null ? $this->cover->getUrl() : null; |
541 | 541 | $array['screenshots'] = array_map( |
542 | - static function (GoogleImage $googleImage) { |
|
542 | + static function(GoogleImage $googleImage) { |
|
543 | 543 | return $googleImage->getUrl(); |
544 | 544 | }, |
545 | 545 | $this->screenshots |
@@ -569,7 +569,7 @@ discard block |
||
569 | 569 | $array['updatedTimestamp'] = $this->updated !== null ? $this->updated->getTimestamp() : 0; |
570 | 570 | $array['numberReviews'] = $this->numberReviews; |
571 | 571 | $array['reviews'] = array_map( |
572 | - static function (Review $review) { |
|
572 | + static function(Review $review) { |
|
573 | 573 | return $review->asArray(); |
574 | 574 | }, |
575 | 575 | $this->reviews |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | if (preg_match_all('/>AF_initDataCallback\((.*?)\);<\/script/s', $html, $matches)) { |
29 | 29 | $scripts = array_reduce( |
30 | 30 | $matches[0], |
31 | - static function ($carry, $item) { |
|
31 | + static function($carry, $item) { |
|
32 | 32 | if ( |
33 | 33 | preg_match("/(ds:.*?)'/", $item, $keyMatch) && |
34 | 34 | preg_match('/data:([\s\S]*?)(, }\);<\/|, sideChannel:)/', $item, $valueMatch) |
@@ -55,10 +55,10 @@ discard block |
||
55 | 55 | $doc = new \DOMDocument(); |
56 | 56 | $internalErrors = libxml_use_internal_errors(true); |
57 | 57 | |
58 | - if (!$doc->loadHTML('<?xml encoding="utf-8"?>' . $html)) { |
|
58 | + if (!$doc->loadHTML('<?xml encoding="utf-8"?>'.$html)) { |
|
59 | 59 | throw new |
60 | 60 | \RuntimeException( |
61 | - 'error load html: ' . $html |
|
61 | + 'error load html: '.$html |
|
62 | 62 | ); |
63 | 63 | } |
64 | 64 | libxml_use_internal_errors($internalErrors); |
@@ -108,11 +108,11 @@ discard block |
||
108 | 108 | case 'p': |
109 | 109 | case 'ul': |
110 | 110 | case 'div': |
111 | - $text = "\n\n" . $text . "\n\n"; |
|
111 | + $text = "\n\n".$text."\n\n"; |
|
112 | 112 | break; |
113 | 113 | |
114 | 114 | case 'li': |
115 | - $text = '- ' . $text . "\n"; |
|
115 | + $text = '- '.$text."\n"; |
|
116 | 116 | break; |
117 | 117 | |
118 | 118 | case 'br': |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | public const GOOGLE_PLAY_URL = 'https://play.google.com'; |
36 | 36 | |
37 | 37 | /** @var string Google Play apps url. */ |
38 | - public const GOOGLE_PLAY_APPS_URL = self::GOOGLE_PLAY_URL . '/store/apps'; |
|
38 | + public const GOOGLE_PLAY_APPS_URL = self::GOOGLE_PLAY_URL.'/store/apps'; |
|
39 | 39 | |
40 | 40 | /** @var int Unlimit results. */ |
41 | 41 | public const UNLIMIT = -1; |
@@ -317,18 +317,18 @@ discard block |
||
317 | 317 | */ |
318 | 318 | $list = array_filter( |
319 | 319 | $list, |
320 | - static function (Model\AppInfo $app) { |
|
320 | + static function(Model\AppInfo $app) { |
|
321 | 321 | return !$app->isAutoTranslatedDescription(); |
322 | 322 | } |
323 | 323 | ); |
324 | 324 | |
325 | 325 | if (!isset($list[$preferredLocale])) { |
326 | - throw new \RuntimeException('No key ' . $preferredLocale); |
|
326 | + throw new \RuntimeException('No key '.$preferredLocale); |
|
327 | 327 | } |
328 | 328 | $preferredApp = $list[$preferredLocale]; |
329 | 329 | $list = array_filter( |
330 | 330 | $list, |
331 | - static function (Model\AppInfo $app, string $locale) use ($preferredApp, $list) { |
|
331 | + static function(Model\AppInfo $app, string $locale) use ($preferredApp, $list) { |
|
332 | 332 | // deletes locales in which there is no translation added, but automatic translation by Google Translate is used. |
333 | 333 | if ($preferredApp->getLocale() === $locale || !$preferredApp->equals($app)) { |
334 | 334 | if (($pos = strpos($locale, '_')) !== false) { |
@@ -357,7 +357,7 @@ discard block |
||
357 | 357 | // sorting array keys; the first key is the preferred locale |
358 | 358 | uksort( |
359 | 359 | $list, |
360 | - static function ( |
|
360 | + static function( |
|
361 | 361 | /** @noinspection PhpUnusedParameterInspection */ |
362 | 362 | string $a, |
363 | 363 | string $b |
@@ -467,14 +467,12 @@ discard block |
||
467 | 467 | $allReviews = []; |
468 | 468 | |
469 | 469 | $cacheTtl = $sort === Enum\SortEnum::NEWEST() ? |
470 | - \DateInterval::createFromDateString('1 min') : |
|
471 | - \DateInterval::createFromDateString('1 hour'); |
|
470 | + \DateInterval::createFromDateString('1 min') : \DateInterval::createFromDateString('1 hour'); |
|
472 | 471 | |
473 | 472 | try { |
474 | 473 | do { |
475 | 474 | $count = $limit === self::UNLIMIT ? |
476 | - Scraper\PlayStoreUiRequest::LIMIT_REVIEW_ON_PAGE : |
|
477 | - min(Scraper\PlayStoreUiRequest::LIMIT_REVIEW_ON_PAGE, max($limit - $allCount, 1)); |
|
475 | + Scraper\PlayStoreUiRequest::LIMIT_REVIEW_ON_PAGE : min(Scraper\PlayStoreUiRequest::LIMIT_REVIEW_ON_PAGE, max($limit - $allCount, 1)); |
|
478 | 476 | |
479 | 477 | $request = Scraper\PlayStoreUiRequest::getReviewsRequest($appId, $count, $sort, $token); |
480 | 478 | |
@@ -514,7 +512,7 @@ discard block |
||
514 | 512 | /** @var Model\Review $review */ |
515 | 513 | $review = $this->getHttpClient()->request( |
516 | 514 | 'GET', |
517 | - self::GOOGLE_PLAY_APPS_URL . '/details', |
|
515 | + self::GOOGLE_PLAY_APPS_URL.'/details', |
|
518 | 516 | [ |
519 | 517 | RequestOptions::QUERY => [ |
520 | 518 | self::REQ_PARAM_ID => $appId->getId(), |
@@ -623,7 +621,7 @@ discard block |
||
623 | 621 | $url = self::GOOGLE_PLAY_APPS_URL; |
624 | 622 | |
625 | 623 | foreach ($locales as $locale) { |
626 | - $urls[$locale] = $url . '?' . http_build_query( |
|
624 | + $urls[$locale] = $url.'?'.http_build_query( |
|
627 | 625 | [ |
628 | 626 | self::REQ_PARAM_LOCALE => $locale, |
629 | 627 | ] |
@@ -688,7 +686,7 @@ discard block |
||
688 | 686 | ); |
689 | 687 | } |
690 | 688 | |
691 | - $url = self::GOOGLE_PLAY_APPS_URL . '/dev'; |
|
689 | + $url = self::GOOGLE_PLAY_APPS_URL.'/dev'; |
|
692 | 690 | |
693 | 691 | try { |
694 | 692 | /** @var Model\Developer $developer */ |
@@ -748,10 +746,10 @@ discard block |
||
748 | 746 | } |
749 | 747 | |
750 | 748 | $urls = []; |
751 | - $url = self::GOOGLE_PLAY_APPS_URL . '/dev'; |
|
749 | + $url = self::GOOGLE_PLAY_APPS_URL.'/dev'; |
|
752 | 750 | |
753 | 751 | foreach ($locales as $locale) { |
754 | - $urls[$locale] = $url . '?' . http_build_query( |
|
752 | + $urls[$locale] = $url.'?'.http_build_query( |
|
755 | 753 | [ |
756 | 754 | self::REQ_PARAM_ID => $id, |
757 | 755 | self::REQ_PARAM_LOCALE => $locale, |
@@ -797,7 +795,7 @@ discard block |
||
797 | 795 | ]; |
798 | 796 | |
799 | 797 | if (is_numeric($developerId)) { |
800 | - $developerUrl = self::GOOGLE_PLAY_APPS_URL . '/dev?' . http_build_query($query); |
|
798 | + $developerUrl = self::GOOGLE_PLAY_APPS_URL.'/dev?'.http_build_query($query); |
|
801 | 799 | |
802 | 800 | try { |
803 | 801 | /** |
@@ -814,13 +812,13 @@ discard block |
||
814 | 812 | if ($developerUrl === null) { |
815 | 813 | return []; |
816 | 814 | } |
817 | - $developerUrl .= '&' . self::REQ_PARAM_LOCALE . '=' . urlencode($this->defaultLocale) . |
|
818 | - '&' . self::REQ_PARAM_COUNTRY . '=' . urlencode($this->defaultCountry); |
|
815 | + $developerUrl .= '&'.self::REQ_PARAM_LOCALE.'='.urlencode($this->defaultLocale). |
|
816 | + '&'.self::REQ_PARAM_COUNTRY.'='.urlencode($this->defaultCountry); |
|
819 | 817 | } catch (\Throwable $e) { |
820 | 818 | throw new Exception\GooglePlayException($e->getMessage(), 1, $e); |
821 | 819 | } |
822 | 820 | } else { |
823 | - $developerUrl = self::GOOGLE_PLAY_APPS_URL . '/developer?' . http_build_query($query); |
|
821 | + $developerUrl = self::GOOGLE_PLAY_APPS_URL.'/developer?'.http_build_query($query); |
|
824 | 822 | } |
825 | 823 | |
826 | 824 | return $this->fetchAppsFromClusterPage( |
@@ -861,10 +859,10 @@ discard block |
||
861 | 859 | $query[self::REQ_PARAM_LOCALE] = $locale; |
862 | 860 | $query[self::REQ_PARAM_COUNTRY] = $country; |
863 | 861 | |
864 | - $clusterPageUrl = $clusterPageComponents['scheme'] . '://' . |
|
865 | - $clusterPageComponents['host'] . |
|
866 | - $clusterPageComponents['path'] . |
|
867 | - '?' . Query::build($query); |
|
862 | + $clusterPageUrl = $clusterPageComponents['scheme'].'://'. |
|
863 | + $clusterPageComponents['host']. |
|
864 | + $clusterPageComponents['path']. |
|
865 | + '?'.Query::build($query); |
|
868 | 866 | |
869 | 867 | try { |
870 | 868 | [$apps, $token] = $this->getHttpClient()->request( |
@@ -880,8 +878,7 @@ discard block |
||
880 | 878 | |
881 | 879 | while ($token !== null && ($limit === self::UNLIMIT || $allCount < $limit)) { |
882 | 880 | $count = $limit === self::UNLIMIT ? |
883 | - Scraper\PlayStoreUiRequest::LIMIT_APPS_ON_PAGE : |
|
884 | - min(Scraper\PlayStoreUiRequest::LIMIT_APPS_ON_PAGE, max($limit - $allCount, 1)); |
|
881 | + Scraper\PlayStoreUiRequest::LIMIT_APPS_ON_PAGE : min(Scraper\PlayStoreUiRequest::LIMIT_APPS_ON_PAGE, max($limit - $allCount, 1)); |
|
885 | 882 | |
886 | 883 | $request = Scraper\PlayStoreUiRequest::getAppsRequest($locale, $country, $count, $token); |
887 | 884 | |
@@ -1027,7 +1024,7 @@ discard block |
||
1027 | 1024 | self::REQ_PARAM_COUNTRY => $this->defaultCountry, |
1028 | 1025 | 'price' => $price->value(), |
1029 | 1026 | ]; |
1030 | - $clusterPageUrl = self::GOOGLE_PLAY_URL . '/store/search?' . http_build_query($params); |
|
1027 | + $clusterPageUrl = self::GOOGLE_PLAY_URL.'/store/search?'.http_build_query($params); |
|
1031 | 1028 | |
1032 | 1029 | return $this->fetchAppsFromClusterPage( |
1033 | 1030 | $clusterPageUrl, |
@@ -1132,13 +1129,13 @@ discard block |
||
1132 | 1129 | $url = self::GOOGLE_PLAY_APPS_URL; |
1133 | 1130 | |
1134 | 1131 | if ($path !== null) { |
1135 | - $url .= '/' . $path; |
|
1132 | + $url .= '/'.$path; |
|
1136 | 1133 | } |
1137 | 1134 | |
1138 | 1135 | if ($category !== null) { |
1139 | - $url .= '/category/' . Util\Caster::castToCategoryId($category); |
|
1136 | + $url .= '/category/'.Util\Caster::castToCategoryId($category); |
|
1140 | 1137 | } |
1141 | - $url .= '?' . http_build_query($queryParams); |
|
1138 | + $url .= '?'.http_build_query($queryParams); |
|
1142 | 1139 | |
1143 | 1140 | /** |
1144 | 1141 | * @var array $categoryClusterPages = [[ |
@@ -1230,7 +1227,7 @@ discard block |
||
1230 | 1227 | foreach ($images as $image) { |
1231 | 1228 | if (!$image instanceof Model\GoogleImage) { |
1232 | 1229 | throw new \InvalidArgumentException( |
1233 | - 'An array of ' . Model\GoogleImage::class . ' objects is expected.' |
|
1230 | + 'An array of '.Model\GoogleImage::class.' objects is expected.' |
|
1234 | 1231 | ); |
1235 | 1232 | } |
1236 | 1233 | $destPath = $destPathCallback($image); |
@@ -1239,7 +1236,7 @@ discard block |
||
1239 | 1236 | } |
1240 | 1237 | |
1241 | 1238 | $httpClient = $this->getHttpClient(); |
1242 | - $promises = (static function () use ($mapping, $overwrite, $httpClient) { |
|
1239 | + $promises = (static function() use ($mapping, $overwrite, $httpClient) { |
|
1243 | 1240 | foreach ($mapping as $url => $stream) { |
1244 | 1241 | $destPath = $stream->getFilename(); |
1245 | 1242 | $dynamicPath = strpos($destPath, '{url}') !== false; |
@@ -1255,7 +1252,7 @@ discard block |
||
1255 | 1252 | RequestOptions::COOKIES => null, |
1256 | 1253 | RequestOptions::SINK => $stream, |
1257 | 1254 | RequestOptions::HTTP_ERRORS => true, |
1258 | - RequestOptions::ON_HEADERS => static function (ResponseInterface $response) use ( |
|
1255 | + RequestOptions::ON_HEADERS => static function(ResponseInterface $response) use ( |
|
1259 | 1256 | $url, |
1260 | 1257 | $stream |
1261 | 1258 | ): void { |
@@ -1264,7 +1261,7 @@ discard block |
||
1264 | 1261 | ] |
1265 | 1262 | ) |
1266 | 1263 | ->then( |
1267 | - static function ( |
|
1264 | + static function( |
|
1268 | 1265 | /** @noinspection PhpUnusedParameterInspection */ |
1269 | 1266 | ResponseInterface $response |
1270 | 1267 | ) use ($url) { |
@@ -1284,10 +1281,10 @@ discard block |
||
1284 | 1281 | $promises, |
1285 | 1282 | [ |
1286 | 1283 | 'concurrency' => $this->concurrency, |
1287 | - 'fulfilled' => static function (string $url) use (&$imageInfoList, $mapping): void { |
|
1284 | + 'fulfilled' => static function(string $url) use (&$imageInfoList, $mapping): void { |
|
1288 | 1285 | $imageInfoList[] = new Model\ImageInfo($url, $mapping[$url]->getFilename()); |
1289 | 1286 | }, |
1290 | - 'rejected' => static function (\Throwable $reason, string $exceptionUrl) use ($mapping): void { |
|
1287 | + 'rejected' => static function(\Throwable $reason, string $exceptionUrl) use ($mapping): void { |
|
1291 | 1288 | foreach ($mapping as $destPath => $url) { |
1292 | 1289 | if (is_file($destPath)) { |
1293 | 1290 | unlink($destPath); |
@@ -1356,8 +1353,7 @@ discard block |
||
1356 | 1353 | public function setDefaultCountry(string $defaultCountry): self |
1357 | 1354 | { |
1358 | 1355 | $this->defaultCountry = !empty($defaultCountry) ? |
1359 | - $defaultCountry : |
|
1360 | - self::DEFAULT_COUNTRY; |
|
1356 | + $defaultCountry : self::DEFAULT_COUNTRY; |
|
1361 | 1357 | |
1362 | 1358 | return $this; |
1363 | 1359 | } |
@@ -1206,7 +1206,7 @@ discard block |
||
1206 | 1206 | |
1207 | 1207 | if (isset($datePatternObj['convert'])) { |
1208 | 1208 | $convertedText = forward_static_call($datePatternObj['convert'], $dateText); |
1209 | - if ($convertedText !== false){ |
|
1209 | + if ($convertedText !== false) { |
|
1210 | 1210 | $dateText = (string) $convertedText; |
1211 | 1211 | } |
1212 | 1212 | } |
@@ -1219,8 +1219,8 @@ discard block |
||
1219 | 1219 | if (isset($datePatternObj['months'])) { |
1220 | 1220 | if (!isset($datePatternObj['months'][$month])) { |
1221 | 1221 | throw new \RuntimeException( |
1222 | - 'Error convert date. Locale ' . $locale . '. Date: ' . $dateText . |
|
1223 | - '. Matches: ' . var_export($match, true) |
|
1222 | + 'Error convert date. Locale '.$locale.'. Date: '.$dateText. |
|
1223 | + '. Matches: '.var_export($match, true) |
|
1224 | 1224 | ); |
1225 | 1225 | } |
1226 | 1226 | $month = $datePatternObj['months'][$month]; |
@@ -1232,7 +1232,7 @@ discard block |
||
1232 | 1232 | |
1233 | 1233 | $dateTime = \DateTimeImmutable::createFromFormat( |
1234 | 1234 | 'Y.m.d H:i:s', |
1235 | - $year . '.' . $month . '.' . $day . ' 00:00:00', |
|
1235 | + $year.'.'.$month.'.'.$day.' 00:00:00', |
|
1236 | 1236 | new \DateTimeZone('UTC') |
1237 | 1237 | ); |
1238 | 1238 |
@@ -59,11 +59,11 @@ discard block |
||
59 | 59 | 'soc-platform' => 1, |
60 | 60 | 'soc-device' => 1, |
61 | 61 | ]; |
62 | - $url = GPlayApps::GOOGLE_PLAY_URL . '/_/PlayStoreUi/data/batchexecute?' . http_build_query($queryParams); |
|
62 | + $url = GPlayApps::GOOGLE_PLAY_URL.'/_/PlayStoreUi/data/batchexecute?'.http_build_query($queryParams); |
|
63 | 63 | $formParams = [ |
64 | - 'f.req' => '[[["' . self::RPC_ID_REVIEWS . '","[null,null,[2,' . $sort->value( |
|
65 | - ) . ',[' . $limit . ',null,' . ($token === null ? 'null' : '\\"' . $token . '\\"') . |
|
66 | - ']],[\\"' . $requestApp->getId() . '\\",7]]",null,"generic"]]]', |
|
64 | + 'f.req' => '[[["'.self::RPC_ID_REVIEWS.'","[null,null,[2,'.$sort->value( |
|
65 | + ).',['.$limit.',null,'.($token === null ? 'null' : '\\"'.$token.'\\"'). |
|
66 | + ']],[\\"'.$requestApp->getId().'\\",7]]",null,"generic"]]]', |
|
67 | 67 | ]; |
68 | 68 | $headers = [ |
69 | 69 | 'Content-Type' => 'application/x-www-form-urlencoded;charset=utf-8', |
@@ -92,9 +92,9 @@ discard block |
||
92 | 92 | 'soc-platform' => 1, |
93 | 93 | 'soc-device' => 1, |
94 | 94 | ]; |
95 | - $url = GPlayApps::GOOGLE_PLAY_URL . '/_/PlayStoreUi/data/batchexecute?' . http_build_query($queryParams); |
|
95 | + $url = GPlayApps::GOOGLE_PLAY_URL.'/_/PlayStoreUi/data/batchexecute?'.http_build_query($queryParams); |
|
96 | 96 | $formParams = [ |
97 | - 'f.req' => '[[["' . self::RPC_ID_APPS . '","[[null,[[10,[10,' . $limit . ']],true,null,[1]],null,\\"' . $token . '\\"]]",null,"generic"]]]', |
|
97 | + 'f.req' => '[[["'.self::RPC_ID_APPS.'","[[null,[[10,[10,'.$limit.']],true,null,[1]],null,\\"'.$token.'\\"]]",null,"generic"]]]', |
|
98 | 98 | ]; |
99 | 99 | $headers = [ |
100 | 100 | 'Content-Type' => 'application/x-www-form-urlencoded;charset=utf-8', |
@@ -121,10 +121,10 @@ discard block |
||
121 | 121 | 'soc-platform' => 1, |
122 | 122 | 'soc-device' => 1, |
123 | 123 | ]; |
124 | - $url = GPlayApps::GOOGLE_PLAY_URL . '/_/PlayStoreUi/data/batchexecute?' . http_build_query($queryParams); |
|
124 | + $url = GPlayApps::GOOGLE_PLAY_URL.'/_/PlayStoreUi/data/batchexecute?'.http_build_query($queryParams); |
|
125 | 125 | $formParams = [ |
126 | - 'f.req' => '[[["' . self::RPC_ID_PERMISSIONS . '","[[null,[\"' . |
|
127 | - $requestApp->getId() . '\",7],[]]]",null,"1"]]]', |
|
126 | + 'f.req' => '[[["'.self::RPC_ID_PERMISSIONS.'","[[null,[\"'. |
|
127 | + $requestApp->getId().'\",7],[]]]",null,"1"]]]', |
|
128 | 128 | ]; |
129 | 129 | $headers = [ |
130 | 130 | 'Content-Type' => 'application/x-www-form-urlencoded;charset=utf-8', |
@@ -158,10 +158,10 @@ discard block |
||
158 | 158 | 'soc-platform' => 1, |
159 | 159 | 'soc-device' => 1, |
160 | 160 | ]; |
161 | - $url = GPlayApps::GOOGLE_PLAY_URL . '/_/PlayStoreUi/data/batchexecute?' . http_build_query($queryParams); |
|
161 | + $url = GPlayApps::GOOGLE_PLAY_URL.'/_/PlayStoreUi/data/batchexecute?'.http_build_query($queryParams); |
|
162 | 162 | $formParams = [ |
163 | - 'f.req' => '[[["' . self::RPC_ID_SUGGEST . '","[[null,[\"' . |
|
164 | - str_replace('"', '\\\\\\"', $query) . |
|
163 | + 'f.req' => '[[["'.self::RPC_ID_SUGGEST.'","[[null,[\"'. |
|
164 | + str_replace('"', '\\\\\\"', $query). |
|
165 | 165 | '\"],[10],[2],4]]",null,"generic"]]]', |
166 | 166 | ]; |
167 | 167 | $headers = [ |
@@ -25,7 +25,7 @@ |
||
25 | 25 | $json = \GuzzleHttp\json_decode($contents, true); |
26 | 26 | $suggests = \GuzzleHttp\json_decode($json[0][2], true); |
27 | 27 | |
28 | - return array_map(static function (array $suggest): string { |
|
28 | + return array_map(static function(array $suggest): string { |
|
29 | 29 | return (string) $suggest[0]; |
30 | 30 | }, $suggests[0][0] ?? []); |
31 | 31 | } |