@@ -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 @@ |
||
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()); |
@@ -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 | |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | { |
74 | 74 | $observer = new Observer(); |
75 | 75 | |
76 | - $this->promise($route)->then(function (ResponseInterface $response) use ($observer) { |
|
76 | + $this->promise($route)->then(function(ResponseInterface $response) use ($observer) { |
|
77 | 77 | $this->onConnect($response, $observer); |
78 | 78 | }); |
79 | 79 | |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | list($method, $uri) = [$route->method(), $route->build()]; |
91 | 91 | |
92 | 92 | // Log request |
93 | - $this->debugLog($this->client, ' -> ' . $method . ' ' . $uri); |
|
93 | + $this->debugLog($this->client, ' -> '.$method.' '.$uri); |
|
94 | 94 | |
95 | 95 | return $this->browser |
96 | 96 | ->withOptions(['streaming' => true]) |
@@ -106,16 +106,16 @@ discard block |
||
106 | 106 | $json = new JsonStream(); |
107 | 107 | |
108 | 108 | // Log response |
109 | - $this->debugLog($this->client, ' <- ' . $response->getStatusCode() . ' ' . $response->getReasonPhrase()); |
|
109 | + $this->debugLog($this->client, ' <- '.$response->getStatusCode().' '.$response->getReasonPhrase()); |
|
110 | 110 | |
111 | 111 | /* @var $body ReadableStreamInterface */ |
112 | 112 | $body = $response->getBody(); |
113 | 113 | |
114 | - $body->on('data', function ($chunk) use ($json, $observer) { |
|
114 | + $body->on('data', function($chunk) use ($json, $observer) { |
|
115 | 115 | // Log response chunk |
116 | - $this->debugLog($this->client, ' <- ' . $chunk); |
|
116 | + $this->debugLog($this->client, ' <- '.$chunk); |
|
117 | 117 | |
118 | - $json->push($chunk, function ($object) use ($observer) { |
|
118 | + $json->push($chunk, function($object) use ($observer) { |
|
119 | 119 | $observer->fire($object); |
120 | 120 | }); |
121 | 121 | }); |
@@ -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 @@ |
||
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; |
11 | 11 | |
@@ -182,7 +182,7 @@ discard block |
||
182 | 182 | */ |
183 | 183 | public function __get(string $resource) |
184 | 184 | { |
185 | - $resolve = function (string $resource) { |
|
185 | + $resolve = function(string $resource) { |
|
186 | 186 | switch ($resource) { |
187 | 187 | // == RESOURCES == |
188 | 188 | case 'users': |
@@ -322,7 +322,7 @@ discard block |
||
322 | 322 | case 'groups': |
323 | 323 | case 'messages': |
324 | 324 | case 'rooms': |
325 | - throw new \LogicException('Resource ' . $name . ' can not be removed'); |
|
325 | + throw new \LogicException('Resource '.$name.' can not be removed'); |
|
326 | 326 | } |
327 | 327 | } |
328 | 328 |