@@ -37,8 +37,8 @@ |
||
37 | 37 | ->setUrl($request->getUri()->__toString()); |
38 | 38 | } |
39 | 39 | |
40 | - $parseCategories = static function (array $items) use (&$parseCategories) : array { |
|
41 | - return array_reduce($items, static function ($results, $item) use (&$parseCategories) { |
|
40 | + $parseCategories = static function(array $items) use (&$parseCategories) : array { |
|
41 | + return array_reduce($items, static function($results, $item) use (&$parseCategories) { |
|
42 | 42 | if (is_array($item)) { |
43 | 43 | if ( |
44 | 44 | count($item) === 6 && |
@@ -21,8 +21,8 @@ |
||
21 | 21 | $json = \GuzzleHttp\json_decode($contents, true); |
22 | 22 | $data = $json[0][2][0][65]['42656262'][1] ?? []; |
23 | 23 | |
24 | - $parsePermissions = static function (array $items) use (&$parsePermissions) { |
|
25 | - return array_reduce($items, static function ($results, $item) use (&$parsePermissions) { |
|
24 | + $parsePermissions = static function(array $items) use (&$parsePermissions) { |
|
25 | + return array_reduce($items, static function($results, $item) use (&$parsePermissions) { |
|
26 | 26 | if (is_array($item)) { |
27 | 27 | if (count($item) === 3 && is_string($item[0]) && is_string($item[1])) { |
28 | 28 | $results[] = new Permission($item[0], $item[1]); |
@@ -160,7 +160,7 @@ discard block |
||
160 | 160 | } |
161 | 161 | $parts = array_slice($parts, 0, 4); |
162 | 162 | $path = implode('/', $parts); |
163 | - $url = $httpComponents['scheme'] . '://' . $httpComponents['host'] . '/' . $path . '/'; |
|
163 | + $url = $httpComponents['scheme'].'://'.$httpComponents['host'].'/'.$path.'/'; |
|
164 | 164 | $this->variantOfUrlWithFileName = true; |
165 | 165 | } elseif (($pos = strpos($url, '=')) !== false) { |
166 | 166 | $paramString = substr($url, $pos + 1); |
@@ -188,19 +188,19 @@ discard block |
||
188 | 188 | $command = $param[0]; // 1 char |
189 | 189 | switch ($command) { |
190 | 190 | case self::PARAM_SIZE: |
191 | - $arg = (int)substr($param, 1); |
|
191 | + $arg = (int) substr($param, 1); |
|
192 | 192 | $this->setSize($arg); |
193 | 193 | break; |
194 | 194 | case self::PARAM_WIDTH: |
195 | - $arg = (int)substr($param, 1); |
|
195 | + $arg = (int) substr($param, 1); |
|
196 | 196 | $this->setWidth($arg); |
197 | 197 | break; |
198 | 198 | case self::PARAM_HEIGHT: |
199 | - $arg = (int)substr($param, 1); |
|
199 | + $arg = (int) substr($param, 1); |
|
200 | 200 | $this->setHeight($arg); |
201 | 201 | break; |
202 | 202 | case self::PARAM_BORDER: |
203 | - $arg = (int)substr($param, 1); |
|
203 | + $arg = (int) substr($param, 1); |
|
204 | 204 | $this->setBorder($arg); |
205 | 205 | break; |
206 | 206 | case self::PARAM_SQUARE_CROP: |
@@ -230,13 +230,13 @@ discard block |
||
230 | 230 | { |
231 | 231 | $params = []; |
232 | 232 | if ($this->size !== null) { |
233 | - $params[] = self::PARAM_SIZE . $this->size; |
|
233 | + $params[] = self::PARAM_SIZE.$this->size; |
|
234 | 234 | } else { |
235 | 235 | if ($this->width !== null) { |
236 | - $params[] = self::PARAM_WIDTH . $this->width; |
|
236 | + $params[] = self::PARAM_WIDTH.$this->width; |
|
237 | 237 | } |
238 | 238 | if ($this->height !== null) { |
239 | - $params[] = self::PARAM_HEIGHT . $this->height; |
|
239 | + $params[] = self::PARAM_HEIGHT.$this->height; |
|
240 | 240 | } |
241 | 241 | } |
242 | 242 | |
@@ -255,11 +255,11 @@ discard block |
||
255 | 255 | if (empty($params)) { |
256 | 256 | return $this->url; |
257 | 257 | } |
258 | - return $this->url . implode('-', $params) . '/'; |
|
258 | + return $this->url.implode('-', $params).'/'; |
|
259 | 259 | } |
260 | 260 | |
261 | 261 | if ($this->border !== null) { |
262 | - $params[] = self::PARAM_BORDER . $this->border; |
|
262 | + $params[] = self::PARAM_BORDER.$this->border; |
|
263 | 263 | } |
264 | 264 | |
265 | 265 | if ($this->verticalFlip) { |
@@ -273,7 +273,7 @@ discard block |
||
273 | 273 | if (empty($params)) { |
274 | 274 | return $this->url; |
275 | 275 | } |
276 | - return $this->url . '=' . implode('-', $params); |
|
276 | + return $this->url.'='.implode('-', $params); |
|
277 | 277 | } |
278 | 278 | |
279 | 279 | /** |
@@ -283,11 +283,11 @@ discard block |
||
283 | 283 | */ |
284 | 284 | public function getBestSizeUrl(): string |
285 | 285 | { |
286 | - $params = [self::PARAM_SIZE . '0']; |
|
286 | + $params = [self::PARAM_SIZE.'0']; |
|
287 | 287 | if ($this->variantOfUrlWithFileName) { |
288 | - return $this->url . implode('-', $params) . '/'; |
|
288 | + return $this->url.implode('-', $params).'/'; |
|
289 | 289 | } |
290 | - return $this->url . '=' . implode('-', $params); |
|
290 | + return $this->url.'='.implode('-', $params); |
|
291 | 291 | } |
292 | 292 | |
293 | 293 | /** |
@@ -305,12 +305,12 @@ discard block |
||
305 | 305 | $hashLength = strlen($hash); |
306 | 306 | $parts = max(1, min(6, $parts)); |
307 | 307 | if ($parts > 1) { |
308 | - $partLength = max(1, min($partLength, (int)($hashLength / $parts))); |
|
308 | + $partLength = max(1, min($partLength, (int) ($hashLength / $parts))); |
|
309 | 309 | $partsBuild = []; |
310 | 310 | for ($i = 0; $i < $parts; $i++) { |
311 | 311 | $partsBuild[] = substr($hash, $i * $partLength, $partLength); |
312 | 312 | } |
313 | - $hash = implode('/', $partsBuild) . '/' . $hash; |
|
313 | + $hash = implode('/', $partsBuild).'/'.$hash; |
|
314 | 314 | } |
315 | 315 | return $hash; |
316 | 316 | } |
@@ -528,7 +528,7 @@ discard block |
||
528 | 528 | ]); |
529 | 529 | |
530 | 530 | return new ImageInfo($url, $destPath); |
531 | - } catch (\Throwable|GuzzleException $e) { |
|
531 | + } catch (\Throwable | GuzzleException $e) { |
|
532 | 532 | if (is_file($destPath)) { |
533 | 533 | unlink($destPath); |
534 | 534 | } |
@@ -414,7 +414,7 @@ |
||
414 | 414 | return false; |
415 | 415 | } |
416 | 416 | |
417 | - $diff = array_udiff($o->screenshots, $this->screenshots, static function (GoogleImage $a, GoogleImage $b) { |
|
417 | + $diff = array_udiff($o->screenshots, $this->screenshots, static function(GoogleImage $a, GoogleImage $b) { |
|
418 | 418 | return strcmp($a->getUrl(), $b->getUrl()); |
419 | 419 | }); |
420 | 420 | return empty($diff); |
@@ -45,7 +45,7 @@ |
||
45 | 45 | $this->url = $url; |
46 | 46 | $imageInfo = getimagesize($path); |
47 | 47 | if (!$imageInfo) { |
48 | - throw new \RuntimeException('Invalid image: ' . $path); |
|
48 | + throw new \RuntimeException('Invalid image: '.$path); |
|
49 | 49 | } |
50 | 50 | $this->path = $path; |
51 | 51 | $this->mimeType = $imageInfo['mime']; |
@@ -60,7 +60,7 @@ |
||
60 | 60 | } |
61 | 61 | |
62 | 62 | /** |
63 | - * @return mixed |
|
63 | + * @return string |
|
64 | 64 | */ |
65 | 65 | public function getUrl() |
66 | 66 | { |
@@ -13,7 +13,7 @@ discard block |
||
13 | 13 | { |
14 | 14 | $scripts = []; |
15 | 15 | if (preg_match_all('/>AF_initDataCallback[\s\S]*?<\/script/', $html, $matches)) { |
16 | - $scripts = array_reduce($matches[0], static function ($carry, $item) { |
|
16 | + $scripts = array_reduce($matches[0], static function($carry, $item) { |
|
17 | 17 | if ( |
18 | 18 | preg_match("/(ds:.*?)'/", $item, $keyMatch) && |
19 | 19 | preg_match('/return ([\s\S]*?)}}\);<\//', $item, $valueMatch) |
@@ -34,8 +34,8 @@ discard block |
||
34 | 34 | { |
35 | 35 | $doc = new \DOMDocument(); |
36 | 36 | $internalErrors = libxml_use_internal_errors(true); |
37 | - if (!$doc->loadHTML('<?xml encoding="utf-8" ?>' . $html)) { |
|
38 | - throw new \RuntimeException('error load html: ' . $html); |
|
37 | + if (!$doc->loadHTML('<?xml encoding="utf-8" ?>'.$html)) { |
|
38 | + throw new \RuntimeException('error load html: '.$html); |
|
39 | 39 | } |
40 | 40 | libxml_use_internal_errors($internalErrors); |
41 | 41 | $text = self::convertDomNodeToText($doc); |
@@ -69,10 +69,10 @@ discard block |
||
69 | 69 | case 'p': |
70 | 70 | case 'ul': |
71 | 71 | case 'div': |
72 | - $text = "\n\n" . $text . "\n\n"; |
|
72 | + $text = "\n\n".$text."\n\n"; |
|
73 | 73 | break; |
74 | 74 | case 'li': |
75 | - $text = '- ' . $text . "\n"; |
|
75 | + $text = '- '.$text."\n"; |
|
76 | 76 | break; |
77 | 77 | case 'br': |
78 | 78 | $text .= "\n"; |
@@ -54,14 +54,14 @@ discard block |
||
54 | 54 | |
55 | 55 | $handlerStack = HandlerStack::create(); |
56 | 56 | $handlerStack->unshift( |
57 | - function (callable $handler) { |
|
58 | - return function (RequestInterface $request, array $options) use ($handler) { |
|
57 | + function(callable $handler) { |
|
58 | + return function(RequestInterface $request, array $options) use ($handler) { |
|
59 | 59 | if (!isset($options[self::OPTION_HANDLER_RESPONSE])) { |
60 | 60 | return $handler($request, $options); |
61 | 61 | } |
62 | 62 | |
63 | 63 | if (!$options[self::OPTION_HANDLER_RESPONSE] instanceof ResponseHandlerInterface) { |
64 | - throw new \RuntimeException("'" . self::OPTION_HANDLER_RESPONSE . "' option is not implements " . ResponseHandlerInterface::class); |
|
64 | + throw new \RuntimeException("'".self::OPTION_HANDLER_RESPONSE."' option is not implements ".ResponseHandlerInterface::class); |
|
65 | 65 | } |
66 | 66 | |
67 | 67 | if ($this->cache !== null) { |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | throw new \RuntimeException($e->getMessage(), $e->getCode(), $e); |
89 | 89 | } |
90 | 90 | } |
91 | - $handlerHash = (string)$hashes[$func]; |
|
91 | + $handlerHash = (string) $hashes[$func]; |
|
92 | 92 | } else { |
93 | 93 | $handlerHash = $ref->getName(); |
94 | 94 | } |
@@ -108,7 +108,7 @@ discard block |
||
108 | 108 | |
109 | 109 | return $handler($request, $options) |
110 | 110 | ->then( |
111 | - function (ResponseInterface $response) use ($options, $request) { |
|
111 | + function(ResponseInterface $response) use ($options, $request) { |
|
112 | 112 | $result = call_user_func( |
113 | 113 | $options[self::OPTION_HANDLER_RESPONSE], |
114 | 114 | $request, |
@@ -133,7 +133,7 @@ discard block |
||
133 | 133 | ); |
134 | 134 | $handlerStack->push( |
135 | 135 | Middleware::retry( |
136 | - function ( |
|
136 | + function( |
|
137 | 137 | $retries, |
138 | 138 | /** @noinspection PhpUnusedParameterInspection */ |
139 | 139 | RequestInterface $request, |
@@ -160,7 +160,7 @@ discard block |
||
160 | 160 | } |
161 | 161 | return false; |
162 | 162 | }, |
163 | - static function (int $numberOfRetries) { |
|
163 | + static function(int $numberOfRetries) { |
|
164 | 164 | // retry delay |
165 | 165 | return 1000 * $numberOfRetries; |
166 | 166 | } |
@@ -289,11 +289,11 @@ discard block |
||
289 | 289 | { |
290 | 290 | $data = [ |
291 | 291 | $request->getMethod(), |
292 | - (string)$request->getUri(), |
|
292 | + (string) $request->getUri(), |
|
293 | 293 | $request->getBody()->getContents(), |
294 | 294 | ]; |
295 | 295 | foreach ($request->getHeaders() as $name => $header) { |
296 | - $data[] = $name . ': ' . implode(', ', $header); |
|
296 | + $data[] = $name.': '.implode(', ', $header); |
|
297 | 297 | } |
298 | 298 | $data[] = $request->getBody()->getContents(); |
299 | 299 | return hash('crc32b', implode("\n", $data)); |
@@ -313,7 +313,7 @@ discard block |
||
313 | 313 | if (!$urls instanceof \Generator) { |
314 | 314 | $urls = $this->requestGenerator($method, $urls, $options); |
315 | 315 | } |
316 | - each_limit_all($urls, $concurrency, static function ($response, $index) use (&$results) { |
|
316 | + each_limit_all($urls, $concurrency, static function($response, $index) use (&$results) { |
|
317 | 317 | $results[$index] = $response; |
318 | 318 | })->wait(); |
319 | 319 | return $results; |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | public const DEFAULT_COUNTRY = 'us'; // Affected price |
60 | 60 | |
61 | 61 | public const GOOGLE_PLAY_URL = 'https://play.google.com'; |
62 | - public const GOOGLE_PLAY_APPS_URL = self::GOOGLE_PLAY_URL . '/store/apps'; |
|
62 | + public const GOOGLE_PLAY_APPS_URL = self::GOOGLE_PLAY_URL.'/store/apps'; |
|
63 | 63 | public const MAX_SEARCH_RESULTS = 250; |
64 | 64 | |
65 | 65 | public const REQ_PARAM_LOCALE = 'hl'; |
@@ -328,7 +328,7 @@ discard block |
||
328 | 328 | } |
329 | 329 | |
330 | 330 | $preferredApp = $list[$preferredLocale]; |
331 | - $list = array_filter($list, static function (AppDetail $app, string $locale) use ($preferredApp, $list) { |
|
331 | + $list = array_filter($list, static function(AppDetail $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) { |
@@ -352,7 +352,7 @@ discard block |
||
352 | 352 | // sorting array keys; the first key is the preferred locale |
353 | 353 | uksort( |
354 | 354 | $list, |
355 | - static function ( |
|
355 | + static function( |
|
356 | 356 | /** @noinspection PhpUnusedParameterInspection */ |
357 | 357 | string $a, |
358 | 358 | string $b |
@@ -376,7 +376,7 @@ discard block |
||
376 | 376 | $requestApp = $this->castToRequestApp($requestApp); |
377 | 377 | |
378 | 378 | try { |
379 | - return (bool)$this->getHttpClient()->request( |
|
379 | + return (bool) $this->getHttpClient()->request( |
|
380 | 380 | 'HEAD', |
381 | 381 | $requestApp->getFullUrl(), |
382 | 382 | [ |
@@ -452,8 +452,7 @@ discard block |
||
452 | 452 | try { |
453 | 453 | do { |
454 | 454 | $count = $limit === -1 ? |
455 | - PlayStoreUiRequest::LIMIT_REVIEW_ON_PAGE : |
|
456 | - min(PlayStoreUiRequest::LIMIT_REVIEW_ON_PAGE, max($limit - $allCount, 1)); |
|
455 | + PlayStoreUiRequest::LIMIT_REVIEW_ON_PAGE : min(PlayStoreUiRequest::LIMIT_REVIEW_ON_PAGE, max($limit - $allCount, 1)); |
|
457 | 456 | |
458 | 457 | $request = PlayStoreUiRequest::getReviewsRequest($requestApp, $count, $sort, $token); |
459 | 458 | |
@@ -540,8 +539,7 @@ discard block |
||
540 | 539 | |
541 | 540 | while ($token !== null && ($limit === -1 || $allCount < $limit)) { |
542 | 541 | $count = $limit === -1 ? |
543 | - PlayStoreUiRequest::LIMIT_APPS_ON_PAGE : |
|
544 | - min(PlayStoreUiRequest::LIMIT_APPS_ON_PAGE, max($limit - $allCount, 1)); |
|
542 | + PlayStoreUiRequest::LIMIT_APPS_ON_PAGE : min(PlayStoreUiRequest::LIMIT_APPS_ON_PAGE, max($limit - $allCount, 1)); |
|
545 | 543 | |
546 | 544 | $request = PlayStoreUiRequest::getAppsRequest($locale, $country, $count, $token); |
547 | 545 | |
@@ -572,7 +570,7 @@ discard block |
||
572 | 570 | { |
573 | 571 | $requestApp = $this->castToRequestApp($requestApp); |
574 | 572 | |
575 | - $url = self::GOOGLE_PLAY_URL . '/store/xhr/getdoc?authuser=0'; |
|
573 | + $url = self::GOOGLE_PLAY_URL.'/store/xhr/getdoc?authuser=0'; |
|
576 | 574 | try { |
577 | 575 | return $this->getHttpClient()->request( |
578 | 576 | 'POST', |
@@ -638,7 +636,7 @@ discard block |
||
638 | 636 | $urls = []; |
639 | 637 | $url = self::GOOGLE_PLAY_APPS_URL; |
640 | 638 | foreach ($locales as $locale) { |
641 | - $urls[$locale] = $url . '?' . http_build_query([ |
|
639 | + $urls[$locale] = $url.'?'.http_build_query([ |
|
642 | 640 | self::REQ_PARAM_LOCALE => $locale, |
643 | 641 | ]); |
644 | 642 | } |
@@ -685,7 +683,7 @@ discard block |
||
685 | 683 | } |
686 | 684 | |
687 | 685 | $locale = LocaleHelper::getNormalizeLocale($locale ?? $this->defaultLocale); |
688 | - $url = self::GOOGLE_PLAY_APPS_URL . '/dev'; |
|
686 | + $url = self::GOOGLE_PLAY_APPS_URL.'/dev'; |
|
689 | 687 | try { |
690 | 688 | return $this->getHttpClient()->request( |
691 | 689 | 'GET', |
@@ -716,7 +714,7 @@ discard block |
||
716 | 714 | return $developerId->getId(); |
717 | 715 | } |
718 | 716 | if (is_int($developerId)) { |
719 | - return (string)$developerId; |
|
717 | + return (string) $developerId; |
|
720 | 718 | } |
721 | 719 | return $developerId; |
722 | 720 | } |
@@ -743,9 +741,9 @@ discard block |
||
743 | 741 | } |
744 | 742 | |
745 | 743 | $urls = []; |
746 | - $url = self::GOOGLE_PLAY_APPS_URL . '/dev'; |
|
744 | + $url = self::GOOGLE_PLAY_APPS_URL.'/dev'; |
|
747 | 745 | foreach ($locales as $locale) { |
748 | - $urls[$locale] = $url . '?' . http_build_query([ |
|
746 | + $urls[$locale] = $url.'?'.http_build_query([ |
|
749 | 747 | self::REQ_PARAM_ID => $id, |
750 | 748 | self::REQ_PARAM_LOCALE => $locale, |
751 | 749 | ]); |
@@ -780,7 +778,7 @@ discard block |
||
780 | 778 | $preferredLocale = self::DEFAULT_LOCALE; |
781 | 779 | |
782 | 780 | $preferredInfo = $list[$preferredLocale]; |
783 | - $list = array_filter($list, static function (Developer $info, string $locale) use ($preferredInfo, $preferredLocale) { |
|
781 | + $list = array_filter($list, static function(Developer $info, string $locale) use ($preferredInfo, $preferredLocale) { |
|
784 | 782 | return $locale === $preferredLocale || $preferredInfo->equals($info); |
785 | 783 | }, ARRAY_FILTER_USE_BOTH); |
786 | 784 | |
@@ -828,7 +826,7 @@ discard block |
||
828 | 826 | ]; |
829 | 827 | |
830 | 828 | if (is_numeric($developerId)) { |
831 | - $developerUrl = self::GOOGLE_PLAY_APPS_URL . '/dev?' . http_build_query($query); |
|
829 | + $developerUrl = self::GOOGLE_PLAY_APPS_URL.'/dev?'.http_build_query($query); |
|
832 | 830 | try { |
833 | 831 | /** |
834 | 832 | * @var string|null $developerUrl |
@@ -843,13 +841,13 @@ discard block |
||
843 | 841 | if ($developerUrl === null) { |
844 | 842 | return []; |
845 | 843 | } |
846 | - $developerUrl .= '&' . self::REQ_PARAM_LOCALE . '=' . urlencode($locale) . |
|
847 | - '&' . self::REQ_PARAM_COUNTRY . '=' . urlencode($country); |
|
844 | + $developerUrl .= '&'.self::REQ_PARAM_LOCALE.'='.urlencode($locale). |
|
845 | + '&'.self::REQ_PARAM_COUNTRY.'='.urlencode($country); |
|
848 | 846 | } catch (GuzzleException $e) { |
849 | 847 | throw new GooglePlayException($e->getMessage(), $e->getCode(), $e); |
850 | 848 | } |
851 | 849 | } else { |
852 | - $developerUrl = self::GOOGLE_PLAY_APPS_URL . '/developer?' . http_build_query($query); |
|
850 | + $developerUrl = self::GOOGLE_PLAY_APPS_URL.'/developer?'.http_build_query($query); |
|
853 | 851 | } |
854 | 852 | |
855 | 853 | return $this->getAppsFromClusterPage( |
@@ -903,7 +901,7 @@ discard block |
||
903 | 901 | public function __invoke(RequestInterface $request, ResponseInterface $response) |
904 | 902 | { |
905 | 903 | $json = \GuzzleHttp\json_decode($response->getBody()->getContents(), true); |
906 | - return array_map(static function (array $v) { |
|
904 | + return array_map(static function(array $v) { |
|
907 | 905 | return $v['s']; |
908 | 906 | }, $json); |
909 | 907 | } |
@@ -953,7 +951,7 @@ discard block |
||
953 | 951 | 'gl' => $country, |
954 | 952 | 'price' => $price->value(), |
955 | 953 | ]; |
956 | - $clusterPageUrl = self::GOOGLE_PLAY_URL . '/store/search?' . http_build_query($params); |
|
954 | + $clusterPageUrl = self::GOOGLE_PLAY_URL.'/store/search?'.http_build_query($params); |
|
957 | 955 | |
958 | 956 | return $this->getAppsFromClusterPage($clusterPageUrl, $locale, $country, $limit); |
959 | 957 | } |
@@ -995,11 +993,11 @@ discard block |
||
995 | 993 | $locale = LocaleHelper::getNormalizeLocale($locale ?? $this->defaultLocale); |
996 | 994 | $country = $country ?? $this->defaultCountry; |
997 | 995 | |
998 | - $url = self::GOOGLE_PLAY_APPS_URL . ''; |
|
996 | + $url = self::GOOGLE_PLAY_APPS_URL.''; |
|
999 | 997 | if ($category !== null) { |
1000 | - $url .= '/category/' . $category->value(); |
|
998 | + $url .= '/category/'.$category->value(); |
|
1001 | 999 | } |
1002 | - $url .= '/collection/' . $collection->value(); |
|
1000 | + $url .= '/collection/'.$collection->value(); |
|
1003 | 1001 | |
1004 | 1002 | $offset = 0; |
1005 | 1003 | |
@@ -1068,14 +1066,14 @@ discard block |
||
1068 | 1066 | $mapping = []; |
1069 | 1067 | foreach ($images as $image) { |
1070 | 1068 | if (!$image instanceof GoogleImage) { |
1071 | - throw new \InvalidArgumentException('An array of ' . GoogleImage::class . ' objects is expected.'); |
|
1069 | + throw new \InvalidArgumentException('An array of '.GoogleImage::class.' objects is expected.'); |
|
1072 | 1070 | } |
1073 | 1071 | $destPath = $destPathFn($image); |
1074 | 1072 | $mapping[$destPath] = $image->getUrl(); |
1075 | 1073 | } |
1076 | 1074 | |
1077 | 1075 | $httpClient = $this->getHttpClient(); |
1078 | - $promises = (static function () use ($mapping, $overwrite, $httpClient) { |
|
1076 | + $promises = (static function() use ($mapping, $overwrite, $httpClient) { |
|
1079 | 1077 | foreach ($mapping as $destPath => $url) { |
1080 | 1078 | if (!$overwrite && is_file($destPath)) { |
1081 | 1079 | yield $destPath => new FulfilledPromise($url); |
@@ -1090,7 +1088,7 @@ discard block |
||
1090 | 1088 | RequestOptions::SINK => $destPath, |
1091 | 1089 | RequestOptions::HTTP_ERRORS => true, |
1092 | 1090 | ]) |
1093 | - ->then(static function ( |
|
1091 | + ->then(static function( |
|
1094 | 1092 | /** @noinspection PhpUnusedParameterInspection */ |
1095 | 1093 | ResponseInterface $response |
1096 | 1094 | ) use ($url) { |
@@ -1106,10 +1104,10 @@ discard block |
||
1106 | 1104 | $imageInfoList = []; |
1107 | 1105 | (new EachPromise($promises, [ |
1108 | 1106 | 'concurrency' => $this->concurrency, |
1109 | - 'fulfilled' => static function (string $url, string $destPath) use (&$imageInfoList) { |
|
1107 | + 'fulfilled' => static function(string $url, string $destPath) use (&$imageInfoList) { |
|
1110 | 1108 | $imageInfoList[] = new ImageInfo($url, $destPath); |
1111 | 1109 | }, |
1112 | - 'rejected' => static function (\Throwable $reason, string $key) use ($mapping) { |
|
1110 | + 'rejected' => static function(\Throwable $reason, string $key) use ($mapping) { |
|
1113 | 1111 | $exceptionUrl = $mapping[$key]; |
1114 | 1112 | foreach ($mapping as $destPath => $url) { |
1115 | 1113 | if (is_file($destPath)) { |
@@ -724,7 +724,7 @@ discard block |
||
724 | 724 | /** |
725 | 725 | * Returns information about the developer for the locale array. |
726 | 726 | * |
727 | - * @param string|int|Developer|App|AppDetail $developerId developer identifier or object containing it |
|
727 | + * @param integer $developerId developer identifier or object containing it |
|
728 | 728 | * @param string[] $locales array of locales |
729 | 729 | * @return Developer[] list of developer by locale |
730 | 730 | * @throws GooglePlayException caused by HTTP error |
@@ -768,7 +768,7 @@ discard block |
||
768 | 768 | /** |
769 | 769 | * Returns information about the developer for all available locales. |
770 | 770 | * |
771 | - * @param string|int|Developer|App|AppDetail $developerId developer identifier or object containing it |
|
771 | + * @param integer $developerId developer identifier or object containing it |
|
772 | 772 | * @return Developer[] list of developer by locale |
773 | 773 | * @throws GooglePlayException caused by HTTP error |
774 | 774 | * @see GPlayApps::setConcurrency() To set the limit of parallel requests |
@@ -36,7 +36,7 @@ |
||
36 | 36 | } |
37 | 37 | |
38 | 38 | if (isset($scriptDataApps[0][1][0][0][3][4][2])) { |
39 | - return GPlayApps::GOOGLE_PLAY_URL . $scriptDataApps[0][1][0][0][3][4][2]; |
|
39 | + return GPlayApps::GOOGLE_PLAY_URL.$scriptDataApps[0][1][0][0][3][4][2]; |
|
40 | 40 | } |
41 | 41 | return null; |
42 | 42 | } |