| Total Complexity | 5 |
| Total Lines | 40 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 0 | ||
| 1 | <?php |
||
| 15 | class Options extends AField |
||
| 16 | { |
||
| 17 | /** @var string */ |
||
| 18 | protected string $emptyItem = '- all -'; |
||
| 19 | /** @var array<string, string|int|float> */ |
||
| 20 | protected array $options = []; |
||
| 21 | |||
| 22 | /** |
||
| 23 | * @param array<string, string|int|float> $options |
||
| 24 | * @param array<string, string> $attributes |
||
| 25 | */ |
||
| 26 | 2 | public function __construct(array $options = [], array $attributes = []) |
|
| 27 | { |
||
| 28 | 2 | $this->setOptions($options); |
|
| 29 | 2 | parent::__construct($attributes); |
|
| 30 | 2 | } |
|
| 31 | |||
| 32 | 2 | public function getFilterAction(): string |
|
| 35 | } |
||
| 36 | |||
| 37 | /** |
||
| 38 | * @param array<string, string|int|float> $options |
||
| 39 | * @return $this |
||
| 40 | */ |
||
| 41 | 2 | public function setOptions(array $options): self |
|
| 42 | { |
||
| 43 | 2 | $this->options = [IFilterType::EMPTY_FILTER => $this->emptyItem] + $options; |
|
| 44 | 2 | return $this; |
|
| 45 | } |
||
| 46 | |||
| 47 | 1 | public function setEmptyItem(string $text): void |
|
| 48 | { |
||
| 49 | 1 | $this->emptyItem = $text; |
|
| 50 | 1 | } |
|
| 51 | |||
| 52 | 2 | public function add(): void |
|
| 55 | 2 | } |
|
| 56 | } |
||
| 57 |