1 | <?php |
||
5 | class FilterSearch implements FilterInterface |
||
6 | { |
||
7 | /** |
||
8 | * @var string |
||
9 | */ |
||
10 | protected $nameSearchable; |
||
11 | |||
12 | /** |
||
13 | * @var array |
||
14 | */ |
||
15 | protected $searchables; |
||
16 | |||
17 | /** |
||
18 | * @var string |
||
19 | */ |
||
20 | protected $table = ''; |
||
21 | |||
22 | /** |
||
23 | * Construct |
||
24 | * |
||
25 | * @param string $nameSearchable |
||
26 | * @param array $searchables |
||
27 | * @param string $table |
||
28 | */ |
||
29 | 16 | public function __construct($nameSearchable, $searchables, $table = '') |
|
35 | |||
36 | /** |
||
37 | * Filter |
||
38 | * |
||
39 | * @param Query\Builder $query |
||
40 | * @param int|string $key |
||
41 | * @param mixed $value |
||
42 | * |
||
43 | * @return boolean |
||
44 | */ |
||
45 | 15 | public function filter($query, $key, $value) |
|
74 | } |
||
75 |
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.