Conditions | 3 |
Paths | 3 |
Total Lines | 13 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Tests | 10 |
CRAP Score | 3 |
Changes | 0 |
1 | <?php |
||
22 | 3 | public function renderBlock(FieldInterface $field, DOMElement $element) |
|
23 | { |
||
24 | 3 | if (!$field instanceof Select) { |
|
25 | 1 | throw new InvalidArgumentException('Must be a Del\Form\Field\Select'); |
|
26 | } |
||
27 | 2 | foreach ($field->getOptions() as $value => $label) { |
|
28 | 2 | $option = $this->dom->createElement('option'); |
|
29 | 2 | $option->setAttribute('value', $value); |
|
30 | 2 | $option->textContent = $label; |
|
31 | 2 | $element->appendChild($option); |
|
32 | 2 | } |
|
33 | 2 | return $element; |
|
34 | } |
||
35 | } |