| Total Complexity | 5 |
| Total Lines | 51 |
| Duplicated Lines | 0 % |
| Coverage | 0% |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 5 | class Radio extends Field |
||
| 6 | { |
||
| 7 | /** |
||
| 8 | * @var array |
||
| 9 | */ |
||
| 10 | protected $options = []; |
||
| 11 | |||
| 12 | /** |
||
| 13 | * @return array |
||
| 14 | */ |
||
| 15 | public function getOptions(): array |
||
| 16 | { |
||
| 17 | return (array) $this->options; |
||
| 18 | } |
||
| 19 | |||
| 20 | /** |
||
| 21 | * @param array $options |
||
| 22 | * |
||
| 23 | * @return self |
||
| 24 | */ |
||
| 25 | public function setOptions(array $options): self |
||
| 26 | { |
||
| 27 | $this->options = $options; |
||
| 28 | |||
| 29 | return $this; |
||
| 30 | } |
||
| 31 | |||
| 32 | /** |
||
| 33 | * @return array |
||
| 34 | */ |
||
| 35 | public function onIndex() |
||
| 36 | { |
||
| 37 | return [ |
||
| 38 | 'options' => $this->getOptions(), |
||
| 39 | ]; |
||
| 40 | } |
||
| 41 | |||
| 42 | /** |
||
| 43 | * @return array |
||
| 44 | */ |
||
| 45 | public function onView() |
||
| 46 | { |
||
| 47 | return $this->onIndex(); |
||
| 48 | } |
||
| 49 | |||
| 50 | /** |
||
| 51 | * @return array |
||
| 52 | */ |
||
| 53 | public function onEdit() |
||
| 56 | } |
||
| 57 | } |
||
| 58 |