@@ -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) && !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 | } |
@@ -14,8 +14,9 @@ |
||
14 | 14 | |
15 | 15 | public function __get($property) |
16 | 16 | { |
17 | - if($this->has($property)) |
|
18 | - return $this->get($property); |
|
17 | + if($this->has($property)) { |
|
18 | + return $this->get($property); |
|
19 | + } |
|
19 | 20 | |
20 | 21 | return Parent::get($property); |
21 | 22 | } |
@@ -242,8 +242,7 @@ |
||
242 | 242 | $this->clients[$from->resourceId]->id = \Auth::id(); |
243 | 243 | $this->clients[$from->resourceId]->session = $msg['session']; |
244 | 244 | $this->userAuthSocketMapper[\Auth::id()] = $from->resourceId; |
245 | - } |
|
246 | - else |
|
245 | + } else |
|
247 | 246 | { |
248 | 247 | $this->error($msg, $from, 'Unauthenticated.'); |
249 | 248 | } |
@@ -50,8 +50,9 @@ |
||
50 | 50 | public function validate($request, array $rules, |
51 | 51 | array $messages = [], array $customAttributes = []) |
52 | 52 | { |
53 | - if($request instanceof Collection) |
|
54 | - $request = $request->toArray(); |
|
53 | + if($request instanceof Collection) { |
|
54 | + $request = $request->toArray(); |
|
55 | + } |
|
55 | 56 | |
56 | 57 | return $this->getValidationFactory()->make( |
57 | 58 | (array) $request, $rules, $messages, $customAttributes |