@@ -22,7 +22,7 @@ |
||
| 22 | 22 | /** |
| 23 | 23 | * @param $request |
| 24 | 24 | * @param ConnectionInterface $from |
| 25 | - * @param $error |
|
| 25 | + * @param string $error |
|
| 26 | 26 | * @throws WebSocketException |
| 27 | 27 | */ |
| 28 | 28 | function error($request,ConnectionInterface $from, $error) |
@@ -46,11 +46,13 @@ |
||
| 46 | 46 | */ |
| 47 | 47 | function sendToWebSocketUser(ConnectionInterface $conn,$data) |
| 48 | 48 | { |
| 49 | - if(!is_array($data)) |
|
| 50 | - $data = ['msg'=>$data]; |
|
| 49 | + if(!is_array($data)) { |
|
| 50 | + $data = ['msg'=>$data]; |
|
| 51 | + } |
|
| 51 | 52 | |
| 52 | - if(isset($this->route) && $this->route->auth && !array_key_exists('sender',$data)) |
|
| 53 | - $data['sender'] = $this->getSenderData(); |
|
| 53 | + if(isset($this->route) && $this->route->auth && !array_key_exists('sender',$data)) { |
|
| 54 | + $data['sender'] = $this->getSenderData(); |
|
| 55 | + } |
|
| 54 | 56 | |
| 55 | 57 | $conn->send(json_encode($data)); |
| 56 | 58 | } |
@@ -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 | } |
@@ -140,7 +140,7 @@ discard block |
||
| 140 | 140 | |
| 141 | 141 | /** |
| 142 | 142 | * @param $msg |
| 143 | - * @param $from |
|
| 143 | + * @param ConnectionInterface $from |
|
| 144 | 144 | * @throws WebSocketException |
| 145 | 145 | */ |
| 146 | 146 | function checkForRequiredInMessage($msg, $from) |
@@ -155,7 +155,7 @@ discard block |
||
| 155 | 155 | } |
| 156 | 156 | |
| 157 | 157 | /** |
| 158 | - * @param $clonedObject |
|
| 158 | + * @param Receiver $clonedObject |
|
| 159 | 159 | * @param $clone |
| 160 | 160 | */ |
| 161 | 161 | function cloneProperties($clonedObject, $clone) |