@@ -43,10 +43,10 @@ |
||
| 43 | 43 | foreach ($scriptDataInfo[0][1][0][0][0] as $data) { |
| 44 | 44 | $name = $data[2]; |
| 45 | 45 | $appId = $data[12][0]; |
| 46 | - $url = GPlayApps::GOOGLE_PLAY_URL . $data[9][4][2]; |
|
| 46 | + $url = GPlayApps::GOOGLE_PLAY_URL.$data[9][4][2]; |
|
| 47 | 47 | $icon = new GoogleImage($data[1][1][0][3][2]); |
| 48 | 48 | $developerName = $data[4][0][0][0]; |
| 49 | - $developerPage = GPlayApps::GOOGLE_PLAY_URL . $data[4][0][0][1][4][2]; |
|
| 49 | + $developerPage = GPlayApps::GOOGLE_PLAY_URL.$data[4][0][0][1][4][2]; |
|
| 50 | 50 | $developerId = parse_query(parse_url($developerPage, PHP_URL_QUERY))[GPlayApps::REQ_PARAM_APP_ID]; |
| 51 | 51 | $price = $data[7][0][3][2][1][0][2] ?? null; |
| 52 | 52 | $summary = $data[4][1][1][1][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 | } |
@@ -173,7 +173,7 @@ |
||
| 173 | 173 | public function setId(string $id): AppBuilder |
| 174 | 174 | { |
| 175 | 175 | $this->id = $id; |
| 176 | - $this->url = GPlayApps::GOOGLE_PLAY_APPS_URL . '/details?id=' . $id; |
|
| 176 | + $this->url = GPlayApps::GOOGLE_PLAY_APPS_URL.'/details?id='.$id; |
|
| 177 | 177 | return $this; |
| 178 | 178 | } |
| 179 | 179 | |
@@ -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']; |
@@ -1184,7 +1184,7 @@ |
||
| 1184 | 1184 | |
| 1185 | 1185 | $dateTime = \DateTimeImmutable::createFromFormat( |
| 1186 | 1186 | 'Y.m.d', |
| 1187 | - $year . '.' . $month . '.' . $day |
|
| 1187 | + $year.'.'.$month.'.'.$day |
|
| 1188 | 1188 | ); |
| 1189 | 1189 | if ($dateTime !== false) { |
| 1190 | 1190 | return $dateTime; |
@@ -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; |
@@ -57,7 +57,7 @@ discard block |
||
| 57 | 57 | public const DEFAULT_COUNTRY = 'us'; // Affected price |
| 58 | 58 | |
| 59 | 59 | public const GOOGLE_PLAY_URL = 'https://play.google.com'; |
| 60 | - public const GOOGLE_PLAY_APPS_URL = self::GOOGLE_PLAY_URL . '/store/apps'; |
|
| 60 | + public const GOOGLE_PLAY_APPS_URL = self::GOOGLE_PLAY_URL.'/store/apps'; |
|
| 61 | 61 | public const MAX_SEARCH_RESULTS = 250; |
| 62 | 62 | |
| 63 | 63 | public const REQ_PARAM_LOCALE = 'hl'; |
@@ -235,7 +235,7 @@ discard block |
||
| 235 | 235 | $urls = []; |
| 236 | 236 | foreach ($requestApps as $key => $requestApp) { |
| 237 | 237 | $requestApp = $this->castToRequestApp($requestApp); |
| 238 | - $urls[$key] = self::GOOGLE_PLAY_APPS_URL . '/details?' . http_build_query([ |
|
| 238 | + $urls[$key] = self::GOOGLE_PLAY_APPS_URL.'/details?'.http_build_query([ |
|
| 239 | 239 | self::REQ_PARAM_APP_ID => $requestApp->getId(), |
| 240 | 240 | self::REQ_PARAM_LOCALE => $requestApp->getLocale(), |
| 241 | 241 | self::REQ_PARAM_COUNTRY => $requestApp->getCountry(), |
@@ -322,7 +322,7 @@ discard block |
||
| 322 | 322 | // sorting array keys; the first key is the preferred locale |
| 323 | 323 | uksort( |
| 324 | 324 | $list, |
| 325 | - static function ( |
|
| 325 | + static function( |
|
| 326 | 326 | /** @noinspection PhpUnusedParameterInspection */ |
| 327 | 327 | string $a, |
| 328 | 328 | string $b |
@@ -344,10 +344,10 @@ discard block |
||
| 344 | 344 | public function existsApp($requestApp): bool |
| 345 | 345 | { |
| 346 | 346 | $requestApp = $this->castToRequestApp($requestApp); |
| 347 | - $url = self::GOOGLE_PLAY_APPS_URL . '/details'; |
|
| 347 | + $url = self::GOOGLE_PLAY_APPS_URL.'/details'; |
|
| 348 | 348 | |
| 349 | 349 | try { |
| 350 | - return (bool)$this->getHttpClient()->request('HEAD', $url, [ |
|
| 350 | + return (bool) $this->getHttpClient()->request('HEAD', $url, [ |
|
| 351 | 351 | RequestOptions::QUERY => [ |
| 352 | 352 | self::REQ_PARAM_APP_ID => $requestApp->getId(), |
| 353 | 353 | self::REQ_PARAM_LOCALE => $requestApp->getLocale(), |
@@ -416,7 +416,7 @@ discard block |
||
| 416 | 416 | $sort = $sort ?? SortEnum::NEWEST(); |
| 417 | 417 | $page = max(0, $page); |
| 418 | 418 | |
| 419 | - $url = self::GOOGLE_PLAY_URL . '/store/getreviews'; |
|
| 419 | + $url = self::GOOGLE_PLAY_URL.'/store/getreviews'; |
|
| 420 | 420 | $formParams = [ |
| 421 | 421 | self::REQ_PARAM_APP_ID => $requestApp->getId(), |
| 422 | 422 | self::REQ_PARAM_LOCALE => $requestApp->getLocale(), |
@@ -507,7 +507,7 @@ discard block |
||
| 507 | 507 | self::REQ_PARAM_LOCALE => $requestApp->getLocale(), |
| 508 | 508 | self::REQ_PARAM_COUNTRY => $requestApp->getCountry(), |
| 509 | 509 | ]; |
| 510 | - $url = self::GOOGLE_PLAY_APPS_URL . '/details?' . http_build_query($params); |
|
| 510 | + $url = self::GOOGLE_PLAY_APPS_URL.'/details?'.http_build_query($params); |
|
| 511 | 511 | $httpClient = $this->getHttpClient(); |
| 512 | 512 | try { |
| 513 | 513 | return $httpClient->request( |
@@ -539,7 +539,7 @@ discard block |
||
| 539 | 539 | { |
| 540 | 540 | $requestApp = $this->castToRequestApp($requestApp); |
| 541 | 541 | |
| 542 | - $url = self::GOOGLE_PLAY_URL . '/store/xhr/getdoc?authuser=0'; |
|
| 542 | + $url = self::GOOGLE_PLAY_URL.'/store/xhr/getdoc?authuser=0'; |
|
| 543 | 543 | try { |
| 544 | 544 | return $this->getHttpClient()->request( |
| 545 | 545 | 'POST', |
@@ -605,7 +605,7 @@ discard block |
||
| 605 | 605 | $urls = []; |
| 606 | 606 | $url = self::GOOGLE_PLAY_APPS_URL; |
| 607 | 607 | foreach ($locales as $locale) { |
| 608 | - $urls[$locale] = $url . '?' . http_build_query([ |
|
| 608 | + $urls[$locale] = $url.'?'.http_build_query([ |
|
| 609 | 609 | self::REQ_PARAM_LOCALE => $locale, |
| 610 | 610 | ]); |
| 611 | 611 | } |
@@ -652,7 +652,7 @@ discard block |
||
| 652 | 652 | } |
| 653 | 653 | |
| 654 | 654 | $locale = LocaleHelper::getNormalizeLocale($locale ?? $this->defaultLocale); |
| 655 | - $url = self::GOOGLE_PLAY_APPS_URL . '/dev'; |
|
| 655 | + $url = self::GOOGLE_PLAY_APPS_URL.'/dev'; |
|
| 656 | 656 | try { |
| 657 | 657 | return $this->getHttpClient()->request( |
| 658 | 658 | 'GET', |
@@ -680,7 +680,7 @@ discard block |
||
| 680 | 680 | return $developerId; |
| 681 | 681 | } |
| 682 | 682 | if (is_int($developerId)) { |
| 683 | - return (string)$developerId; |
|
| 683 | + return (string) $developerId; |
|
| 684 | 684 | } |
| 685 | 685 | if ($developerId instanceof App) { |
| 686 | 686 | return $developerId->getDeveloper()->getId(); |
@@ -713,9 +713,9 @@ discard block |
||
| 713 | 713 | } |
| 714 | 714 | |
| 715 | 715 | $urls = []; |
| 716 | - $url = self::GOOGLE_PLAY_APPS_URL . '/dev'; |
|
| 716 | + $url = self::GOOGLE_PLAY_APPS_URL.'/dev'; |
|
| 717 | 717 | foreach ($locales as $locale) { |
| 718 | - $urls[$locale] = $url . '?' . http_build_query([ |
|
| 718 | + $urls[$locale] = $url.'?'.http_build_query([ |
|
| 719 | 719 | self::REQ_PARAM_APP_ID => $id, |
| 720 | 720 | self::REQ_PARAM_LOCALE => $locale, |
| 721 | 721 | ]); |
@@ -750,7 +750,7 @@ discard block |
||
| 750 | 750 | $preferredLocale = self::DEFAULT_LOCALE; |
| 751 | 751 | |
| 752 | 752 | $preferredInfo = $list[$preferredLocale]; |
| 753 | - $list = array_filter($list, static function (Developer $info, string $locale) use ($preferredInfo, $preferredLocale) { |
|
| 753 | + $list = array_filter($list, static function(Developer $info, string $locale) use ($preferredInfo, $preferredLocale) { |
|
| 754 | 754 | return $locale === $preferredLocale || $preferredInfo->equals($info); |
| 755 | 755 | }, ARRAY_FILTER_USE_BOTH); |
| 756 | 756 | |
@@ -800,7 +800,7 @@ discard block |
||
| 800 | 800 | |
| 801 | 801 | try { |
| 802 | 802 | if (is_numeric($developerId)) { |
| 803 | - $url = self::GOOGLE_PLAY_APPS_URL . '/dev'; |
|
| 803 | + $url = self::GOOGLE_PLAY_APPS_URL.'/dev'; |
|
| 804 | 804 | return $httpClient->request( |
| 805 | 805 | 'GET', |
| 806 | 806 | $url, |
@@ -816,7 +816,7 @@ discard block |
||
| 816 | 816 | ); |
| 817 | 817 | } |
| 818 | 818 | |
| 819 | - $url = self::GOOGLE_PLAY_APPS_URL . '/developer'; |
|
| 819 | + $url = self::GOOGLE_PLAY_APPS_URL.'/developer'; |
|
| 820 | 820 | return $httpClient->request( |
| 821 | 821 | 'GET', |
| 822 | 822 | $url, |
@@ -878,7 +878,7 @@ discard block |
||
| 878 | 878 | public function __invoke(RequestInterface $request, ResponseInterface $response) |
| 879 | 879 | { |
| 880 | 880 | $json = \GuzzleHttp\json_decode($response->getBody()->getContents(), true); |
| 881 | - return array_map(static function (array $v) { |
|
| 881 | + return array_map(static function(array $v) { |
|
| 882 | 882 | return $v['s']; |
| 883 | 883 | }, $json); |
| 884 | 884 | } |
@@ -931,7 +931,7 @@ discard block |
||
| 931 | 931 | 'gl' => $country, |
| 932 | 932 | 'price' => $price->value(), |
| 933 | 933 | ]; |
| 934 | - $url = self::GOOGLE_PLAY_URL . '/store/search?' . http_build_query($params); |
|
| 934 | + $url = self::GOOGLE_PLAY_URL.'/store/search?'.http_build_query($params); |
|
| 935 | 935 | |
| 936 | 936 | $httpClient = $this->getHttpClient(); |
| 937 | 937 | try { |
@@ -984,11 +984,11 @@ discard block |
||
| 984 | 984 | $locale = LocaleHelper::getNormalizeLocale($locale ?? $this->defaultLocale); |
| 985 | 985 | $country = $country ?? $this->defaultCountry; |
| 986 | 986 | |
| 987 | - $url = self::GOOGLE_PLAY_APPS_URL . ''; |
|
| 987 | + $url = self::GOOGLE_PLAY_APPS_URL.''; |
|
| 988 | 988 | if ($category !== null) { |
| 989 | - $url .= '/category/' . $category->value(); |
|
| 989 | + $url .= '/category/'.$category->value(); |
|
| 990 | 990 | } |
| 991 | - $url .= '/collection/' . $collection->value(); |
|
| 991 | + $url .= '/collection/'.$collection->value(); |
|
| 992 | 992 | |
| 993 | 993 | $offset = 0; |
| 994 | 994 | |
@@ -1057,14 +1057,14 @@ discard block |
||
| 1057 | 1057 | $mapping = []; |
| 1058 | 1058 | foreach ($images as $image) { |
| 1059 | 1059 | if (!$image instanceof GoogleImage) { |
| 1060 | - throw new \InvalidArgumentException('An array of ' . GoogleImage::class . ' objects is expected.'); |
|
| 1060 | + throw new \InvalidArgumentException('An array of '.GoogleImage::class.' objects is expected.'); |
|
| 1061 | 1061 | } |
| 1062 | 1062 | $destPath = $destPathFn($image); |
| 1063 | 1063 | $mapping[$destPath] = $image->getUrl(); |
| 1064 | 1064 | } |
| 1065 | 1065 | |
| 1066 | 1066 | $httpClient = $this->getHttpClient(); |
| 1067 | - $promises = (static function () use ($mapping, $overwrite, $httpClient) { |
|
| 1067 | + $promises = (static function() use ($mapping, $overwrite, $httpClient) { |
|
| 1068 | 1068 | foreach ($mapping as $destPath => $url) { |
| 1069 | 1069 | if (!$overwrite && is_file($destPath)) { |
| 1070 | 1070 | yield $destPath => new FulfilledPromise($url); |
@@ -1079,7 +1079,7 @@ discard block |
||
| 1079 | 1079 | RequestOptions::SINK => $destPath, |
| 1080 | 1080 | RequestOptions::HTTP_ERRORS => true, |
| 1081 | 1081 | ]) |
| 1082 | - ->then(static function ( |
|
| 1082 | + ->then(static function( |
|
| 1083 | 1083 | /** @noinspection PhpUnusedParameterInspection */ |
| 1084 | 1084 | ResponseInterface $response |
| 1085 | 1085 | ) use ($url) { |
@@ -1095,10 +1095,10 @@ discard block |
||
| 1095 | 1095 | $imageInfoList = []; |
| 1096 | 1096 | (new EachPromise($promises, [ |
| 1097 | 1097 | 'concurrency' => $this->concurrency, |
| 1098 | - 'fulfilled' => static function (string $url, string $destPath) use (&$imageInfoList) { |
|
| 1098 | + 'fulfilled' => static function(string $url, string $destPath) use (&$imageInfoList) { |
|
| 1099 | 1099 | $imageInfoList[] = new ImageInfo($url, $destPath); |
| 1100 | 1100 | }, |
| 1101 | - 'rejected' => static function (\Throwable $reason, string $key) use ($mapping) { |
|
| 1101 | + 'rejected' => static function(\Throwable $reason, string $key) use ($mapping) { |
|
| 1102 | 1102 | $exceptionUrl = $mapping[$key]; |
| 1103 | 1103 | foreach ($mapping as $destPath => $url) { |
| 1104 | 1104 | if (is_file($destPath)) { |