| Conditions | 3 |
| Paths | 3 |
| Total Lines | 14 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 8 |
| CRAP Score | 3 |
| Changes | 0 | ||
| 1 | <?php declare(strict_types=1); |
||
| 12 | 5 | public function renderBlock(FieldInterface $field, DOMElement $element): DOMElement |
|
| 13 | {
|
||
| 14 | 5 | if (!$field instanceof MultiSelect) {
|
|
| 15 | 1 | throw new InvalidArgumentException('Must be a Del\Form\Field\MultiSelect');
|
|
| 16 | } |
||
| 17 | |||
| 18 | 4 | $element->setAttribute('name', $field->getName() . '[]');
|
|
| 19 | |||
| 20 | 4 | foreach ($field->getOptions() as $value => $label) {
|
|
| 21 | 3 | $option = $this->processOption($field, $value, $label); |
|
| 22 | 3 | $element->appendChild($option); |
|
| 23 | } |
||
| 24 | |||
| 25 | 4 | return $element; |
|
| 26 | } |
||
| 42 |