@@ -99,7 +99,7 @@ discard block |
||
| 99 | 99 | */ |
| 100 | 100 | public function getUrl(): string |
| 101 | 101 | { |
| 102 | - return GPlayApps::GOOGLE_PLAY_APPS_URL . '/details?' . http_build_query( |
|
| 102 | + return GPlayApps::GOOGLE_PLAY_APPS_URL.'/details?'.http_build_query( |
|
| 103 | 103 | [ |
| 104 | 104 | GPlayApps::REQ_PARAM_ID => $this->id, |
| 105 | 105 | ] |
@@ -115,7 +115,7 @@ discard block |
||
| 115 | 115 | */ |
| 116 | 116 | public function getFullUrl(): string |
| 117 | 117 | { |
| 118 | - return GPlayApps::GOOGLE_PLAY_APPS_URL . '/details?' . http_build_query( |
|
| 118 | + return GPlayApps::GOOGLE_PLAY_APPS_URL.'/details?'.http_build_query( |
|
| 119 | 119 | [ |
| 120 | 120 | GPlayApps::REQ_PARAM_ID => $this->id, |
| 121 | 121 | GPlayApps::REQ_PARAM_LOCALE => $this->locale, |
@@ -82,21 +82,21 @@ |
||
| 82 | 82 | |
| 83 | 83 | if (empty($this->id)) { |
| 84 | 84 | throw new \InvalidArgumentException( |
| 85 | - 'Developer id cannot be null or empty. ' . |
|
| 85 | + 'Developer id cannot be null or empty. '. |
|
| 86 | 86 | 'Solution: $developerBuilder->setId(...);' |
| 87 | 87 | ); |
| 88 | 88 | } |
| 89 | 89 | |
| 90 | 90 | if (empty($this->url)) { |
| 91 | 91 | throw new \InvalidArgumentException( |
| 92 | - 'Developer url cannot be null or empty. ' . |
|
| 92 | + 'Developer url cannot be null or empty. '. |
|
| 93 | 93 | 'Solution: $developerBuilder->setUrl(...);' |
| 94 | 94 | ); |
| 95 | 95 | } |
| 96 | 96 | |
| 97 | 97 | if (empty($this->name)) { |
| 98 | 98 | throw new \InvalidArgumentException( |
| 99 | - 'Developer name cannot be null or empty. ' . |
|
| 99 | + 'Developer name cannot be null or empty. '. |
|
| 100 | 100 | 'Solution: $developerBuilder->setName(...);' |
| 101 | 101 | ); |
| 102 | 102 | } |
@@ -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 |
@@ -1190,8 +1190,8 @@ discard block |
||
| 1190 | 1190 | if (isset($datePatternObj['months'])) { |
| 1191 | 1191 | if (!isset($datePatternObj['months'][$month])) { |
| 1192 | 1192 | throw new \RuntimeException( |
| 1193 | - 'Error convert date. Locale ' . $locale . '. Date: ' . $dateText . |
|
| 1194 | - '. Matches: ' . var_export($match, true) |
|
| 1193 | + 'Error convert date. Locale '.$locale.'. Date: '.$dateText. |
|
| 1194 | + '. Matches: '.var_export($match, true) |
|
| 1195 | 1195 | ); |
| 1196 | 1196 | } |
| 1197 | 1197 | $month = $datePatternObj['months'][$month]; |
@@ -1203,7 +1203,7 @@ discard block |
||
| 1203 | 1203 | |
| 1204 | 1204 | $dateTime = \DateTimeImmutable::createFromFormat( |
| 1205 | 1205 | 'Y.m.d H:i:s', |
| 1206 | - $year . '.' . $month . '.' . $day . ' 00:00:00', |
|
| 1206 | + $year.'.'.$month.'.'.$day.' 00:00:00', |
|
| 1207 | 1207 | new \DateTimeZone('UTC') |
| 1208 | 1208 | ); |
| 1209 | 1209 | |
@@ -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': |
@@ -38,7 +38,7 @@ discard block |
||
| 38 | 38 | public const GOOGLE_PLAY_URL = 'https://play.google.com'; |
| 39 | 39 | |
| 40 | 40 | /** @var string Google Play apps url. */ |
| 41 | - public const GOOGLE_PLAY_APPS_URL = self::GOOGLE_PLAY_URL . '/store/apps'; |
|
| 41 | + public const GOOGLE_PLAY_APPS_URL = self::GOOGLE_PLAY_URL.'/store/apps'; |
|
| 42 | 42 | |
| 43 | 43 | /** @var int Unlimit results. */ |
| 44 | 44 | public const UNLIMIT = -1; |
@@ -313,18 +313,18 @@ discard block |
||
| 313 | 313 | */ |
| 314 | 314 | $list = array_filter( |
| 315 | 315 | $list, |
| 316 | - static function (Model\AppInfo $app) { |
|
| 316 | + static function(Model\AppInfo $app) { |
|
| 317 | 317 | return !$app->isAutoTranslatedDescription(); |
| 318 | 318 | } |
| 319 | 319 | ); |
| 320 | 320 | |
| 321 | 321 | if (!isset($list[$preferredLocale])) { |
| 322 | - throw new \RuntimeException('No key ' . $preferredLocale); |
|
| 322 | + throw new \RuntimeException('No key '.$preferredLocale); |
|
| 323 | 323 | } |
| 324 | 324 | $preferredApp = $list[$preferredLocale]; |
| 325 | 325 | $list = array_filter( |
| 326 | 326 | $list, |
| 327 | - static function (Model\AppInfo $app, string $locale) use ($preferredApp, $list) { |
|
| 327 | + static function(Model\AppInfo $app, string $locale) use ($preferredApp, $list) { |
|
| 328 | 328 | // deletes locales in which there is no translation added, but automatic translation by Google Translate is used. |
| 329 | 329 | if ($preferredApp->getLocale() === $locale || !$preferredApp->equals($app)) { |
| 330 | 330 | if (($pos = strpos($locale, '_')) !== false) { |
@@ -353,7 +353,7 @@ discard block |
||
| 353 | 353 | // sorting array keys; the first key is the preferred locale |
| 354 | 354 | uksort( |
| 355 | 355 | $list, |
| 356 | - static function ( |
|
| 356 | + static function( |
|
| 357 | 357 | /** @noinspection PhpUnusedParameterInspection */ |
| 358 | 358 | string $a, |
| 359 | 359 | string $b |
@@ -463,14 +463,12 @@ discard block |
||
| 463 | 463 | $allReviews = []; |
| 464 | 464 | |
| 465 | 465 | $cacheTtl = $sort === Enum\SortEnum::NEWEST() ? |
| 466 | - \DateInterval::createFromDateString('1 min') : |
|
| 467 | - \DateInterval::createFromDateString('1 hour'); |
|
| 466 | + \DateInterval::createFromDateString('1 min') : \DateInterval::createFromDateString('1 hour'); |
|
| 468 | 467 | |
| 469 | 468 | try { |
| 470 | 469 | do { |
| 471 | 470 | $count = $limit === self::UNLIMIT ? |
| 472 | - Scraper\PlayStoreUiRequest::LIMIT_REVIEW_ON_PAGE : |
|
| 473 | - min(Scraper\PlayStoreUiRequest::LIMIT_REVIEW_ON_PAGE, max($limit - $allCount, 1)); |
|
| 471 | + Scraper\PlayStoreUiRequest::LIMIT_REVIEW_ON_PAGE : min(Scraper\PlayStoreUiRequest::LIMIT_REVIEW_ON_PAGE, max($limit - $allCount, 1)); |
|
| 474 | 472 | |
| 475 | 473 | $request = Scraper\PlayStoreUiRequest::getReviewsRequest($appId, $count, $sort, $token); |
| 476 | 474 | |
@@ -510,7 +508,7 @@ discard block |
||
| 510 | 508 | /** @var Model\Review $review */ |
| 511 | 509 | $review = $this->getHttpClient()->request( |
| 512 | 510 | 'GET', |
| 513 | - self::GOOGLE_PLAY_APPS_URL . '/details', |
|
| 511 | + self::GOOGLE_PLAY_APPS_URL.'/details', |
|
| 514 | 512 | [ |
| 515 | 513 | RequestOptions::QUERY => [ |
| 516 | 514 | self::REQ_PARAM_ID => $appId->getId(), |
@@ -619,7 +617,7 @@ discard block |
||
| 619 | 617 | $url = self::GOOGLE_PLAY_APPS_URL; |
| 620 | 618 | |
| 621 | 619 | foreach ($locales as $locale) { |
| 622 | - $urls[$locale] = $url . '?' . http_build_query( |
|
| 620 | + $urls[$locale] = $url.'?'.http_build_query( |
|
| 623 | 621 | [ |
| 624 | 622 | self::REQ_PARAM_LOCALE => $locale, |
| 625 | 623 | ] |
@@ -684,7 +682,7 @@ discard block |
||
| 684 | 682 | ); |
| 685 | 683 | } |
| 686 | 684 | |
| 687 | - $url = self::GOOGLE_PLAY_APPS_URL . '/dev'; |
|
| 685 | + $url = self::GOOGLE_PLAY_APPS_URL.'/dev'; |
|
| 688 | 686 | |
| 689 | 687 | try { |
| 690 | 688 | /** @var Model\Developer $developer */ |
@@ -744,10 +742,10 @@ discard block |
||
| 744 | 742 | } |
| 745 | 743 | |
| 746 | 744 | $urls = []; |
| 747 | - $url = self::GOOGLE_PLAY_APPS_URL . '/dev'; |
|
| 745 | + $url = self::GOOGLE_PLAY_APPS_URL.'/dev'; |
|
| 748 | 746 | |
| 749 | 747 | foreach ($locales as $locale) { |
| 750 | - $urls[$locale] = $url . '?' . http_build_query( |
|
| 748 | + $urls[$locale] = $url.'?'.http_build_query( |
|
| 751 | 749 | [ |
| 752 | 750 | self::REQ_PARAM_ID => $id, |
| 753 | 751 | self::REQ_PARAM_LOCALE => $locale, |
@@ -793,7 +791,7 @@ discard block |
||
| 793 | 791 | ]; |
| 794 | 792 | |
| 795 | 793 | if (is_numeric($developerId)) { |
| 796 | - $developerUrl = self::GOOGLE_PLAY_APPS_URL . '/dev?' . http_build_query($query); |
|
| 794 | + $developerUrl = self::GOOGLE_PLAY_APPS_URL.'/dev?'.http_build_query($query); |
|
| 797 | 795 | |
| 798 | 796 | try { |
| 799 | 797 | /** |
@@ -810,13 +808,13 @@ discard block |
||
| 810 | 808 | if ($developerUrl === null) { |
| 811 | 809 | return []; |
| 812 | 810 | } |
| 813 | - $developerUrl .= '&' . self::REQ_PARAM_LOCALE . '=' . urlencode($this->defaultLocale) . |
|
| 814 | - '&' . self::REQ_PARAM_COUNTRY . '=' . urlencode($this->defaultCountry); |
|
| 811 | + $developerUrl .= '&'.self::REQ_PARAM_LOCALE.'='.urlencode($this->defaultLocale). |
|
| 812 | + '&'.self::REQ_PARAM_COUNTRY.'='.urlencode($this->defaultCountry); |
|
| 815 | 813 | } catch (\Throwable $e) { |
| 816 | 814 | throw new Exception\GooglePlayException($e->getMessage(), 1, $e); |
| 817 | 815 | } |
| 818 | 816 | } else { |
| 819 | - $developerUrl = self::GOOGLE_PLAY_APPS_URL . '/developer?' . http_build_query($query); |
|
| 817 | + $developerUrl = self::GOOGLE_PLAY_APPS_URL.'/developer?'.http_build_query($query); |
|
| 820 | 818 | } |
| 821 | 819 | |
| 822 | 820 | return $this->fetchAppsFromClusterPage( |
@@ -857,10 +855,10 @@ discard block |
||
| 857 | 855 | $query[self::REQ_PARAM_LOCALE] = $locale; |
| 858 | 856 | $query[self::REQ_PARAM_COUNTRY] = $country; |
| 859 | 857 | |
| 860 | - $clusterPageUrl = $clusterPageComponents['scheme'] . '://' . |
|
| 861 | - $clusterPageComponents['host'] . |
|
| 862 | - $clusterPageComponents['path'] . |
|
| 863 | - '?' . build_query($query); |
|
| 858 | + $clusterPageUrl = $clusterPageComponents['scheme'].'://'. |
|
| 859 | + $clusterPageComponents['host']. |
|
| 860 | + $clusterPageComponents['path']. |
|
| 861 | + '?'.build_query($query); |
|
| 864 | 862 | |
| 865 | 863 | try { |
| 866 | 864 | [$apps, $token] = $this->getHttpClient()->request( |
@@ -876,8 +874,7 @@ discard block |
||
| 876 | 874 | |
| 877 | 875 | while ($token !== null && ($limit === self::UNLIMIT || $allCount < $limit)) { |
| 878 | 876 | $count = $limit === self::UNLIMIT ? |
| 879 | - Scraper\PlayStoreUiRequest::LIMIT_APPS_ON_PAGE : |
|
| 880 | - min(Scraper\PlayStoreUiRequest::LIMIT_APPS_ON_PAGE, max($limit - $allCount, 1)); |
|
| 877 | + Scraper\PlayStoreUiRequest::LIMIT_APPS_ON_PAGE : min(Scraper\PlayStoreUiRequest::LIMIT_APPS_ON_PAGE, max($limit - $allCount, 1)); |
|
| 881 | 878 | |
| 882 | 879 | $request = Scraper\PlayStoreUiRequest::getAppsRequest($locale, $country, $count, $token); |
| 883 | 880 | |
@@ -1031,7 +1028,7 @@ discard block |
||
| 1031 | 1028 | self::REQ_PARAM_COUNTRY => $this->defaultCountry, |
| 1032 | 1029 | 'price' => $price->value(), |
| 1033 | 1030 | ]; |
| 1034 | - $clusterPageUrl = self::GOOGLE_PLAY_URL . '/store/search?' . http_build_query($params); |
|
| 1031 | + $clusterPageUrl = self::GOOGLE_PLAY_URL.'/store/search?'.http_build_query($params); |
|
| 1035 | 1032 | |
| 1036 | 1033 | return $this->fetchAppsFromClusterPage( |
| 1037 | 1034 | $clusterPageUrl, |
@@ -1136,13 +1133,13 @@ discard block |
||
| 1136 | 1133 | $url = self::GOOGLE_PLAY_APPS_URL; |
| 1137 | 1134 | |
| 1138 | 1135 | if ($path !== null) { |
| 1139 | - $url .= '/' . $path; |
|
| 1136 | + $url .= '/'.$path; |
|
| 1140 | 1137 | } |
| 1141 | 1138 | |
| 1142 | 1139 | if ($category !== null) { |
| 1143 | - $url .= '/category/' . Util\Caster::castToCategoryId($category); |
|
| 1140 | + $url .= '/category/'.Util\Caster::castToCategoryId($category); |
|
| 1144 | 1141 | } |
| 1145 | - $url .= '?' . http_build_query($queryParams); |
|
| 1142 | + $url .= '?'.http_build_query($queryParams); |
|
| 1146 | 1143 | |
| 1147 | 1144 | /** |
| 1148 | 1145 | * @var array $categoryClusterPages = [[ |
@@ -1234,7 +1231,7 @@ discard block |
||
| 1234 | 1231 | foreach ($images as $image) { |
| 1235 | 1232 | if (!$image instanceof Model\GoogleImage) { |
| 1236 | 1233 | throw new \InvalidArgumentException( |
| 1237 | - 'An array of ' . Model\GoogleImage::class . ' objects is expected.' |
|
| 1234 | + 'An array of '.Model\GoogleImage::class.' objects is expected.' |
|
| 1238 | 1235 | ); |
| 1239 | 1236 | } |
| 1240 | 1237 | $destPath = $destPathCallback($image); |
@@ -1243,7 +1240,7 @@ discard block |
||
| 1243 | 1240 | } |
| 1244 | 1241 | |
| 1245 | 1242 | $httpClient = $this->getHttpClient(); |
| 1246 | - $promises = (static function () use ($mapping, $overwrite, $httpClient) { |
|
| 1243 | + $promises = (static function() use ($mapping, $overwrite, $httpClient) { |
|
| 1247 | 1244 | foreach ($mapping as $url => $stream) { |
| 1248 | 1245 | $destPath = $stream->getFilename(); |
| 1249 | 1246 | $dynamicPath = strpos($destPath, '{url}') !== false; |
@@ -1259,7 +1256,7 @@ discard block |
||
| 1259 | 1256 | RequestOptions::COOKIES => null, |
| 1260 | 1257 | RequestOptions::SINK => $stream, |
| 1261 | 1258 | RequestOptions::HTTP_ERRORS => true, |
| 1262 | - RequestOptions::ON_HEADERS => static function (ResponseInterface $response) use ( |
|
| 1259 | + RequestOptions::ON_HEADERS => static function(ResponseInterface $response) use ( |
|
| 1263 | 1260 | $url, |
| 1264 | 1261 | $stream |
| 1265 | 1262 | ): void { |
@@ -1268,7 +1265,7 @@ discard block |
||
| 1268 | 1265 | ] |
| 1269 | 1266 | ) |
| 1270 | 1267 | ->then( |
| 1271 | - static function ( |
|
| 1268 | + static function( |
|
| 1272 | 1269 | /** @noinspection PhpUnusedParameterInspection */ |
| 1273 | 1270 | ResponseInterface $response |
| 1274 | 1271 | ) use ($url) { |
@@ -1288,10 +1285,10 @@ discard block |
||
| 1288 | 1285 | $promises, |
| 1289 | 1286 | [ |
| 1290 | 1287 | 'concurrency' => $this->concurrency, |
| 1291 | - 'fulfilled' => static function (string $url) use (&$imageInfoList, $mapping): void { |
|
| 1288 | + 'fulfilled' => static function(string $url) use (&$imageInfoList, $mapping): void { |
|
| 1292 | 1289 | $imageInfoList[] = new Model\ImageInfo($url, $mapping[$url]->getFilename()); |
| 1293 | 1290 | }, |
| 1294 | - 'rejected' => static function (\Throwable $reason, string $exceptionUrl) use ($mapping): void { |
|
| 1291 | + 'rejected' => static function(\Throwable $reason, string $exceptionUrl) use ($mapping): void { |
|
| 1295 | 1292 | foreach ($mapping as $destPath => $url) { |
| 1296 | 1293 | if (is_file($destPath)) { |
| 1297 | 1294 | 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 | } |