| Total Complexity | 5 |
| Total Lines | 46 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 8 | final class ArrayChoice implements ChoiceInterface |
||
| 9 | { |
||
| 10 | /** |
||
| 11 | * The list of choices |
||
| 12 | * |
||
| 13 | * Key: should be the label of the choice |
||
| 14 | * Value: the value |
||
| 15 | * |
||
| 16 | * @var array |
||
| 17 | */ |
||
| 18 | private $choices; |
||
| 19 | |||
| 20 | /** |
||
| 21 | * ArrayChoice constructor. |
||
| 22 | * |
||
| 23 | * @param array $choices The choices. To declare label, use associative array with key as label |
||
| 24 | */ |
||
| 25 | 18 | public function __construct(array $choices) |
|
| 26 | { |
||
| 27 | 18 | $this->choices = $choices; |
|
| 28 | 18 | } |
|
| 29 | |||
| 30 | /** |
||
| 31 | * {@inheritdoc} |
||
| 32 | */ |
||
| 33 | 15 | public function values(): array |
|
| 36 | } |
||
| 37 | |||
| 38 | /** |
||
| 39 | * {@inheritdoc} |
||
| 40 | */ |
||
| 41 | 9 | public function view(?callable $configurator = null): array |
|
| 56 |