1 | <?php |
||
28 | class Connection |
||
29 | { |
||
30 | use LoggerAwareTrait; |
||
31 | |||
32 | /** |
||
33 | * 5 seconds |
||
34 | */ |
||
35 | const DEFAULT_TIMEOUT = 5; |
||
36 | |||
37 | /** |
||
38 | * @var ConnectionInterface |
||
39 | */ |
||
40 | private $socketStream; |
||
41 | |||
42 | /** |
||
43 | * @var MessageHandlerInterface |
||
44 | */ |
||
45 | private $handler; |
||
46 | |||
47 | /** |
||
48 | * @var bool |
||
49 | */ |
||
50 | private $handshakeDone; |
||
51 | |||
52 | /** |
||
53 | * @var ServerHandshake |
||
54 | */ |
||
55 | private $handshake; |
||
56 | |||
57 | /** |
||
58 | * @var Message |
||
59 | */ |
||
60 | private $currentMessage; |
||
61 | |||
62 | /** |
||
63 | * @var MessageProcessor |
||
64 | */ |
||
65 | private $messageProcessor; |
||
66 | |||
67 | /** |
||
68 | * @var LoopInterface |
||
69 | */ |
||
70 | private $loop; |
||
71 | |||
72 | /** |
||
73 | * @var TimerInterface |
||
74 | */ |
||
75 | private $timeout; |
||
76 | |||
77 | 2 | public function __construct( |
|
91 | |||
92 | 2 | private function initListeners() |
|
101 | |||
102 | 2 | private function processData($data) |
|
118 | |||
119 | /** |
||
120 | * This method build a message and buffer data in case of incomplete data. |
||
121 | * |
||
122 | * @param string $data |
||
123 | */ |
||
124 | 2 | protected function processMessage($data) |
|
155 | |||
156 | /** |
||
157 | * @param string|Frame $frame |
||
158 | * @param int $opCode An int representing binary or text data (const of Frame class) |
||
159 | * @throws \Nekland\Woketo\Exception\RuntimeException |
||
160 | */ |
||
161 | public function write($frame, int $opCode = Frame::OP_TEXT) |
||
169 | |||
170 | /** |
||
171 | * @param mixed $data |
||
172 | */ |
||
173 | protected function error($data) |
||
179 | |||
180 | /** |
||
181 | * If it's a new client, we need to make some special actions named the handshake. |
||
182 | * |
||
183 | * @param string $data |
||
184 | */ |
||
185 | 2 | protected function processHandcheck($data) |
|
200 | |||
201 | /** |
||
202 | * @return string |
||
203 | */ |
||
204 | public function getIp() |
||
208 | |||
209 | /** |
||
210 | * @return \Psr\Log\LoggerInterface |
||
211 | */ |
||
212 | public function getLogger() |
||
216 | } |
||
217 |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: