@@ -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(), |
@@ -308,7 +308,7 @@ discard block |
||
308 | 308 | } |
309 | 309 | |
310 | 310 | $preferredApp = $list[$preferredLocale]; |
311 | - $list = array_filter($list, static function (AppDetail $app, string $locale) use ($preferredApp, $list) { |
|
311 | + $list = array_filter($list, static function(AppDetail $app, string $locale) use ($preferredApp, $list) { |
|
312 | 312 | // deletes locales in which there is no translation added, but automatic translation by Google Translate is used. |
313 | 313 | if ($preferredApp->getLocale() === $locale || !$preferredApp->equals($app)) { |
314 | 314 | if (($pos = strpos($locale, '_')) !== false) { |
@@ -332,7 +332,7 @@ discard block |
||
332 | 332 | // sorting array keys; the first key is the preferred locale |
333 | 333 | uksort( |
334 | 334 | $list, |
335 | - static function ( |
|
335 | + static function( |
|
336 | 336 | /** @noinspection PhpUnusedParameterInspection */ |
337 | 337 | string $a, |
338 | 338 | string $b |
@@ -354,10 +354,10 @@ discard block |
||
354 | 354 | public function existsApp($requestApp): bool |
355 | 355 | { |
356 | 356 | $requestApp = $this->castToRequestApp($requestApp); |
357 | - $url = self::GOOGLE_PLAY_APPS_URL . '/details'; |
|
357 | + $url = self::GOOGLE_PLAY_APPS_URL.'/details'; |
|
358 | 358 | |
359 | 359 | try { |
360 | - return (bool)$this->getHttpClient()->request('HEAD', $url, [ |
|
360 | + return (bool) $this->getHttpClient()->request('HEAD', $url, [ |
|
361 | 361 | RequestOptions::QUERY => [ |
362 | 362 | self::REQ_PARAM_APP_ID => $requestApp->getId(), |
363 | 363 | self::REQ_PARAM_LOCALE => $requestApp->getLocale(), |
@@ -426,7 +426,7 @@ discard block |
||
426 | 426 | $sort = $sort ?? SortEnum::NEWEST(); |
427 | 427 | $page = max(0, $page); |
428 | 428 | |
429 | - $url = self::GOOGLE_PLAY_URL . '/store/getreviews'; |
|
429 | + $url = self::GOOGLE_PLAY_URL.'/store/getreviews'; |
|
430 | 430 | $formParams = [ |
431 | 431 | self::REQ_PARAM_APP_ID => $requestApp->getId(), |
432 | 432 | self::REQ_PARAM_LOCALE => $requestApp->getLocale(), |
@@ -518,7 +518,7 @@ discard block |
||
518 | 518 | self::REQ_PARAM_LOCALE => $requestApp->getLocale(), |
519 | 519 | self::REQ_PARAM_COUNTRY => $requestApp->getCountry(), |
520 | 520 | ]; |
521 | - $url = self::GOOGLE_PLAY_APPS_URL . '/details?' . http_build_query($params); |
|
521 | + $url = self::GOOGLE_PLAY_APPS_URL.'/details?'.http_build_query($params); |
|
522 | 522 | $httpClient = $this->getHttpClient(); |
523 | 523 | try { |
524 | 524 | return $httpClient->request( |
@@ -550,7 +550,7 @@ discard block |
||
550 | 550 | { |
551 | 551 | $requestApp = $this->castToRequestApp($requestApp); |
552 | 552 | |
553 | - $url = self::GOOGLE_PLAY_URL . '/store/xhr/getdoc?authuser=0'; |
|
553 | + $url = self::GOOGLE_PLAY_URL.'/store/xhr/getdoc?authuser=0'; |
|
554 | 554 | try { |
555 | 555 | return $this->getHttpClient()->request( |
556 | 556 | 'POST', |
@@ -616,7 +616,7 @@ discard block |
||
616 | 616 | $urls = []; |
617 | 617 | $url = self::GOOGLE_PLAY_APPS_URL; |
618 | 618 | foreach ($locales as $locale) { |
619 | - $urls[$locale] = $url . '?' . http_build_query([ |
|
619 | + $urls[$locale] = $url.'?'.http_build_query([ |
|
620 | 620 | self::REQ_PARAM_LOCALE => $locale, |
621 | 621 | ]); |
622 | 622 | } |
@@ -663,7 +663,7 @@ discard block |
||
663 | 663 | } |
664 | 664 | |
665 | 665 | $locale = LocaleHelper::getNormalizeLocale($locale ?? $this->defaultLocale); |
666 | - $url = self::GOOGLE_PLAY_APPS_URL . '/dev'; |
|
666 | + $url = self::GOOGLE_PLAY_APPS_URL.'/dev'; |
|
667 | 667 | try { |
668 | 668 | return $this->getHttpClient()->request( |
669 | 669 | 'GET', |
@@ -694,7 +694,7 @@ discard block |
||
694 | 694 | return $developerId->getId(); |
695 | 695 | } |
696 | 696 | if (is_int($developerId)) { |
697 | - return (string)$developerId; |
|
697 | + return (string) $developerId; |
|
698 | 698 | } |
699 | 699 | return $developerId; |
700 | 700 | } |
@@ -721,9 +721,9 @@ discard block |
||
721 | 721 | } |
722 | 722 | |
723 | 723 | $urls = []; |
724 | - $url = self::GOOGLE_PLAY_APPS_URL . '/dev'; |
|
724 | + $url = self::GOOGLE_PLAY_APPS_URL.'/dev'; |
|
725 | 725 | foreach ($locales as $locale) { |
726 | - $urls[$locale] = $url . '?' . http_build_query([ |
|
726 | + $urls[$locale] = $url.'?'.http_build_query([ |
|
727 | 727 | self::REQ_PARAM_APP_ID => $id, |
728 | 728 | self::REQ_PARAM_LOCALE => $locale, |
729 | 729 | ]); |
@@ -758,7 +758,7 @@ discard block |
||
758 | 758 | $preferredLocale = self::DEFAULT_LOCALE; |
759 | 759 | |
760 | 760 | $preferredInfo = $list[$preferredLocale]; |
761 | - $list = array_filter($list, static function (Developer $info, string $locale) use ($preferredInfo, $preferredLocale) { |
|
761 | + $list = array_filter($list, static function(Developer $info, string $locale) use ($preferredInfo, $preferredLocale) { |
|
762 | 762 | return $locale === $preferredLocale || $preferredInfo->equals($info); |
763 | 763 | }, ARRAY_FILTER_USE_BOTH); |
764 | 764 | |
@@ -809,7 +809,7 @@ discard block |
||
809 | 809 | |
810 | 810 | try { |
811 | 811 | if (is_numeric($developerId)) { |
812 | - $url = self::GOOGLE_PLAY_APPS_URL . '/dev'; |
|
812 | + $url = self::GOOGLE_PLAY_APPS_URL.'/dev'; |
|
813 | 813 | return $httpClient->request( |
814 | 814 | 'GET', |
815 | 815 | $url, |
@@ -825,7 +825,7 @@ discard block |
||
825 | 825 | ); |
826 | 826 | } |
827 | 827 | |
828 | - $url = self::GOOGLE_PLAY_APPS_URL . '/developer'; |
|
828 | + $url = self::GOOGLE_PLAY_APPS_URL.'/developer'; |
|
829 | 829 | return $httpClient->request( |
830 | 830 | 'GET', |
831 | 831 | $url, |
@@ -889,7 +889,7 @@ discard block |
||
889 | 889 | public function __invoke(RequestInterface $request, ResponseInterface $response) |
890 | 890 | { |
891 | 891 | $json = \GuzzleHttp\json_decode($response->getBody()->getContents(), true); |
892 | - return array_map(static function (array $v) { |
|
892 | + return array_map(static function(array $v) { |
|
893 | 893 | return $v['s']; |
894 | 894 | }, $json); |
895 | 895 | } |
@@ -943,7 +943,7 @@ discard block |
||
943 | 943 | 'gl' => $country, |
944 | 944 | 'price' => $price->value(), |
945 | 945 | ]; |
946 | - $url = self::GOOGLE_PLAY_URL . '/store/search?' . http_build_query($params); |
|
946 | + $url = self::GOOGLE_PLAY_URL.'/store/search?'.http_build_query($params); |
|
947 | 947 | |
948 | 948 | $httpClient = $this->getHttpClient(); |
949 | 949 | try { |
@@ -997,11 +997,11 @@ discard block |
||
997 | 997 | $locale = LocaleHelper::getNormalizeLocale($locale ?? $this->defaultLocale); |
998 | 998 | $country = $country ?? $this->defaultCountry; |
999 | 999 | |
1000 | - $url = self::GOOGLE_PLAY_APPS_URL . ''; |
|
1000 | + $url = self::GOOGLE_PLAY_APPS_URL.''; |
|
1001 | 1001 | if ($category !== null) { |
1002 | - $url .= '/category/' . $category->value(); |
|
1002 | + $url .= '/category/'.$category->value(); |
|
1003 | 1003 | } |
1004 | - $url .= '/collection/' . $collection->value(); |
|
1004 | + $url .= '/collection/'.$collection->value(); |
|
1005 | 1005 | |
1006 | 1006 | $offset = 0; |
1007 | 1007 | |
@@ -1071,14 +1071,14 @@ discard block |
||
1071 | 1071 | $mapping = []; |
1072 | 1072 | foreach ($images as $image) { |
1073 | 1073 | if (!$image instanceof GoogleImage) { |
1074 | - throw new \InvalidArgumentException('An array of ' . GoogleImage::class . ' objects is expected.'); |
|
1074 | + throw new \InvalidArgumentException('An array of '.GoogleImage::class.' objects is expected.'); |
|
1075 | 1075 | } |
1076 | 1076 | $destPath = $destPathFn($image); |
1077 | 1077 | $mapping[$destPath] = $image->getUrl(); |
1078 | 1078 | } |
1079 | 1079 | |
1080 | 1080 | $httpClient = $this->getHttpClient(); |
1081 | - $promises = (static function () use ($mapping, $overwrite, $httpClient) { |
|
1081 | + $promises = (static function() use ($mapping, $overwrite, $httpClient) { |
|
1082 | 1082 | foreach ($mapping as $destPath => $url) { |
1083 | 1083 | if (!$overwrite && is_file($destPath)) { |
1084 | 1084 | yield $destPath => new FulfilledPromise($url); |
@@ -1093,7 +1093,7 @@ discard block |
||
1093 | 1093 | RequestOptions::SINK => $destPath, |
1094 | 1094 | RequestOptions::HTTP_ERRORS => true, |
1095 | 1095 | ]) |
1096 | - ->then(static function ( |
|
1096 | + ->then(static function( |
|
1097 | 1097 | /** @noinspection PhpUnusedParameterInspection */ |
1098 | 1098 | ResponseInterface $response |
1099 | 1099 | ) use ($url) { |
@@ -1109,10 +1109,10 @@ discard block |
||
1109 | 1109 | $imageInfoList = []; |
1110 | 1110 | (new EachPromise($promises, [ |
1111 | 1111 | 'concurrency' => $this->concurrency, |
1112 | - 'fulfilled' => static function (string $url, string $destPath) use (&$imageInfoList) { |
|
1112 | + 'fulfilled' => static function(string $url, string $destPath) use (&$imageInfoList) { |
|
1113 | 1113 | $imageInfoList[] = new ImageInfo($url, $destPath); |
1114 | 1114 | }, |
1115 | - 'rejected' => static function (\Throwable $reason, string $key) use ($mapping) { |
|
1115 | + 'rejected' => static function(\Throwable $reason, string $key) use ($mapping) { |
|
1116 | 1116 | $exceptionUrl = $mapping[$key]; |
1117 | 1117 | foreach ($mapping as $destPath => $url) { |
1118 | 1118 | if (is_file($destPath)) { |