Completed
Pull Request — master (#302)
by Albert
06:51 queued 11s
created
src/Concerns/InteractsWithWebsocket.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -88,11 +88,11 @@  discard block
 block discarded – undo
88 88
             // enable sandbox
89 89
             $sandbox->enable();
90 90
             // call customized handshake handler
91
-            if ($response && ! $this->app->make($handshakeHandler)->handle($swooleRequest, $response)) {
91
+            if ($response && !$this->app->make($handshakeHandler)->handle($swooleRequest, $response)) {
92 92
                 return;
93 93
             }
94 94
             // check if socket.io connection established
95
-            if (! $this->websocketHandler->onOpen($swooleRequest->fd, $illuminateRequest)) {
95
+            if (!$this->websocketHandler->onOpen($swooleRequest->fd, $illuminateRequest)) {
96 96
                 return;
97 97
             }
98 98
             // trigger 'connect' websocket event
@@ -156,7 +156,7 @@  discard block
 block discarded – undo
156 156
      */
157 157
     public function onClose($server, $fd, $reactorId)
158 158
     {
159
-        if (! $this->isServerWebsocket($fd) || ! $server instanceof WebsocketServer) {
159
+        if (!$this->isServerWebsocket($fd) || !$server instanceof WebsocketServer) {
160 160
             return;
161 161
         }
162 162
 
@@ -186,7 +186,7 @@  discard block
 block discarded – undo
186 186
      */
187 187
     protected function isWebsocketPushPacket($packet)
188 188
     {
189
-        if (! is_array($packet)) {
189
+        if (!is_array($packet)) {
190 190
             return false;
191 191
         }
192 192
 
@@ -241,7 +241,7 @@  discard block
 block discarded – undo
241 241
         $config = $this->container->make('config');
242 242
         $parser = $config->get('swoole_websocket.parser');
243 243
 
244
-        if (! $this->isServerWebsocket = $config->get('swoole_http.websocket.enabled')) {
244
+        if (!$this->isServerWebsocket = $config->get('swoole_http.websocket.enabled')) {
245 245
             return;
246 246
         }
247 247
 
@@ -279,7 +279,7 @@  discard block
 block discarded – undo
279 279
     {
280 280
         $handlerClass = $this->container->make('config')->get('swoole_websocket.handler');
281 281
 
282
-        if (! $handlerClass) {
282
+        if (!$handlerClass) {
283 283
             throw new WebsocketNotSetInConfigException;
284 284
         }
285 285
 
@@ -340,7 +340,7 @@  discard block
 block discarded – undo
340 340
      */
341 341
     protected function bindRoom(): void
342 342
     {
343
-        $this->app->singleton(RoomContract::class, function () {
343
+        $this->app->singleton(RoomContract::class, function() {
344 344
             return $this->websocketRoom;
345 345
         });
346 346
 
@@ -352,7 +352,7 @@  discard block
 block discarded – undo
352 352
      */
353 353
     protected function bindWebsocket()
354 354
     {
355
-        $this->app->singleton(Websocket::class, function (Container $app) {
355
+        $this->app->singleton(Websocket::class, function(Container $app) {
356 356
             return new Websocket($app->make(RoomContract::class), new Pipeline($app));
357 357
         });
358 358
 
@@ -367,7 +367,7 @@  discard block
 block discarded – undo
367 367
         $routePath = $this->container->make('config')
368 368
             ->get('swoole_websocket.route_file');
369 369
 
370
-        if (! file_exists($routePath)) {
370
+        if (!file_exists($routePath)) {
371 371
             $routePath = __DIR__ . '/../../routes/websocket.php';
372 372
         }
373 373
 
@@ -383,7 +383,7 @@  discard block
 block discarded – undo
383 383
      */
384 384
     public function isWebsocketPushPayload($payload): bool
385 385
     {
386
-        if (! is_array($payload)) {
386
+        if (!is_array($payload)) {
387 387
             return false;
388 388
         }
389 389
 
Please login to merge, or discard this patch.