@@ -5,7 +5,7 @@ |
||
5 | 5 | * For the full copyright and license information, please view the LICENSE |
6 | 6 | * file that was distributed with this source code. |
7 | 7 | */ |
8 | -declare(strict_types=1); |
|
8 | +declare(strict_types = 1); |
|
9 | 9 | |
10 | 10 | namespace Gitter\Support; |
11 | 11 |
@@ -5,7 +5,7 @@ |
||
5 | 5 | * For the full copyright and license information, please view the LICENSE |
6 | 6 | * file that was distributed with this source code. |
7 | 7 | */ |
8 | -declare(strict_types=1); |
|
8 | +declare(strict_types = 1); |
|
9 | 9 | |
10 | 10 | namespace Gitter; |
11 | 11 |
@@ -5,7 +5,7 @@ discard block |
||
5 | 5 | * For the full copyright and license information, please view the LICENSE |
6 | 6 | * file that was distributed with this source code. |
7 | 7 | */ |
8 | -declare(strict_types=1); |
|
8 | +declare(strict_types = 1); |
|
9 | 9 | |
10 | 10 | namespace Gitter\Resources; |
11 | 11 | |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | */ |
65 | 65 | public function currentUserId(): string |
66 | 66 | { |
67 | - return (string)($this->current()['id'] ?? null); |
|
67 | + return (string) ($this->current()['id'] ?? null); |
|
68 | 68 | } |
69 | 69 | |
70 | 70 | /** |
@@ -5,7 +5,7 @@ discard block |
||
5 | 5 | * For the full copyright and license information, please view the LICENSE |
6 | 6 | * file that was distributed with this source code. |
7 | 7 | */ |
8 | -declare(strict_types=1); |
|
8 | +declare(strict_types = 1); |
|
9 | 9 | |
10 | 10 | namespace Gitter\Resources; |
11 | 11 | |
@@ -306,7 +306,7 @@ discard block |
||
306 | 306 | |
307 | 307 | yield from $response = $this->fetch($route); |
308 | 308 | |
309 | - } while(count($response) >= $limit && ($skip += $limit)); |
|
309 | + } while (count($response) >= $limit && ($skip += $limit)); |
|
310 | 310 | } |
311 | 311 | |
312 | 312 | /** |
@@ -5,7 +5,7 @@ |
||
5 | 5 | * For the full copyright and license information, please view the LICENSE |
6 | 6 | * file that was distributed with this source code. |
7 | 7 | */ |
8 | -declare(strict_types=1); |
|
8 | +declare(strict_types = 1); |
|
9 | 9 | |
10 | 10 | namespace Gitter\Resources; |
11 | 11 |
@@ -5,7 +5,7 @@ discard block |
||
5 | 5 | * For the full copyright and license information, please view the LICENSE |
6 | 6 | * file that was distributed with this source code. |
7 | 7 | */ |
8 | -declare(strict_types=1); |
|
8 | +declare(strict_types = 1); |
|
9 | 9 | |
10 | 10 | namespace Gitter\Resources; |
11 | 11 | |
@@ -57,12 +57,12 @@ discard block |
||
57 | 57 | */ |
58 | 58 | protected function fetch(Route $route): array |
59 | 59 | { |
60 | - $rescue = (new Evacuator(function () use ($route) { |
|
61 | - return (array)$this->viaHttp()->request($route); |
|
60 | + $rescue = (new Evacuator(function() use ($route) { |
|
61 | + return (array) $this->viaHttp()->request($route); |
|
62 | 62 | })) |
63 | 63 | // If response has status code 4xx |
64 | - ->onError(function (ClientException $e) { |
|
65 | - $this->client->logger->error(get_class($e) . ' ' . $e->getMessage()); |
|
64 | + ->onError(function(ClientException $e) { |
|
65 | + $this->client->logger->error(get_class($e).' '.$e->getMessage()); |
|
66 | 66 | |
67 | 67 | switch ($e->getResponse()->getStatusCode()) { |
68 | 68 | case 429: // 429 Too Many Requests |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | throw $e; |
74 | 74 | }) |
75 | 75 | // Other |
76 | - ->onError(function (\Exception $e) { |
|
76 | + ->onError(function(\Exception $e) { |
|
77 | 77 | $this->client->logger->error($e->getMessage()); |
78 | 78 | throw $e; |
79 | 79 | }) |
@@ -94,7 +94,7 @@ discard block |
||
94 | 94 | return (new Evacuator(function() use ($route) { |
95 | 95 | return $this->viaStream()->request($route); |
96 | 96 | })) |
97 | - ->onError(function (\Exception $e) { |
|
97 | + ->onError(function(\Exception $e) { |
|
98 | 98 | $this->client->logger->error($e->getMessage()); |
99 | 99 | }) |
100 | 100 | ->retries($this->client->getRetriesCount()) |
@@ -5,7 +5,7 @@ discard block |
||
5 | 5 | * For the full copyright and license information, please view the LICENSE |
6 | 6 | * file that was distributed with this source code. |
7 | 7 | */ |
8 | -declare(strict_types=1); |
|
8 | +declare(strict_types = 1); |
|
9 | 9 | |
10 | 10 | namespace Gitter; |
11 | 11 | |
@@ -146,7 +146,7 @@ discard block |
||
146 | 146 | */ |
147 | 147 | public function with(string $parameter, $value): Route |
148 | 148 | { |
149 | - $this->parameters[$parameter] = (string)$value; |
|
149 | + $this->parameters[$parameter] = (string) $value; |
|
150 | 150 | |
151 | 151 | return $this; |
152 | 152 | } |
@@ -212,7 +212,7 @@ discard block |
||
212 | 212 | $route = $updatedRoute; |
213 | 213 | } |
214 | 214 | |
215 | - return $this->url . $route . '?' . http_build_query($query); |
|
215 | + return $this->url.$route.'?'.http_build_query($query); |
|
216 | 216 | } |
217 | 217 | |
218 | 218 | /** |
@@ -5,7 +5,7 @@ |
||
5 | 5 | * For the full copyright and license information, please view the LICENSE |
6 | 6 | * file that was distributed with this source code. |
7 | 7 | */ |
8 | -declare(strict_types=1); |
|
8 | +declare(strict_types = 1); |
|
9 | 9 | |
10 | 10 | namespace Gitter\Adapters; |
11 | 11 |
@@ -5,7 +5,7 @@ discard block |
||
5 | 5 | * For the full copyright and license information, please view the LICENSE |
6 | 6 | * file that was distributed with this source code. |
7 | 7 | */ |
8 | -declare(strict_types=1); |
|
8 | +declare(strict_types = 1); |
|
9 | 9 | |
10 | 10 | namespace Gitter\Adapters; |
11 | 11 | |
@@ -68,17 +68,17 @@ discard block |
||
68 | 68 | $options = $this->prepareRequestOptions($route); |
69 | 69 | |
70 | 70 | // Log request |
71 | - $this->debugLog($this->client, ' -> ' . $method . ' ' . $uri); |
|
71 | + $this->debugLog($this->client, ' -> '.$method.' '.$uri); |
|
72 | 72 | if ($options['body'] ?? false) { |
73 | - $this->debugLog($this->client, ' -> body ' . $options['body']); |
|
73 | + $this->debugLog($this->client, ' -> body '.$options['body']); |
|
74 | 74 | } |
75 | 75 | |
76 | 76 | // End log request |
77 | 77 | $response = $this->guzzle->request($method, $uri, $options); |
78 | 78 | |
79 | 79 | // Log response |
80 | - $this->debugLog($this->client, ' <- ' . $response->getStatusCode() . ' ' . $response->getReasonPhrase()); |
|
81 | - $this->debugLog($this->client, ' <- ' . (string)$response->getBody()); |
|
80 | + $this->debugLog($this->client, ' <- '.$response->getStatusCode().' '.$response->getReasonPhrase()); |
|
81 | + $this->debugLog($this->client, ' <- '.(string) $response->getBody()); |
|
82 | 82 | // End log response |
83 | 83 | |
84 | 84 | return $this->parseResponse($response); |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | */ |
107 | 107 | private function parseResponse(ResponseInterface $response): array |
108 | 108 | { |
109 | - $data = json_decode((string)$response->getBody(), true); |
|
109 | + $data = json_decode((string) $response->getBody(), true); |
|
110 | 110 | |
111 | 111 | if (json_last_error() !== JSON_ERROR_NONE) { |
112 | 112 | throw new \RuntimeException(json_last_error_msg()); |