@@ -44,8 +44,9 @@ |
||
44 | 44 | |
45 | 45 | function hasMember($client) |
46 | 46 | { |
47 | - if(array_key_exists($client->id,$this->members)) |
|
48 | - return true; |
|
47 | + if(array_key_exists($client->id,$this->members)) { |
|
48 | + return true; |
|
49 | + } |
|
49 | 50 | |
50 | 51 | return false; |
51 | 52 | } |
@@ -49,16 +49,18 @@ |
||
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) && $this->route->auth && !array_key_exists('sender',$data)) |
|
61 | - $data['sender'] = $this->getSenderData(); |
|
61 | + if(isset($this->route) && $this->route->auth && !array_key_exists('sender',$data)) { |
|
62 | + $data['sender'] = $this->getSenderData(); |
|
63 | + } |
|
62 | 64 | |
63 | 65 | $conn->send(json_encode($data)); |
64 | 66 | } |