1 | <?php |
||
8 | class ConnectionPool |
||
9 | { |
||
10 | /** |
||
11 | * @var callable |
||
12 | */ |
||
13 | protected $now; |
||
14 | |||
15 | /** |
||
16 | * @var mixed[] |
||
17 | */ |
||
18 | protected $connectionPool; |
||
19 | |||
20 | /** |
||
21 | * @var float |
||
22 | */ |
||
23 | protected $keepaliveOffset; |
||
24 | |||
25 | /** |
||
26 | * @var float |
||
27 | */ |
||
28 | protected $heartbeatOffset; |
||
29 | |||
30 | /** |
||
31 | * @param float $offset |
||
32 | */ |
||
33 | public function __construct($offset = 3600000.0, $heartbeat = 200.0) |
||
40 | |||
41 | /** |
||
42 | * |
||
43 | */ |
||
44 | public function __destruct() |
||
49 | |||
50 | /** |
||
51 | * |
||
52 | */ |
||
53 | public function erase() |
||
57 | |||
58 | /** |
||
59 | * @return string[] |
||
60 | */ |
||
61 | public function getConnected() |
||
73 | |||
74 | /** |
||
75 | * @param Connection $conn |
||
76 | * @return bool |
||
77 | */ |
||
78 | public function setConnection(Connection $conn) |
||
93 | |||
94 | /** |
||
95 | * @param string $id |
||
96 | * @return bool |
||
97 | */ |
||
98 | public function removeConnection($id) |
||
108 | |||
109 | /** |
||
110 | * @param string $id |
||
111 | * @return Connection |
||
112 | */ |
||
113 | public function getConnection($id) |
||
117 | |||
118 | /** |
||
119 | * @param string $id |
||
120 | * @return mixed[] |
||
121 | */ |
||
122 | public function getData($id) |
||
126 | |||
127 | /** |
||
128 | * @param string $id |
||
129 | * @return bool |
||
130 | */ |
||
131 | public function existsConnection($id) |
||
135 | |||
136 | /** |
||
137 | * @param string $id |
||
138 | * @return bool |
||
139 | */ |
||
140 | public function validateConnection($id) |
||
149 | |||
150 | /** |
||
151 | * @return string[] |
||
152 | */ |
||
153 | public function removeInvalid() |
||
173 | |||
174 | /** |
||
175 | * @param string $id |
||
176 | * @param string $property |
||
177 | * @param mixed $value |
||
178 | */ |
||
179 | public function setConnectionProperty($id, $property, $value) |
||
188 | |||
189 | /** |
||
190 | * @param string $id |
||
191 | * @return bool |
||
192 | */ |
||
193 | public function isHeartbeatNeeded($id) |
||
202 | |||
203 | /** |
||
204 | * @param $id |
||
205 | * @return bool |
||
206 | */ |
||
207 | public function registerHeartbeat($id) |
||
218 | |||
219 | /** |
||
220 | * @return float |
||
221 | */ |
||
222 | public function getNow() |
||
227 | |||
228 | /** |
||
229 | * @param callable $callback |
||
230 | */ |
||
231 | public function setNow(callable $callback) |
||
235 | |||
236 | /** |
||
237 | * |
||
238 | */ |
||
239 | public function resetNow() |
||
245 | |||
246 | /** |
||
247 | * @param array $current |
||
248 | * @return mixed[] |
||
249 | */ |
||
250 | protected function register(Connection $conn, $current = []) |
||
258 | |||
259 | /** |
||
260 | * @param mixed[] $const |
||
261 | * @param mixed[] $data |
||
262 | * @return bool |
||
263 | */ |
||
264 | protected function validateIn($const, $data) |
||
268 | |||
269 | /** |
||
270 | * @param mixed[] $const |
||
271 | * @param mixed[] $data |
||
272 | * @return bool |
||
273 | */ |
||
274 | protected function validateOut($const, $data) |
||
278 | |||
279 | /** |
||
280 | * @return mixed[] |
||
281 | */ |
||
282 | protected function generateValidationConst() |
||
291 | } |
||
292 |
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: