Total Complexity | 5 |
Total Lines | 28 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 4 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
12 | class SelectRender extends AbstractFieldRender |
||
13 | { |
||
14 | 5 | public function renderBlock(FieldInterface $field, DOMElement $element): DOMElement |
|
15 | { |
||
16 | 5 | if (!$field instanceof Select) { |
|
17 | 2 | throw new InvalidArgumentException('Must be a Del\Form\Field\Select'); |
|
18 | } |
||
19 | |||
20 | 3 | foreach ($field->getOptions() as $value => $label) { |
|
21 | 3 | $option = $this->processOption($field, $value, $label); |
|
22 | 3 | $element->appendChild($option); |
|
23 | } |
||
24 | |||
25 | 3 | return $element; |
|
26 | } |
||
27 | |||
28 | 3 | private function processOption(FieldInterface $field, $value, $label): DOMElement |
|
40 | } |
||
41 | } |
||
42 |