1 | <?php |
||
14 | class Connection extends ClientConnection |
||
15 | { |
||
16 | /** |
||
17 | * @var integer Packet sequence |
||
18 | */ |
||
19 | protected $seq = 0; |
||
20 | |||
21 | /** |
||
22 | * @var array @TODO DESCR |
||
23 | */ |
||
24 | protected static $unreachableCodes = [ |
||
25 | 0x0 => 'netUnreachable', |
||
26 | 0x1 => 'hostUnreachable', |
||
27 | 0x2 => 'protocolUnreachable', |
||
28 | 0x3 => 'portUnreachable', |
||
29 | 0x4 => 'fragmentationNeeded', |
||
30 | 0x5 => 'sourceRouteFailed', |
||
31 | ]; |
||
32 | |||
33 | /** |
||
34 | * @var boolean Enable bevConnect? |
||
35 | */ |
||
36 | protected $bevConnectEnabled = false; |
||
37 | |||
38 | /** |
||
39 | * Send echo-request |
||
40 | * @param callable $cb Callback |
||
41 | * @param string $data Data |
||
42 | * @callback $cb ( ) |
||
43 | * @return void |
||
44 | */ |
||
45 | public function sendEcho($cb, $data = 'phpdaemon') |
||
65 | |||
66 | /** |
||
67 | * Build checksum |
||
68 | * @param string $data Source |
||
69 | * @return string Checksum |
||
70 | */ |
||
71 | protected static function checksum($data) |
||
83 | |||
84 | /** |
||
85 | * Called when new data received |
||
86 | * @return void |
||
87 | */ |
||
88 | public function onRead() |
||
114 | } |
||
115 |
This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.
Both the
$myVar
assignment in line 1 and the$higher
assignment in line 2 are dead. The first because$myVar
is never used and the second because$higher
is always overwritten for every possible time line.