Passed
Pull Request — master (#161)
by
unknown
02:33
created
src/Concerns/InteractsWithWebsocket.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
             // enable sandbox
55 55
             $this->app['swoole.sandbox']->enable();
56 56
             // check if socket.io connection established
57
-            if (! $this->websocketHandler->onOpen($swooleRequest->fd, $illuminateRequest)) {
57
+            if (!$this->websocketHandler->onOpen($swooleRequest->fd, $illuminateRequest)) {
58 58
                 return;
59 59
             }
60 60
             // trigger 'connect' websocket event
@@ -116,7 +116,7 @@  discard block
 block discarded – undo
116 116
      */
117 117
     public function onClose($server, $fd, $reactorId)
118 118
     {
119
-        if (! $this->isWebsocket($fd)) {
119
+        if (!$this->isWebsocket($fd)) {
120 120
             return;
121 121
         }
122 122
 
@@ -147,12 +147,12 @@  discard block
 block discarded – undo
147 147
         $message = $this->parser->encode($event, $message);
148 148
 
149 149
         // attach sender if not broadcast
150
-        if (! $broadcast && $sender && ! in_array($sender, $fds)) {
150
+        if (!$broadcast && $sender && !in_array($sender, $fds)) {
151 151
             $fds[] = $sender;
152 152
         }
153 153
 
154 154
         // check if to broadcast all clients
155
-        if ($broadcast && empty($fds) && ! $assigned) {
155
+        if ($broadcast && empty($fds) && !$assigned) {
156 156
             foreach ($server->connections as $fd) {
157 157
                 if ($this->isWebsocket($fd)) {
158 158
                     $fds[] = $fd;
@@ -162,7 +162,7 @@  discard block
 block discarded – undo
162 162
 
163 163
         // push message to designated fds
164 164
         foreach ($fds as $fd) {
165
-            if (($broadcast && $sender === (integer) $fd) || ! $server->exist($fd)) {
165
+            if (($broadcast && $sender === (integer) $fd) || !$server->exist($fd)) {
166 166
                 continue;
167 167
             }
168 168
             $server->push($fd, $message, $opcode);
@@ -221,7 +221,7 @@  discard block
 block discarded – undo
221 221
     {
222 222
         $handlerClass = $this->container['config']->get('swoole_websocket.handler');
223 223
 
224
-        if (! $handlerClass) {
224
+        if (!$handlerClass) {
225 225
             throw new Exception('Websocket handler is not set in swoole_websocket config');
226 226
         }
227 227
 
@@ -266,7 +266,7 @@  discard block
 block discarded – undo
266 266
      */
267 267
     protected function bindRoom()
268 268
     {
269
-        $this->app->singleton(RoomContract::class, function ($app) {
269
+        $this->app->singleton(RoomContract::class, function($app) {
270 270
             return $this->getWebsocketRoom();
271 271
         });
272 272
         $this->app->alias(RoomContract::class, 'swoole.room');
@@ -277,7 +277,7 @@  discard block
 block discarded – undo
277 277
      */
278 278
     protected function bindWebsocket()
279 279
     {
280
-        $this->app->singleton(Websocket::class, function ($app) {
280
+        $this->app->singleton(Websocket::class, function($app) {
281 281
             return new Websocket($app['swoole.room'], new Pipeline($app));
282 282
         });
283 283
         $this->app->alias(Websocket::class, 'swoole.websocket');
@@ -290,7 +290,7 @@  discard block
 block discarded – undo
290 290
     {
291 291
         $routePath = $this->container['config']->get('swoole_websocket.route_file');
292 292
 
293
-        if (! file_exists($routePath)) {
293
+        if (!file_exists($routePath)) {
294 294
             $routePath = __DIR__ . '/../../routes/websocket.php';
295 295
         }
296 296
 
Please login to merge, or discard this patch.
src/Concerns/InteractsWithSwooleTable.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -49,7 +49,7 @@
 block discarded – undo
49 49
      */
50 50
     protected function bindSwooleTable()
51 51
     {
52
-        $this->app->singleton(SwooleTable::class, function () {
52
+        $this->app->singleton(SwooleTable::class, function() {
53 53
             return $this->table;
54 54
         });
55 55
         $this->app->alias(SwooleTable::class, 'swoole.table');
Please login to merge, or discard this patch.
src/LaravelServiceProvider.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@  discard block
 block discarded – undo
13 13
      */
14 14
     protected function registerManager()
15 15
     {
16
-        $this->app->singleton('swoole.manager', function ($app) {
16
+        $this->app->singleton('swoole.manager', function($app) {
17 17
             return new Manager($app, 'laravel');
18 18
         });
19 19
     }
@@ -25,6 +25,6 @@  discard block
 block discarded – undo
25 25
      */
26 26
     protected function bootRoutes()
27 27
     {
28
-        require __DIR__.'/../routes/laravel_routes.php';
28
+        require __DIR__ . '/../routes/laravel_routes.php';
29 29
     }
30 30
 }
Please login to merge, or discard this patch.
src/LumenServiceProvider.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@  discard block
 block discarded – undo
13 13
      */
14 14
     protected function registerManager()
15 15
     {
16
-        $this->app->singleton('swoole.manager', function ($app) {
16
+        $this->app->singleton('swoole.manager', function($app) {
17 17
             return new Manager($app, 'lumen');
18 18
         });
19 19
     }
@@ -28,11 +28,11 @@  discard block
 block discarded – undo
28 28
         $app = $this->app;
29 29
 
30 30
         if (property_exists($app, 'router')) {
31
-            $app->router->group(['namespace' => 'SwooleTW\Http\Controllers'], function ($app) {
31
+            $app->router->group(['namespace' => 'SwooleTW\Http\Controllers'], function($app) {
32 32
                 require __DIR__ . '/../routes/lumen_routes.php';
33 33
             });
34 34
         } else {
35
-            $app->group(['namespace' => 'App\Http\Controllers'], function ($app) {
35
+            $app->group(['namespace' => 'App\Http\Controllers'], function($app) {
36 36
                 require __DIR__ . '/../routes/lumen_routes.php';
37 37
             });
38 38
         }
Please login to merge, or discard this patch.
src/Transformers/Request.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -151,7 +151,7 @@  discard block
 block discarded – undo
151 151
             $key = str_replace('-', '_', $key);
152 152
             $key = strtoupper($key);
153 153
 
154
-            if (! in_array($key, ['REMOTE_ADDR', 'SERVER_PORT', 'HTTPS'])) {
154
+            if (!in_array($key, ['REMOTE_ADDR', 'SERVER_PORT', 'HTTPS'])) {
155 155
                 $key = 'HTTP_' . $key;
156 156
             }
157 157
 
@@ -178,7 +178,7 @@  discard block
 block discarded – undo
178 178
         }
179 179
 
180 180
         $filename = $publicPath . $uri;
181
-        if (! is_file($filename) || filesize($filename) === 0) {
181
+        if (!is_file($filename) || filesize($filename) === 0) {
182 182
             return;
183 183
         }
184 184
 
Please login to merge, or discard this patch.
src/Transformers/Response.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
         $illuminateResponse = $this->getIlluminateResponse();
66 66
 
67 67
         /* RFC2616 - 14.18 says all Responses need to have a Date */
68
-        if (! $illuminateResponse->headers->has('Date')) {
68
+        if (!$illuminateResponse->headers->has('Date')) {
69 69
             $illuminateResponse->setDate(\DateTime::createFromFormat('U', time()));
70 70
         }
71 71
 
@@ -139,7 +139,7 @@  discard block
 block discarded – undo
139 139
      */
140 140
     protected function setIlluminateResponse($illuminateResponse)
141 141
     {
142
-        if (! $illuminateResponse instanceof SymfonyResponse) {
142
+        if (!$illuminateResponse instanceof SymfonyResponse) {
143 143
             $content = (string) $illuminateResponse;
144 144
             $illuminateResponse = new IlluminateResponse($content);
145 145
         }
Please login to merge, or discard this patch.
src/Task/Connectors/SwooleTaskConnector.php 1 patch
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -14,12 +14,12 @@
 block discarded – undo
14 14
      */
15 15
     protected $swoole;
16 16
 
17
-     /**
18
-     * Create a new Swoole Async task connector instance.
19
-     *
20
-     * @param  \Swoole\Http\Server $swoole
21
-     * @return void
22
-     */
17
+        /**
18
+         * Create a new Swoole Async task connector instance.
19
+         *
20
+         * @param  \Swoole\Http\Server $swoole
21
+         * @return void
22
+         */
23 23
     public function __construct($swoole)
24 24
     {
25 25
         $this->swoole = $swoole;
Please login to merge, or discard this patch.
src/Task/SwooleTaskQueue.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
      */
50 50
     public function pushRaw($payload, $queue = null, array $options = [])
51 51
     {
52
-        return $this->swoole->task($payload, ! is_numeric($queue) ? 1 : (int) $queue);
52
+        return $this->swoole->task($payload, !is_numeric($queue) ? 1 : (int) $queue);
53 53
     }
54 54
 
55 55
     /**
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
      */
64 64
     public function later($delay, $job, $data = '', $queue = null)
65 65
     {
66
-        return Timer::after($this->secondsUntil($delay) * 1000, function () use ($job, $data, $queue) {
66
+        return Timer::after($this->secondsUntil($delay) * 1000, function() use ($job, $data, $queue) {
67 67
             return $this->push($job, $data, $queue);
68 68
         });
69 69
     }
Please login to merge, or discard this patch.
src/Server/Resetters/RebindRouterContainer.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@
 block discarded – undo
20 20
         if ($sandbox->isLaravel()) {
21 21
             $router = $app->make('router');
22 22
             $request = $sandbox->getRequest();
23
-            $closure = function () use ($app, $request) {
23
+            $closure = function() use ($app, $request) {
24 24
                 $this->container = $app;
25 25
                 if (is_null($request)) {
26 26
                     return;
Please login to merge, or discard this patch.