@@ -38,12 +38,12 @@ 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 | - if($initial->initial != null) { |
|
| 46 | + if ($initial->initial != null) { |
|
| 47 | 47 | $initial->conversation = json_decode( |
| 48 | 48 | $this->onConversation( |
| 49 | 49 | json_encode([ |
@@ -58,13 +58,13 @@ discard block |
||
| 58 | 58 | } |
| 59 | 59 | elseif ($msg == 'Load Sidebar') |
| 60 | 60 | { |
| 61 | - $sidebar = (object) array(); |
|
| 61 | + $sidebar = (object)array(); |
|
| 62 | 62 | $sidebar->sidebar = json_decode($this->onSidebar($from->userId)); |
| 63 | 63 | $from->send(json_encode($sidebar)); |
| 64 | 64 | } |
| 65 | 65 | elseif (@json_decode($msg)->newConversation == 'Initiated') |
| 66 | 66 | { |
| 67 | - $result = (object) array(); |
|
| 67 | + $result = (object)array(); |
|
| 68 | 68 | $result->conversation = json_decode($this->onConversation($msg, False, $sessionId)); |
| 69 | 69 | $from->send(json_encode($result)); |
| 70 | 70 | } |
@@ -104,7 +104,7 @@ discard block |
||
| 104 | 104 | $client->send(json_encode($receiveResult)); |
| 105 | 105 | $this->online = 1; |
| 106 | 106 | } |
| 107 | - elseif($client == $from) |
|
| 107 | + elseif ($client == $from) |
|
| 108 | 108 | { |
| 109 | 109 | $sentResult->sidebar = json_decode($this->onSidebar($client->userId)); |
| 110 | 110 | |