@@ -38,9 +38,9 @@ discard block |
||
| 38 | 38 | |
| 39 | 39 | public function onMessage(ConnectionInterface $from, $msg) { |
| 40 | 40 | $sessionId = $from->WebSocket->request->getCookies()['PHPSESSID']; |
| 41 | - if($msg == 'OpenChat initiated..!') |
|
| 41 | + if ($msg == 'OpenChat initiated..!') |
|
| 42 | 42 | { |
| 43 | - $initial = (object) array(); |
|
| 43 | + $initial = (object)array(); |
|
| 44 | 44 | $initial->initial = json_decode($this->onSidebar($from->userId)); |
| 45 | 45 | |
| 46 | 46 | $initial->conversation = json_decode( |
@@ -56,13 +56,13 @@ discard block |
||
| 56 | 56 | } |
| 57 | 57 | elseif ($msg == 'Load Sidebar') |
| 58 | 58 | { |
| 59 | - $sidebar = (object) array(); |
|
| 59 | + $sidebar = (object)array(); |
|
| 60 | 60 | $sidebar->sidebar = json_decode($this->onSidebar($from->userId)); |
| 61 | 61 | $from->send(json_encode($sidebar)); |
| 62 | 62 | } |
| 63 | 63 | elseif (@json_decode($msg)->newConversation == 'Initiated') |
| 64 | 64 | { |
| 65 | - $result = (object) array(); |
|
| 65 | + $result = (object)array(); |
|
| 66 | 66 | $result->conversation = json_decode($this->onConversation($msg, False, $sessionId)); |
| 67 | 67 | $from->send(json_encode($result)); |
| 68 | 68 | } |
@@ -102,7 +102,7 @@ discard block |
||
| 102 | 102 | $client->send(json_encode($receiveResult)); |
| 103 | 103 | $this->online = 1; |
| 104 | 104 | } |
| 105 | - elseif($client == $from) |
|
| 105 | + elseif ($client == $from) |
|
| 106 | 106 | { |
| 107 | 107 | $sentResult->sidebar = json_decode($this->onSidebar($client->userId)); |
| 108 | 108 | |