Passed
Push — master ( eb9c5f...4cd870 )
by Mohammad
04:38
created
src/Receiver.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -228,8 +228,7 @@
 block discarded – undo
228 228
 
229 229
             $this->clients[$from->resourceId]->id = \Auth::id();
230 230
             $this->userAuthSocketMapper[\Auth::id()] = $from->resourceId;
231
-        }
232
-        else
231
+        } else
233 232
         {
234 233
             $this->error($msg, $from, 'Unauthenticated.');
235 234
         }
Please login to merge, or discard this patch.
src/Traits/WebSocketMessagesManager.php 1 patch
Braces   +6 added lines, -4 removed lines patch added patch discarded remove patch
@@ -49,16 +49,18 @@
 block discarded – undo
49 49
      */
50 50
     function sendToWebSocketUser(ConnectionInterface $conn,$data)
51 51
     {
52
-        if(!is_array($data))
53
-            $data = ['msg'=>$data,'event'=>'default'];
52
+        if(!is_array($data)) {
53
+                    $data = ['msg'=>$data,'event'=>'default'];
54
+        }
54 55
 
55 56
         if(!isset($data['event']))
56 57
         {
57 58
             $data['event'] = 'default';
58 59
         }
59 60
 
60
-        if(isset($this->route) && !array_key_exists('sender',$data))
61
-            $data['sender'] = $this->getSenderData();
61
+        if(isset($this->route) && !array_key_exists('sender',$data)) {
62
+                    $data['sender'] = $this->getSenderData();
63
+        }
62 64
 
63 65
         $conn->send(json_encode($data));
64 66
     }
Please login to merge, or discard this patch.