@@ -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\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 | /** |
@@ -4,7 +4,7 @@ discard block |
||
| 4 | 4 | * For the full copyright and license information, please view the LICENSE |
| 5 | 5 | * file that was distributed with this source code. |
| 6 | 6 | */ |
| 7 | -declare(strict_types=1); |
|
| 7 | +declare(strict_types = 1); |
|
| 8 | 8 | |
| 9 | 9 | namespace Gitter\Resources; |
| 10 | 10 | |
@@ -75,7 +75,7 @@ discard block |
||
| 75 | 75 | $response = array_reverse($this->fetch($route)); |
| 76 | 76 | |
| 77 | 77 | foreach ($response as $message) { |
| 78 | - $beforeId = (string)$message['id']; |
|
| 78 | + $beforeId = (string) $message['id']; |
|
| 79 | 79 | yield $message; |
| 80 | 80 | } |
| 81 | 81 | |
@@ -92,7 +92,7 @@ discard block |
||
| 92 | 92 | { |
| 93 | 93 | $route = Route::get('rooms/{roomId}/chatMessages') |
| 94 | 94 | ->with('roomId', $roomId) |
| 95 | - ->with('limit', (string)$limit); |
|
| 95 | + ->with('limit', (string) $limit); |
|
| 96 | 96 | |
| 97 | 97 | if ($query !== null) { |
| 98 | 98 | $route->with('q', $query); |
@@ -125,10 +125,10 @@ discard block |
||
| 125 | 125 | $route->with('afterId', $afterId); |
| 126 | 126 | } |
| 127 | 127 | |
| 128 | - $response = (array)$this->fetch($route); |
|
| 128 | + $response = (array) $this->fetch($route); |
|
| 129 | 129 | |
| 130 | 130 | foreach ($response as $message) { |
| 131 | - $afterId = (string)$message['id']; |
|
| 131 | + $afterId = (string) $message['id']; |
|
| 132 | 132 | yield $message; |
| 133 | 133 | } |
| 134 | 134 | } while (count($response) >= $limit); |
@@ -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 @@ |
||
| 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()) |