Total Complexity | 3 |
Total Lines | 48 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
5 | trait HasFields |
||
6 | { |
||
7 | |||
8 | /** |
||
9 | * Fields to check. |
||
10 | * |
||
11 | * @var array |
||
12 | */ |
||
13 | protected array $fields = []; |
||
14 | |||
15 | /** |
||
16 | * Fields to check. |
||
17 | * |
||
18 | * @return array |
||
19 | */ |
||
20 | 3 | public function getFields(): array |
|
21 | { |
||
22 | 3 | return $this->fields; |
|
23 | } |
||
24 | |||
25 | /** |
||
26 | * Set fields. |
||
27 | * |
||
28 | * @param array $fields |
||
29 | * |
||
30 | * @return static |
||
31 | */ |
||
32 | 11 | public function setFields(array $fields): static |
|
37 | } |
||
38 | |||
39 | /** |
||
40 | * Add field to list. |
||
41 | * |
||
42 | * @param string $field |
||
43 | * |
||
44 | * @return static |
||
45 | */ |
||
46 | 2 | public function addField(string $field): static |
|
53 | } |
||
54 | } |
||
55 |