Total Complexity | 6 |
Total Lines | 27 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
9 | abstract class AbstractFilter |
||
10 | { |
||
11 | 5 | public function __construct(array $args = []) |
|
12 | { |
||
13 | 5 | $this->setAttributes($args); |
|
14 | } |
||
15 | |||
16 | 5 | protected function setAttributes(array $attributes): void |
|
17 | { |
||
18 | 5 | foreach (get_class_vars(static::class) as $key => $value) { |
|
19 | 2 | if (isset($attributes[$key])) { |
|
20 | 2 | $this->$key = $attributes[$key]; |
|
21 | } |
||
22 | } |
||
23 | } |
||
24 | |||
25 | 1 | public static function isApplicable(... $args): bool |
|
|
|||
26 | { |
||
27 | 1 | return true; |
|
28 | } |
||
29 | |||
30 | /** |
||
31 | * @throws NoApplyFilterRuleException |
||
32 | */ |
||
33 | 1 | public function apply(Builder $queryBuilder): void |
|
36 | } |
||
37 | } |
||
38 |
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.