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