| 1 | <?php |
||
| 24 | class WebSocketController |
||
| 25 | { |
||
| 26 | use WebSocketMessagesManager,Validation; |
||
| 27 | |||
| 28 | /** |
||
| 29 | * @var Client[] |
||
| 30 | */ |
||
| 31 | public $clients; |
||
| 32 | |||
| 33 | /** |
||
| 34 | * Auth to resourceId mapper |
||
| 35 | * @var array |
||
| 36 | */ |
||
| 37 | public $userAuthSocketMapper; |
||
| 38 | |||
| 39 | /** |
||
| 40 | * Ratchet ConnectionInterface |
||
| 41 | * @var ConnectionInterface |
||
| 42 | */ |
||
| 43 | public $conn; |
||
| 44 | |||
| 45 | /** |
||
| 46 | * The main receiver of websocket event, here we can change property for all connection. |
||
| 47 | * @var Receiver |
||
| 48 | */ |
||
| 49 | public $receiver; |
||
| 50 | |||
| 51 | /** |
||
| 52 | * The rooms array |
||
| 53 | * @var Room[] |
||
| 54 | */ |
||
| 55 | public $rooms; |
||
| 56 | |||
| 57 | /** |
||
| 58 | * @var Collection |
||
| 59 | */ |
||
| 60 | public $request; |
||
| 61 | |||
| 62 | /** |
||
| 63 | * @var array |
||
| 64 | */ |
||
| 65 | public $route; |
||
| 66 | |||
| 67 | public function __construct() |
||
| 71 | |||
| 72 | /** |
||
| 73 | * @desc return the client class |
||
| 74 | * @return Client |
||
| 75 | */ |
||
| 76 | function getClient() |
||
| 80 | } |
||
| 81 |
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.