1 | <?php |
||
8 | class Condition |
||
9 | { |
||
10 | |||
11 | protected $_string; |
||
12 | protected $_values; |
||
13 | protected $_query; |
||
14 | |||
15 | 13 | public function __construct($string, $values = array()) |
|
20 | |||
21 | 6 | public function __toString() |
|
25 | |||
26 | 12 | public function getString() |
|
30 | |||
31 | /** |
||
32 | * Parses $string and replaces all instances of "?" with corresponding $values |
||
33 | * |
||
34 | * @param string $string |
||
35 | * @param array $values |
||
36 | * @return string |
||
37 | */ |
||
38 | 12 | public function parseString($string, $values) |
|
77 | |||
78 | 1 | protected function parseValueQuery($value) |
|
82 | |||
83 | /** |
||
84 | * @return Query |
||
85 | */ |
||
86 | 2 | public function getQuery() |
|
90 | |||
91 | /** |
||
92 | * @param Query $query |
||
93 | * @return $this |
||
94 | */ |
||
95 | 13 | public function setQuery($query) |
|
101 | |||
102 | 5 | public function and_($condition) |
|
106 | |||
107 | 4 | public function or_($condition) |
|
111 | |||
112 | 7 | public function protectCondition($condition) |
|
116 | |||
117 | } |
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.