@@ -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]); |
@@ -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; |
@@ -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 | } |
@@ -1184,7 +1184,7 @@ discard block |
||
1184 | 1184 | |
1185 | 1185 | $dateTime = \DateTimeImmutable::createFromFormat( |
1186 | 1186 | 'Y.m.d', |
1187 | - $year . '.' . $month . '.' . $day, |
|
1187 | + $year.'.'.$month.'.'.$day, |
|
1188 | 1188 | new \DateTimeZone('UTC') |
1189 | 1189 | ); |
1190 | 1190 | if ($dateTime !== false) { |
@@ -1202,7 +1202,7 @@ discard block |
||
1202 | 1202 | { |
1203 | 1203 | $dateTime = \DateTimeImmutable::createFromFormat( |
1204 | 1204 | 'U', |
1205 | - (string)$unixTime, |
|
1205 | + (string) $unixTime, |
|
1206 | 1206 | new \DateTimeZone('UTC') |
1207 | 1207 | ); |
1208 | 1208 | return $dateTime === false ? null : $dateTime; |
@@ -36,9 +36,9 @@ discard block |
||
36 | 36 | 'soc-platform' => 1, |
37 | 37 | 'soc-device' => 1, |
38 | 38 | ]; |
39 | - $url = GPlayApps::GOOGLE_PLAY_URL . '/_/PlayStoreUi/data/batchexecute?' . http_build_query($queryParams); |
|
39 | + $url = GPlayApps::GOOGLE_PLAY_URL.'/_/PlayStoreUi/data/batchexecute?'.http_build_query($queryParams); |
|
40 | 40 | $formParams = [ |
41 | - 'f.req' => '[[["' . self::RPC_ID_REVIEWS . '","[null,null,[2,' . $sort->value() . ',[' . $limit . ',null,' . ($token === null ? 'null' : '\\"' . $token . '\\"') . ']],[\\"' . $requestApp->getId() . '\\",7]]",null,"generic"]]]', |
|
41 | + 'f.req' => '[[["'.self::RPC_ID_REVIEWS.'","[null,null,[2,'.$sort->value().',['.$limit.',null,'.($token === null ? 'null' : '\\"'.$token.'\\"').']],[\\"'.$requestApp->getId().'\\",7]]",null,"generic"]]]', |
|
42 | 42 | ]; |
43 | 43 | $headers = [ |
44 | 44 | 'Content-Type' => 'application/x-www-form-urlencoded;charset=utf-8', |
@@ -65,9 +65,9 @@ discard block |
||
65 | 65 | 'soc-platform' => 1, |
66 | 66 | 'soc-device' => 1, |
67 | 67 | ]; |
68 | - $url = GPlayApps::GOOGLE_PLAY_URL . '/_/PlayStoreUi/data/batchexecute?' . http_build_query($queryParams); |
|
68 | + $url = GPlayApps::GOOGLE_PLAY_URL.'/_/PlayStoreUi/data/batchexecute?'.http_build_query($queryParams); |
|
69 | 69 | $formParams = [ |
70 | - 'f.req' => '[[["' . self::RPC_ID_APPS . '","[[null,[[10,[10,' . $limit . ']],true,null,[1]],null,\\"' . $token . '\\"]]",null,"generic"]]]', |
|
70 | + 'f.req' => '[[["'.self::RPC_ID_APPS.'","[[null,[[10,[10,'.$limit.']],true,null,[1]],null,\\"'.$token.'\\"]]",null,"generic"]]]', |
|
71 | 71 | ]; |
72 | 72 | $headers = [ |
73 | 73 | 'Content-Type' => 'application/x-www-form-urlencoded;charset=utf-8', |
@@ -135,7 +135,7 @@ discard block |
||
135 | 135 | ->setUrl($request->getUri()->__toString()); |
136 | 136 | } |
137 | 137 | $developerName = trim($developerNode->textContent); |
138 | - $developerUrl = GPlayApps::GOOGLE_PLAY_URL . $developerNode->attributes->getNamedItem('href')->textContent; |
|
138 | + $developerUrl = GPlayApps::GOOGLE_PLAY_URL.$developerNode->attributes->getNamedItem('href')->textContent; |
|
139 | 139 | $developerId = parse_query(parse_url($developerUrl, PHP_URL_QUERY))[GPlayApps::REQ_PARAM_ID]; |
140 | 140 | $developer = new Developer( |
141 | 141 | Developer::newBuilder() |
@@ -162,7 +162,7 @@ discard block |
||
162 | 162 | } |
163 | 163 | $iconSrc = $iconNode->textContent; |
164 | 164 | if (strpos($iconSrc, '//') === 0) { |
165 | - $iconSrc = 'https:' . $iconSrc; |
|
165 | + $iconSrc = 'https:'.$iconSrc; |
|
166 | 166 | } |
167 | 167 | $icon = new GoogleImage($iconSrc); |
168 | 168 | $icon->reset(); |
@@ -57,7 +57,7 @@ |
||
57 | 57 | private static function extractDeveloper(array $data): Developer |
58 | 58 | { |
59 | 59 | $developerName = $data[4][0][0][0]; |
60 | - $developerPage = GPlayApps::GOOGLE_PLAY_URL . $data[4][0][0][1][4][2]; |
|
60 | + $developerPage = GPlayApps::GOOGLE_PLAY_URL.$data[4][0][0][1][4][2]; |
|
61 | 61 | $developerId = parse_query(parse_url($developerPage, PHP_URL_QUERY))[GPlayApps::REQ_PARAM_ID]; |
62 | 62 | $developer = new Developer( |
63 | 63 | Developer::newBuilder() |
@@ -20,7 +20,7 @@ |
||
20 | 20 | public function __invoke(RequestInterface $request, ResponseInterface $response) |
21 | 21 | { |
22 | 22 | $json = \GuzzleHttp\json_decode($response->getBody()->getContents(), true); |
23 | - return array_map(static function (array $v) { |
|
23 | + return array_map(static function(array $v) { |
|
24 | 24 | return $v['s']; |
25 | 25 | }, $json); |
26 | 26 | } |
@@ -80,15 +80,15 @@ |
||
80 | 80 | $this->address = $builder->getAddress(); |
81 | 81 | |
82 | 82 | if (empty($this->id)) { |
83 | - throw new \InvalidArgumentException('Developer id cannot be null or empty. ' . |
|
83 | + throw new \InvalidArgumentException('Developer id cannot be null or empty. '. |
|
84 | 84 | 'Solution: $developerBuilder->setId(...);'); |
85 | 85 | } |
86 | 86 | if (empty($this->url)) { |
87 | - throw new \InvalidArgumentException('Developer url cannot be null or empty. ' . |
|
87 | + throw new \InvalidArgumentException('Developer url cannot be null or empty. '. |
|
88 | 88 | 'Solution: $developerBuilder->setUrl(...);'); |
89 | 89 | } |
90 | 90 | if (empty($this->name)) { |
91 | - throw new \InvalidArgumentException('Developer name cannot be null or empty. ' . |
|
91 | + throw new \InvalidArgumentException('Developer name cannot be null or empty. '. |
|
92 | 92 | 'Solution: $developerBuilder->setName(...);'); |
93 | 93 | } |
94 | 94 | } |