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 string $id |
||
76 | * @return bool |
||
77 | */ |
||
78 | public function setConnection($id) |
||
93 | |||
94 | /** |
||
95 | * @param string $id |
||
96 | * @return bool |
||
97 | */ |
||
98 | public function removeConnection($id) |
||
108 | |||
109 | /** |
||
110 | * @param string $id |
||
111 | * @return mixed[] |
||
112 | */ |
||
113 | public function getConnection($id) |
||
117 | |||
118 | /** |
||
119 | * @param string $id |
||
120 | * @return bool |
||
121 | */ |
||
122 | public function existsConnection($id) |
||
126 | |||
127 | /** |
||
128 | * @param string $id |
||
129 | * @return bool |
||
130 | */ |
||
131 | public function validateConnection($id) |
||
140 | |||
141 | /** |
||
142 | * @return string[] |
||
143 | */ |
||
144 | public function removeInvalid() |
||
164 | |||
165 | /** |
||
166 | * @param string $id |
||
167 | * @param string $property |
||
168 | * @param mixed $value |
||
169 | */ |
||
170 | public function setConnectionProperty($id, $property, $value) |
||
179 | |||
180 | /** |
||
181 | * @param string $id |
||
182 | * @return bool |
||
183 | */ |
||
184 | public function isHeartbeatNeeded($id) |
||
193 | |||
194 | /** |
||
195 | * @param $id |
||
196 | * @return bool |
||
197 | */ |
||
198 | public function registerHeartbeat($id) |
||
209 | |||
210 | /** |
||
211 | * @return float |
||
212 | */ |
||
213 | public function getNow() |
||
218 | |||
219 | /** |
||
220 | * @param callable $callback |
||
221 | */ |
||
222 | public function setNow(callable $callback) |
||
226 | |||
227 | /** |
||
228 | * |
||
229 | */ |
||
230 | public function resetNow() |
||
236 | |||
237 | /** |
||
238 | * @param array $current |
||
239 | * @return mixed[] |
||
240 | */ |
||
241 | protected function register($current = []) |
||
248 | |||
249 | /** |
||
250 | * @param mixed[] $const |
||
251 | * @param mixed[] $data |
||
252 | * @return bool |
||
253 | */ |
||
254 | protected function validateIn($const, $data) |
||
258 | |||
259 | /** |
||
260 | * @param mixed[] $const |
||
261 | * @param mixed[] $data |
||
262 | * @return bool |
||
263 | */ |
||
264 | protected function validateOut($const, $data) |
||
268 | |||
269 | /** |
||
270 | * @return mixed[] |
||
|
|||
271 | */ |
||
272 | protected function generateConst() |
||
281 | } |
||
282 |
This check compares the return type specified in the
@return
annotation of a function or method doc comment with the types returned by the function and raises an issue if they mismatch.