| 1 | <?php |
||
| 11 | class ZmqBuffer extends BaseEventEmitter |
||
| 12 | { |
||
| 13 | /** |
||
| 14 | * @var RawZMQSocket |
||
| 15 | */ |
||
| 16 | public $socket; |
||
| 17 | |||
| 18 | /** |
||
| 19 | * @var bool |
||
| 20 | */ |
||
| 21 | public $closed = false; |
||
| 22 | |||
| 23 | /** |
||
| 24 | * @var bool |
||
| 25 | */ |
||
| 26 | public $listening = false; |
||
| 27 | |||
| 28 | /** |
||
| 29 | * @var LoopInterface |
||
| 30 | */ |
||
| 31 | private $loop; |
||
| 32 | |||
| 33 | /** |
||
| 34 | * @var resource |
||
| 35 | */ |
||
| 36 | private $fd; |
||
| 37 | |||
| 38 | /** |
||
| 39 | * @var callable |
||
| 40 | */ |
||
| 41 | private $writeListener; |
||
| 42 | |||
| 43 | /** |
||
| 44 | * @var string[] |
||
| 45 | */ |
||
| 46 | private $messages = []; |
||
| 47 | |||
| 48 | /** |
||
| 49 | * @param RawZMQSocket $socket |
||
| 50 | * @param resource $fd |
||
| 51 | * @param LoopInterface $loop |
||
| 52 | * @param $writeListener |
||
| 53 | */ |
||
| 54 | public function __construct(RawZMQSocket $socket, $fd, LoopInterface $loop, $writeListener) |
||
| 61 | |||
| 62 | /** |
||
| 63 | * Send message. |
||
| 64 | * |
||
| 65 | * @param string $message |
||
| 66 | * @return bool |
||
| 67 | */ |
||
| 68 | public function send($message) |
||
| 85 | |||
| 86 | /** |
||
| 87 | * Close buffer. |
||
| 88 | */ |
||
| 89 | public function end() |
||
| 98 | |||
| 99 | /** |
||
| 100 | * Handle ZMQ Write Event. |
||
| 101 | */ |
||
| 102 | public function handleWriteEvent() |
||
| 124 | } |
||
| 125 |
This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.
Both the
$myVarassignment in line 1 and the$higherassignment in line 2 are dead. The first because$myVaris never used and the second because$higheris always overwritten for every possible time line.