Passed
Pull Request — master (#243)
by Albert
02:18
created
src/Websocket/Pusher.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -209,7 +209,7 @@  discard block
 block discarded – undo
209 209
      */
210 210
     public function shouldBroadcast(): bool
211 211
     {
212
-        return $this->broadcast && empty($this->descriptors) && ! $this->assigned;
212
+        return $this->broadcast && empty($this->descriptors) && !$this->assigned;
213 213
     }
214 214
 
215 215
     /**
@@ -233,7 +233,7 @@  discard block
 block discarded – undo
233 233
      */
234 234
     protected function getWebsocketConnections(): array
235 235
     {
236
-        return array_filter(iterator_to_array($this->server->connections), function ($fd) {
236
+        return array_filter(iterator_to_array($this->server->connections), function($fd) {
237 237
             return $this->isServerWebsocket($fd);
238 238
         });
239 239
     }
@@ -245,7 +245,7 @@  discard block
 block discarded – undo
245 245
      */
246 246
     public function shouldPushToDescriptor(int $fd): bool
247 247
     {
248
-        if (! $this->server->exist($fd)) {
248
+        if (!$this->server->exist($fd)) {
249 249
             return false;
250 250
         }
251 251
 
@@ -262,7 +262,7 @@  discard block
 block discarded – undo
262 262
     public function push($payload): void
263 263
     {
264 264
         // attach sender if not broadcast
265
-        if (! $this->broadcast && $this->sender && ! $this->hasDescriptor($this->sender)) {
265
+        if (!$this->broadcast && $this->sender && !$this->hasDescriptor($this->sender)) {
266 266
             $this->addDescriptor($this->sender);
267 267
         }
268 268
 
Please login to merge, or discard this patch.
src/Concerns/InteractsWithWebsocket.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
             // enable sandbox
67 67
             $sandbox->enable();
68 68
             // check if socket.io connection established
69
-            if (! $this->websocketHandler->onOpen($swooleRequest->fd, $illuminateRequest)) {
69
+            if (!$this->websocketHandler->onOpen($swooleRequest->fd, $illuminateRequest)) {
70 70
                 return;
71 71
             }
72 72
             // trigger 'connect' websocket event
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
      */
131 131
     public function onClose($server, $fd, $reactorId)
132 132
     {
133
-        if (! $this->isServerWebsocket($fd) || ! $server instanceof WebsocketServer) {
133
+        if (!$this->isServerWebsocket($fd) || !$server instanceof WebsocketServer) {
134 134
             return;
135 135
         }
136 136
 
@@ -158,7 +158,7 @@  discard block
 block discarded – undo
158 158
      */
159 159
     protected function isWebsocketPushPacket($packet)
160 160
     {
161
-        if (! is_array($packet)) {
161
+        if (!is_array($packet)) {
162 162
             return false;
163 163
         }
164 164
 
@@ -243,7 +243,7 @@  discard block
 block discarded – undo
243 243
     {
244 244
         $handlerClass = $this->container->make('config')->get('swoole_websocket.handler');
245 245
 
246
-        if (! $handlerClass) {
246
+        if (!$handlerClass) {
247 247
             throw new WebsocketNotSetInConfigException;
248 248
         }
249 249
 
@@ -290,7 +290,7 @@  discard block
 block discarded – undo
290 290
      */
291 291
     protected function bindRoom(): void
292 292
     {
293
-        $this->app->singleton(RoomContract::class, function (Container $container) {
293
+        $this->app->singleton(RoomContract::class, function(Container $container) {
294 294
             $config = $container->make('config');
295 295
             $driver = $config->get('swoole_websocket.default');
296 296
             $settings = $config->get("swoole_websocket.settings.{$driver}");
@@ -311,7 +311,7 @@  discard block
 block discarded – undo
311 311
      */
312 312
     protected function bindWebsocket()
313 313
     {
314
-        $this->app->singleton(Websocket::class, function (Container $app) {
314
+        $this->app->singleton(Websocket::class, function(Container $app) {
315 315
             return new Websocket($app->make(RoomContract::class), new Pipeline($app));
316 316
         });
317 317
 
@@ -326,7 +326,7 @@  discard block
 block discarded – undo
326 326
         $routePath = $this->container->make('config')
327 327
             ->get('swoole_websocket.route_file');
328 328
 
329
-        if (! file_exists($routePath)) {
329
+        if (!file_exists($routePath)) {
330 330
             $routePath = __DIR__ . '/../../routes/websocket.php';
331 331
         }
332 332
 
@@ -342,7 +342,7 @@  discard block
 block discarded – undo
342 342
      */
343 343
     public function isWebsocketPushPayload($payload): bool
344 344
     {
345
-        if (! is_array($payload)) {
345
+        if (!is_array($payload)) {
346 346
             return false;
347 347
         }
348 348
 
Please login to merge, or discard this patch.