| 1 | <?php |
||
| 19 | trait WebSocketMessagesManager |
||
| 20 | { |
||
| 21 | /** |
||
| 22 | * @param $msg |
||
| 23 | * @param $from |
||
| 24 | * @param $error |
||
| 25 | * @throws WebSocketException |
||
| 26 | */ |
||
| 27 | function error($msg,ConnectionInterface $from, $error) |
||
| 39 | |||
| 40 | /** |
||
| 41 | * @param ConnectionInterface $conn |
||
| 42 | * @param $data |
||
| 43 | */ |
||
| 44 | function sendToWebSocketUser(ConnectionInterface $conn,$data) |
||
| 48 | |||
| 49 | /** |
||
| 50 | * @param int $user_id |
||
| 51 | * @param array $data |
||
| 52 | */ |
||
| 53 | function sendToUser($user_id,$data) |
||
| 60 | |||
| 61 | /** |
||
| 62 | * @param $data |
||
| 63 | */ |
||
| 64 | function sendBack($data) |
||
| 68 | |||
| 69 | } |
Adding explicit visibility (
private,protected, orpublic) is generally recommend to communicate to other developers how, and from where this method is intended to be used.