Total Complexity | 5 |
Total Lines | 52 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
11 | abstract class BaseFilter |
||
12 | { |
||
13 | use Configurable; |
||
14 | |||
15 | /** |
||
16 | * @var string $name |
||
17 | */ |
||
18 | public $name; |
||
19 | |||
20 | /** |
||
21 | * @var string $value |
||
22 | */ |
||
23 | public $value; |
||
24 | |||
25 | /** |
||
26 | * BaseFilter constructor. |
||
27 | * @param $config |
||
28 | */ |
||
29 | public function __construct($config) |
||
30 | { |
||
31 | $this->loadConfig($config); |
||
32 | $this->setValue(); |
||
33 | } |
||
34 | |||
35 | /** |
||
36 | * Render filters template. |
||
37 | */ |
||
38 | public function render(): string |
||
39 | { |
||
40 | } |
||
|
|||
41 | |||
42 | /** |
||
43 | * @return mixed |
||
44 | */ |
||
45 | public function getValue(): string |
||
46 | { |
||
47 | return $this->value ?? ''; |
||
48 | } |
||
49 | |||
50 | public function setValue() |
||
53 | } |
||
54 | |||
55 | /** |
||
56 | * Return filter name. |
||
57 | * |
||
58 | * @return string |
||
59 | */ |
||
60 | public function getName(): string |
||
65 |
For hinted functions/methods where all return statements with the correct type are only reachable via conditions, ?null? gets implicitly returned which may be incompatible with the hinted type. Let?s take a look at an example: