Completed
Push — master ( a97641...d233d7 )
by Kirill
02:12
created
src/Adapters/StreamAdapter.php 2 patches
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -17,7 +17,6 @@
 block discarded – undo
17 17
 use Monolog\Logger;
18 18
 use Psr\Http\Message\ResponseInterface;
19 19
 use React\EventLoop\ExtEventLoop;
20
-use React\EventLoop\Factory as EventLoop;
21 20
 use React\EventLoop\LibEventLoop;
22 21
 use React\EventLoop\LibEvLoop;
23 22
 use React\EventLoop\LoopInterface;
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -88,7 +88,7 @@  discard block
 block discarded – undo
88 88
     {
89 89
         $observer = new Observer();
90 90
 
91
-        $this->promise($route)->then(function (ResponseInterface $response) use ($observer) {
91
+        $this->promise($route)->then(function(ResponseInterface $response) use ($observer) {
92 92
             $this->onConnect($response, $observer);
93 93
         });
94 94
 
@@ -105,7 +105,7 @@  discard block
 block discarded – undo
105 105
         list($method, $uri) = [$route->method(), $route->build()];
106 106
 
107 107
         // Log request
108
-        $this->client->log(' -> ' . $method . ' ' . $uri, Logger::DEBUG);
108
+        $this->client->log(' -> '.$method.' '.$uri, Logger::DEBUG);
109 109
 
110 110
         return $this->browser
111 111
             ->withOptions(['streaming' => true])
@@ -121,16 +121,16 @@  discard block
 block discarded – undo
121 121
         $json = new JsonStream();
122 122
 
123 123
         // Log response
124
-        $this->client->log(' <- ' . $response->getStatusCode() . ' ' . $response->getReasonPhrase(), Logger::DEBUG);
124
+        $this->client->log(' <- '.$response->getStatusCode().' '.$response->getReasonPhrase(), Logger::DEBUG);
125 125
 
126 126
         /* @var $body ReadableStreamInterface */
127 127
         $body = $response->getBody();
128 128
 
129
-        $body->on('data', function ($chunk) use ($json, $observer) {
129
+        $body->on('data', function($chunk) use ($json, $observer) {
130 130
             // Log response chunk
131
-            $this->client->log('   <- ' . $chunk, Logger::DEBUG);
131
+            $this->client->log('   <- '.$chunk, Logger::DEBUG);
132 132
 
133
-            $json->push($chunk, function ($object) use ($observer) {
133
+            $json->push($chunk, function($object) use ($observer) {
134 134
                 $observer->fire($object);
135 135
             });
136 136
         });
Please login to merge, or discard this patch.
src/Route.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,4 +1,4 @@  discard block
 block discarded – undo
1
-<?php declare(strict_types=1);
1
+<?php declare(strict_types = 1);
2 2
 /**
3 3
  * This file is part of GitterApi package.
4 4
  *
@@ -210,7 +210,7 @@  discard block
 block discarded – undo
210 210
             $route = $updatedRoute;
211 211
         }
212 212
 
213
-        return $this->url . $route . '?' . http_build_query($query);
213
+        return $this->url.$route.'?'.http_build_query($query);
214 214
     }
215 215
 
216 216
     /**
Please login to merge, or discard this patch.
src/Adapters/HttpAdapter.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -1,4 +1,4 @@  discard block
 block discarded – undo
1
-<?php declare(strict_types=1);
1
+<?php declare(strict_types = 1);
2 2
 /**
3 3
  * This file is part of GitterApi package.
4 4
  *
@@ -79,13 +79,13 @@  discard block
 block discarded – undo
79 79
         $options = $this->prepareRequestOptions($route);
80 80
 
81 81
         // Log request
82
-        $this->client->log(' -> ' . $method . ' ' . $uri . "\n body: " . ($options['body'] ?? ''), Logger::DEBUG);
82
+        $this->client->log(' -> '.$method.' '.$uri."\n body: ".($options['body'] ?? ''), Logger::DEBUG);
83 83
 
84 84
         $response = $this->guzzle->request($method, $uri, $options);
85 85
 
86 86
         // Log response
87
-        $this->client->log(' <- ' . $response->getStatusCode() . ' ' . $response->getReasonPhrase(), Logger::DEBUG);
88
-        $this->client->log('   <- ' . (string)$response->getBody(), Logger::DEBUG);
87
+        $this->client->log(' <- '.$response->getStatusCode().' '.$response->getReasonPhrase(), Logger::DEBUG);
88
+        $this->client->log('   <- '.(string) $response->getBody(), Logger::DEBUG);
89 89
 
90 90
         return $this->parseResponse($response);
91 91
     }
@@ -112,7 +112,7 @@  discard block
 block discarded – undo
112 112
      */
113 113
     private function parseResponse(ResponseInterface $response): array
114 114
     {
115
-        $data = json_decode((string)$response->getBody(), true);
115
+        $data = json_decode((string) $response->getBody(), true);
116 116
 
117 117
         if (json_last_error() !== JSON_ERROR_NONE) {
118 118
             throw new \RuntimeException(json_last_error_msg());
Please login to merge, or discard this patch.
src/Resources/Rooms.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,4 +1,4 @@  discard block
 block discarded – undo
1
-<?php declare(strict_types=1);
1
+<?php declare(strict_types = 1);
2 2
 /**
3 3
  * This file is part of GitterApi package.
4 4
  *
@@ -271,7 +271,7 @@  discard block
 block discarded – undo
271 271
 
272 272
             yield from $response = $this->fetch($route);
273 273
 
274
-        } while(count($response) >= $limit && ($skip += $limit));
274
+        } while (count($response) >= $limit && ($skip += $limit));
275 275
     }
276 276
 
277 277
     /**
Please login to merge, or discard this patch.
src/Resources/Groups.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,4 +1,4 @@
 block discarded – undo
1
-<?php declare(strict_types=1);
1
+<?php declare(strict_types = 1);
2 2
 /**
3 3
  * This file is part of GitterApi package.
4 4
  *
Please login to merge, or discard this patch.
src/Resources/AbstractResource.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,4 +1,4 @@  discard block
 block discarded – undo
1
-<?php declare(strict_types=1);
1
+<?php declare(strict_types = 1);
2 2
 /**
3 3
  * This file is part of GitterApi package.
4 4
  *
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
      */
51 51
     protected function fetch(Route $route): array
52 52
     {
53
-        return (array)$this->viaHttp()->request($route);
53
+        return (array) $this->viaHttp()->request($route);
54 54
     }
55 55
 
56 56
     /**
Please login to merge, or discard this patch.
src/Support/Loggable.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,4 +1,4 @@
 block discarded – undo
1
-<?php declare(strict_types=1);
1
+<?php declare(strict_types = 1);
2 2
 /**
3 3
  * This file is part of GitterApi package.
4 4
  *
Please login to merge, or discard this patch.
src/Support/JsonStream.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,4 +1,4 @@
 block discarded – undo
1
-<?php declare(strict_types=1);
1
+<?php declare(strict_types = 1);
2 2
 /**
3 3
  * This file is part of GitterApi package.
4 4
  *
Please login to merge, or discard this patch.
src/Support/Observer.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,4 +1,4 @@
 block discarded – undo
1
-<?php declare(strict_types=1);
1
+<?php declare(strict_types = 1);
2 2
 /**
3 3
  * This file is part of GitterApi package.
4 4
  *
Please login to merge, or discard this patch.