Total Complexity | 7 |
Total Lines | 60 |
Duplicated Lines | 0 % |
Coverage | 0% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
8 | class FormFieldRepository implements FormFieldRepositoryInterface |
||
9 | { |
||
10 | /** |
||
11 | * @var FormFieldControllerInterface[] |
||
12 | */ |
||
13 | protected $fields = []; |
||
14 | |||
15 | /** |
||
16 | * |
||
17 | */ |
||
18 | public function __construct(FormFieldControllerInterface ...$fields) |
||
21 | } |
||
22 | |||
23 | /** |
||
24 | * Get the value of fields |
||
25 | * |
||
26 | * @return mixed |
||
27 | */ |
||
28 | public function getFields(string ...$fields): array |
||
29 | { |
||
30 | return empty($fields) ? $this->fields : $this->getDefinedFields(...$fields); |
||
31 | } |
||
32 | |||
33 | /** |
||
34 | * |
||
35 | */ |
||
36 | public function getField(string $field): ?FormFieldControllerInterface |
||
39 | } |
||
40 | |||
41 | /** |
||
42 | * |
||
43 | */ |
||
44 | public function getDefinedFields(string ...$fields): array |
||
50 | } |
||
51 | ); |
||
52 | } |
||
53 | |||
54 | /** |
||
55 | * |
||
56 | */ |
||
57 | public function addField(FormFieldControllerInterface $field) |
||
60 | } |
||
61 | |||
62 | /** |
||
63 | * @return string[] |
||
64 | */ |
||
65 | public function getFieldNames(): array |
||
70 |