1 | <?php |
||
4 | class FilterScope implements FilterInterface |
||
5 | { |
||
6 | /** |
||
7 | * @var Model |
||
8 | */ |
||
9 | protected $model; |
||
10 | |||
11 | /** |
||
12 | * Construct |
||
13 | * |
||
14 | * @param Model $model |
||
15 | */ |
||
16 | 14 | public function __construct($model) |
|
20 | |||
21 | /** |
||
22 | * Filter |
||
23 | * |
||
24 | * @param Query\Builder $query |
||
25 | * @param int|string $key |
||
26 | * @param mixed $value |
||
27 | * |
||
28 | * @return boolean |
||
29 | */ |
||
30 | 14 | public function filter($query, $key, $value) |
|
41 | } |
||
42 |
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.