1 | <?php |
||
29 | class Websocket |
||
30 | { |
||
31 | /** |
||
32 | * @var resource Socket of the server |
||
33 | */ |
||
34 | private $socket; |
||
|
|||
35 | |||
36 | /** |
||
37 | * @var int Store the port for debug purpose. |
||
38 | */ |
||
39 | private $port; |
||
40 | |||
41 | /** |
||
42 | * @var string |
||
43 | */ |
||
44 | private $address; |
||
45 | |||
46 | /** |
||
47 | * @var Request |
||
48 | */ |
||
49 | private $request; |
||
50 | |||
51 | /** |
||
52 | * @var ServerHandshake |
||
53 | */ |
||
54 | private $handshake; |
||
55 | |||
56 | /** |
||
57 | * @var MessageHandlerInterface |
||
58 | */ |
||
59 | private $messageHandler; |
||
60 | |||
61 | /** |
||
62 | * tmp var for test purpose |
||
63 | * @var Message |
||
64 | */ |
||
65 | private $message; |
||
66 | |||
67 | /** |
||
68 | * @var array |
||
69 | */ |
||
70 | private $connections; |
||
71 | |||
72 | /** |
||
73 | * @var LoopInterface |
||
74 | */ |
||
75 | private $loop; |
||
76 | |||
77 | /** |
||
78 | * @var MessageProcessor |
||
79 | */ |
||
80 | private $messageProcessor; |
||
81 | |||
82 | /** |
||
83 | * @var array |
||
84 | */ |
||
85 | private $config; |
||
86 | |||
87 | /** |
||
88 | * Websocket constructor. |
||
89 | * |
||
90 | * @param int $port The number of the port to bind |
||
91 | * @param string $address The address to listen on (by default 127.0.0.1) |
||
92 | * @param array $config |
||
93 | */ |
||
94 | public function __construct($port, $address = '127.0.0.1', $config = []) |
||
103 | |||
104 | public function setMessageHandler($messageHandler) |
||
121 | |||
122 | public function start() |
||
135 | |||
136 | /** |
||
137 | * @param ConnectionInterface $socketStream |
||
138 | */ |
||
139 | private function onNewConnection(ConnectionInterface $socketStream) |
||
148 | |||
149 | /** |
||
150 | * Build the message processor with configuration |
||
151 | */ |
||
152 | private function buildMessageProcessor() |
||
169 | |||
170 | /** |
||
171 | * Sets the configuration |
||
172 | * |
||
173 | * @param array $config |
||
174 | */ |
||
175 | private function setConfig(array $config) |
||
183 | } |
||
184 |
This check marks private properties in classes that are never used. Those properties can be removed.