| Conditions | 3 |
| Paths | 6 |
| Total Lines | 16 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 10 |
| CRAP Score | 3 |
| Changes | 4 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 69 | public function __get($variable) |
||
| 70 | { |
||
| 71 | return $this->$variable; |
||
| 72 | } |
||
| 73 | |||
| 74 | /** |
||
| 75 | * Prevent the instance from being cloned |
||
| 76 | * @return void |
||
| 77 | */ |
||
| 78 | private function __clone() {} |
||
| 79 | |||
| 80 | public function __toString() |
||
| 81 | { |
||
| 82 | $size = round(strlen(print_r($this, true)) / 1024, 4); |
||
| 83 | return get_class($this) . " " . $size . " Kbytes"; |
||
| 84 | } |
||
| 85 | } |
||
| 86 |
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.