1 | <?php |
||
14 | class Wire implements WireInterface, LoggerAwareInterface |
||
15 | { |
||
16 | const PROTOCOL_HEADER = "AMQP\x00\x00\x09\x01"; |
||
17 | const FRAME_ENDING = "\xCE"; |
||
18 | |||
19 | use LoggerAwareTrait; |
||
20 | |||
21 | /** |
||
22 | * @var IOInterface |
||
23 | */ |
||
24 | private $io; |
||
25 | |||
26 | /** |
||
27 | * @var WireSubscriberInterface[] |
||
28 | */ |
||
29 | private $subscribers = []; |
||
30 | |||
31 | /** |
||
32 | * @var HeartbeatInterface |
||
33 | */ |
||
34 | private $heartbeat; |
||
35 | |||
36 | /** |
||
37 | * @var int |
||
38 | */ |
||
39 | private $frameMax; |
||
40 | |||
41 | /** |
||
42 | * @param IOInterface $io |
||
43 | */ |
||
44 | 33 | public function __construct(IOInterface $io) |
|
50 | |||
51 | /** |
||
52 | * {@inheritdoc} |
||
53 | */ |
||
54 | 19 | public function open(Url $url) |
|
71 | |||
72 | /** |
||
73 | * {@inheritdoc} |
||
74 | */ |
||
75 | 28 | public function next($blocking = true) |
|
112 | |||
113 | /** |
||
114 | * {@inheritdoc} |
||
115 | */ |
||
116 | 22 | public function send(Frame $frame) |
|
131 | |||
132 | /** |
||
133 | * @param Frame $frame |
||
134 | * |
||
135 | * @return array |
||
136 | */ |
||
137 | 22 | private function chop(Frame $frame) |
|
154 | |||
155 | /** |
||
156 | * {@inheritdoc} |
||
157 | */ |
||
158 | 20 | public function wait($channel, $types) |
|
185 | |||
186 | /** |
||
187 | * {@inheritdoc} |
||
188 | */ |
||
189 | 19 | public function subscribe($channel, WireSubscriberInterface $handler) |
|
195 | |||
196 | /** |
||
197 | * {@inheritdoc} |
||
198 | */ |
||
199 | 8 | public function close() |
|
205 | |||
206 | /** |
||
207 | * @param HeartbeatInterface $heartbeat |
||
208 | * |
||
209 | * @return $this |
||
210 | */ |
||
211 | 20 | public function setHeartbeat(HeartbeatInterface $heartbeat) |
|
217 | |||
218 | /** |
||
219 | * @param int $frameMax |
||
220 | * |
||
221 | * @return $this |
||
222 | */ |
||
223 | 18 | public function setFrameMax($frameMax) |
|
229 | |||
230 | /** |
||
231 | * @param int $channel |
||
232 | * |
||
233 | * @return WireSubscriberInterface|null |
||
234 | */ |
||
235 | 23 | private function getSubscriber($channel) |
|
239 | |||
240 | /** |
||
241 | * @param Url $url |
||
242 | * |
||
243 | * @return string |
||
244 | */ |
||
245 | 19 | private function getProtocolForScheme(Url $url) |
|
249 | } |
||
250 |
Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.
The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.
This check looks for comments that seem to be mostly valid code and reports them.