| Conditions | 1 |
| Paths | 1 |
| Total Lines | 15 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 10 |
| CRAP Score | 1 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 20 | 3 | public function configureOptions(OptionsResolver $optionsResolver): void |
|
| 21 | { |
||
| 22 | 3 | $dictionaries = $this->collection; |
|
| 23 | 3 | ||
| 24 | $choices = static function (Options $options) use ($dictionaries): array { |
||
| 25 | 1 | $name = $options['name']; |
|
| 26 | $choices = $dictionaries[$name]->getValues(); |
||
| 27 | 1 | ||
| 28 | return array_flip($choices); |
||
| 29 | 1 | }; |
|
| 30 | 1 | ||
| 31 | 1 | $optionsResolver |
|
| 32 | ->setDefault('choices', $choices) |
||
| 33 | 1 | ->setRequired(['name']) |
|
| 34 | 1 | ->setAllowedValues('name', array_keys(iterator_to_array($this->collection))) |
|
| 35 | ; |
||
| 43 |