Conditions | 3 |
Paths | 3 |
Total Lines | 16 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 12 |
Changes | 0 |
1 | <?php |
||
69 | private function renderClasses() |
||
70 | { |
||
71 | $classes = $this->getClasses(); |
||
72 | $strClass = ''; |
||
|
|||
73 | |||
74 | for ($i = 0; $i < count($classes); ++$i) { |
||
75 | $class = $classes[$i]; |
||
76 | |||
77 | if (preg_match('/\s|,|;/', $class)) { |
||
78 | $class = sprintf("'%s'", $class); |
||
79 | } |
||
80 | $classes[$i] = $class; |
||
81 | } |
||
82 | |||
83 | return implode(',', $classes); |
||
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
$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.