Conditions | 7 |
Paths | 4 |
Total Lines | 15 |
Code Lines | 11 |
Lines | 9 |
Ratio | 60 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
17 | public function write($buf, int $off = null, int $len = null) |
||
18 | { |
||
19 | $data = null; |
||
|
|||
20 | View Code Duplication | if ($off === null && $len === null) { |
|
21 | $data = $buf; |
||
22 | } elseif ($off !== null && $len === null) { |
||
23 | $data = substr($buf, $off); |
||
24 | } elseif ($off === null && $len !== null) { |
||
25 | $data = substr($buf, 0, $len); |
||
26 | } else { |
||
27 | $data = substr($buf, $off, $len); |
||
28 | } |
||
29 | |||
30 | $this->stream .= $data; |
||
31 | } |
||
32 | |||
43 |
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.