@@ -51,7 +51,7 @@ |
||
| 51 | 51 | } |
| 52 | 52 | |
| 53 | 53 | if (isset($scriptDataApps[0][1][0][0][3][4][2])) { |
| 54 | - return GPlayApps::GOOGLE_PLAY_URL . $scriptDataApps[0][1][0][0][3][4][2]; |
|
| 54 | + return GPlayApps::GOOGLE_PLAY_URL.$scriptDataApps[0][1][0][0][3][4][2]; |
|
| 55 | 55 | } |
| 56 | 56 | |
| 57 | 57 | return null; |
@@ -34,7 +34,7 @@ discard block |
||
| 34 | 34 | $json = \GuzzleHttp\json_decode($contents, true); |
| 35 | 35 | $data = \GuzzleHttp\json_decode($json[0][2], true); |
| 36 | 36 | |
| 37 | - $permissionMapFn = static function (array $v): string { |
|
| 37 | + $permissionMapFn = static function(array $v): string { |
|
| 38 | 38 | return (string) $v[1]; |
| 39 | 39 | }; |
| 40 | 40 | |
@@ -65,7 +65,7 @@ discard block |
||
| 65 | 65 | } |
| 66 | 66 | |
| 67 | 67 | return array_map( |
| 68 | - static function (array $data) { |
|
| 68 | + static function(array $data) { |
|
| 69 | 69 | return new Permission($data['name'], $data['icon'], $data['permissions']); |
| 70 | 70 | }, |
| 71 | 71 | $permissions |
@@ -48,7 +48,7 @@ |
||
| 48 | 48 | public static function extractReview(AppId $requestApp, $reviewData): Review |
| 49 | 49 | { |
| 50 | 50 | $reviewId = $reviewData[0]; |
| 51 | - $reviewUrl = $requestApp->getUrl() . '&reviewId=' . urlencode($reviewId); |
|
| 51 | + $reviewUrl = $requestApp->getUrl().'&reviewId='.urlencode($reviewId); |
|
| 52 | 52 | $userName = $reviewData[1][0]; |
| 53 | 53 | $avatar = (new GoogleImage($reviewData[1][1][3][2]))->setSize(64); |
| 54 | 54 | $date = DateStringFormatter::unixTimeToDateTime($reviewData[5][0]); |
@@ -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, |
@@ -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 |
@@ -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 | } |
@@ -186,7 +186,7 @@ discard block |
||
| 186 | 186 | } |
| 187 | 187 | $parts = \array_slice($parts, 0, 4); |
| 188 | 188 | $path = implode('/', $parts); |
| 189 | - $url = $httpComponents['scheme'] . '://' . $httpComponents['host'] . '/' . $path . '/'; |
|
| 189 | + $url = $httpComponents['scheme'].'://'.$httpComponents['host'].'/'.$path.'/'; |
|
| 190 | 190 | $this->variantOfUrlWithFileName = true; |
| 191 | 191 | } elseif (($pos = strpos($url, '=')) !== false) { |
| 192 | 192 | $paramString = substr($url, $pos + 1); |
@@ -290,14 +290,14 @@ discard block |
||
| 290 | 290 | $params = []; |
| 291 | 291 | |
| 292 | 292 | if ($this->size !== null) { |
| 293 | - $params[] = self::PARAM_SIZE . $this->size; |
|
| 293 | + $params[] = self::PARAM_SIZE.$this->size; |
|
| 294 | 294 | } else { |
| 295 | 295 | if ($this->width !== null) { |
| 296 | - $params[] = self::PARAM_WIDTH . $this->width; |
|
| 296 | + $params[] = self::PARAM_WIDTH.$this->width; |
|
| 297 | 297 | } |
| 298 | 298 | |
| 299 | 299 | if ($this->height !== null) { |
| 300 | - $params[] = self::PARAM_HEIGHT . $this->height; |
|
| 300 | + $params[] = self::PARAM_HEIGHT.$this->height; |
|
| 301 | 301 | } |
| 302 | 302 | } |
| 303 | 303 | |
@@ -312,11 +312,11 @@ discard block |
||
| 312 | 312 | return $this->baseUrl; |
| 313 | 313 | } |
| 314 | 314 | |
| 315 | - return $this->baseUrl . implode('-', $params) . '/'; |
|
| 315 | + return $this->baseUrl.implode('-', $params).'/'; |
|
| 316 | 316 | } |
| 317 | 317 | |
| 318 | 318 | if ($this->border !== null) { |
| 319 | - $params[] = self::PARAM_BORDER . $this->border; |
|
| 319 | + $params[] = self::PARAM_BORDER.$this->border; |
|
| 320 | 320 | } |
| 321 | 321 | |
| 322 | 322 | if ($this->verticalFlip) { |
@@ -331,7 +331,7 @@ discard block |
||
| 331 | 331 | return $this->baseUrl; |
| 332 | 332 | } |
| 333 | 333 | |
| 334 | - return $this->baseUrl . '=' . implode('-', $params); |
|
| 334 | + return $this->baseUrl.'='.implode('-', $params); |
|
| 335 | 335 | } |
| 336 | 336 | |
| 337 | 337 | /** |
@@ -353,13 +353,13 @@ discard block |
||
| 353 | 353 | */ |
| 354 | 354 | public function getOriginalSizeUrl(): string |
| 355 | 355 | { |
| 356 | - $params = [self::PARAM_SIZE . '0']; |
|
| 356 | + $params = [self::PARAM_SIZE.'0']; |
|
| 357 | 357 | |
| 358 | 358 | if ($this->variantOfUrlWithFileName) { |
| 359 | - return $this->baseUrl . implode('-', $params) . '/'; |
|
| 359 | + return $this->baseUrl.implode('-', $params).'/'; |
|
| 360 | 360 | } |
| 361 | 361 | |
| 362 | - return $this->baseUrl . '=' . implode('-', $params); |
|
| 362 | + return $this->baseUrl.'='.implode('-', $params); |
|
| 363 | 363 | } |
| 364 | 364 | |
| 365 | 365 | /** |
@@ -384,7 +384,7 @@ discard block |
||
| 384 | 384 | for ($i = 0; $i < $parts; ++$i) { |
| 385 | 385 | $partsBuild[] = substr($hash, $i * $partLength, $partLength); |
| 386 | 386 | } |
| 387 | - $hash = implode('/', $partsBuild) . '/' . $hash; |
|
| 387 | + $hash = implode('/', $partsBuild).'/'.$hash; |
|
| 388 | 388 | } |
| 389 | 389 | |
| 390 | 390 | return $hash; |
@@ -649,7 +649,7 @@ discard block |
||
| 649 | 649 | RequestOptions::COOKIES => null, |
| 650 | 650 | RequestOptions::HTTP_ERRORS => true, |
| 651 | 651 | RequestOptions::SINK => $stream, |
| 652 | - RequestOptions::ON_HEADERS => static function (ResponseInterface $response) use ( |
|
| 652 | + RequestOptions::ON_HEADERS => static function(ResponseInterface $response) use ( |
|
| 653 | 653 | $url, |
| 654 | 654 | $stream |
| 655 | 655 | ): void { |
@@ -688,7 +688,7 @@ discard block |
||
| 688 | 688 | $contentType = $response->getHeaderLine('Content-Type'); |
| 689 | 689 | |
| 690 | 690 | if (!preg_match('~\bimage/.*\b~i', $contentType, $match)) { |
| 691 | - throw new GooglePlayException('Url ' . $url . ' is not image'); |
|
| 691 | + throw new GooglePlayException('Url '.$url.' is not image'); |
|
| 692 | 692 | } |
| 693 | 693 | $contentType = $match[0]; |
| 694 | 694 | $imageType = self::getImageExtension($contentType); |
@@ -21,9 +21,9 @@ |
||
| 21 | 21 | public function log($level, $message, array $context = []): void |
| 22 | 22 | { |
| 23 | 23 | $stream = LogLevel::DEBUG === $level || LogLevel::INFO === $level ? \STDOUT : \STDERR; |
| 24 | - fwrite($stream, '[' . strtoupper($level) . '] ' . $message . \PHP_EOL); |
|
| 24 | + fwrite($stream, '['.strtoupper($level).'] '.$message.\PHP_EOL); |
|
| 25 | 25 | if (!empty($context)) { |
| 26 | - fwrite($stream, var_export($context, true) . \PHP_EOL); |
|
| 26 | + fwrite($stream, var_export($context, true).\PHP_EOL); |
|
| 27 | 27 | } |
| 28 | 28 | } |
| 29 | 29 | } |