Total Complexity | 5 |
Total Lines | 52 |
Duplicated Lines | 0 % |
Changes | 2 | ||
Bugs | 0 | Features | 2 |
1 | <?php |
||
14 | abstract class BaseFilter |
||
15 | { |
||
16 | use Configurable; |
||
17 | |||
18 | /** |
||
19 | * @var string $name |
||
20 | */ |
||
21 | public $name; |
||
22 | |||
23 | /** |
||
24 | * @var string $value |
||
25 | */ |
||
26 | public $value; |
||
27 | |||
28 | /** |
||
29 | * BaseFilter constructor. |
||
30 | * @param $config |
||
31 | */ |
||
32 | public function __construct($config) |
||
33 | { |
||
34 | $this->loadConfig($config); |
||
35 | $this->setValue(); |
||
36 | } |
||
37 | |||
38 | /** |
||
39 | * Render filters template. |
||
40 | */ |
||
41 | public function render(): string |
||
42 | { |
||
43 | } |
||
|
|||
44 | |||
45 | /** |
||
46 | * @return mixed |
||
47 | */ |
||
48 | public function getValue() |
||
49 | { |
||
50 | return $this->value ?? ''; |
||
51 | } |
||
52 | |||
53 | public function setValue() |
||
56 | } |
||
57 | |||
58 | /** |
||
59 | * Return filter name. |
||
60 | * |
||
61 | * @return string|null |
||
62 | */ |
||
63 | public function getName() |
||
68 |
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: