1 | <?php |
||
27 | class Connection |
||
28 | { |
||
29 | /** |
||
30 | * 5 seconds |
||
31 | */ |
||
32 | const DEFAULT_TIMEOUT = 5; |
||
33 | |||
34 | /** |
||
35 | * @var ConnectionInterface |
||
36 | */ |
||
37 | private $socketStream; |
||
38 | |||
39 | /** |
||
40 | * @var MessageHandlerInterface |
||
41 | */ |
||
42 | private $handler; |
||
43 | |||
44 | /** |
||
45 | * @var bool |
||
46 | */ |
||
47 | private $handshakeDone; |
||
48 | |||
49 | /** |
||
50 | * @var ServerHandshake |
||
51 | */ |
||
52 | private $handshake; |
||
53 | |||
54 | /** |
||
55 | * @var Message |
||
56 | */ |
||
57 | private $currentMessage; |
||
58 | |||
59 | /** |
||
60 | * @var MessageProcessor |
||
61 | */ |
||
62 | private $messageProcessor; |
||
63 | |||
64 | /** |
||
65 | * @var LoopInterface |
||
66 | */ |
||
67 | private $loop; |
||
68 | |||
69 | /** |
||
70 | * @var TimerInterface |
||
71 | */ |
||
72 | private $timeout; |
||
73 | |||
74 | public function __construct(ConnectionInterface $socketStream, MessageHandlerInterface $messageHandler, LoopInterface $loop, MessageProcessor $messageProcessor, ServerHandshake $handshake = null) |
||
83 | |||
84 | private function initListeners() |
||
91 | |||
92 | private function processData($data) |
||
107 | |||
108 | /** |
||
109 | * This method build a message and buffer data in case of incomplete data. |
||
110 | * |
||
111 | * @param string $data |
||
112 | */ |
||
113 | protected function processMessage($data) |
||
144 | |||
145 | /** |
||
146 | * @param string|Frame $frame |
||
147 | * @param int $opCode An int representing binary or text data (const of Frame class) |
||
148 | * @throws \Nekland\Woketo\Exception\RuntimeException |
||
149 | */ |
||
150 | public function write($frame, int $opCode = Frame::OP_TEXT) |
||
158 | |||
159 | /** |
||
160 | * @param $data |
||
161 | */ |
||
162 | public function error($data) |
||
166 | |||
167 | /** |
||
168 | * If it's a new client, we need to make some special actions named the handshake. |
||
169 | * |
||
170 | * @param string $data |
||
171 | */ |
||
172 | protected function processHandcheck($data) |
||
187 | } |
||
188 |
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: