Conditions | 2 |
Paths | 2 |
Total Lines | 12 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Tests | 8 |
CRAP Score | 2 |
Changes | 3 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
33 | 3 | private function processOption(FieldInterface $field, $value, $label): DOMElement |
|
34 | { |
||
35 | 3 | $option = $this->createElement('option'); |
|
36 | 3 | $option->setAttribute('value', (string) $value); |
|
37 | 3 | $label = $this->createText($label); |
|
38 | 3 | $option->appendChild($label); |
|
39 | |||
40 | 3 | if ($field->getValue() == $option->getAttribute('value')) { |
|
41 | 1 | $option->setAttribute('selected', 'selected'); |
|
42 | } |
||
43 | |||
44 | 3 | return $option; |
|
45 | } |
||
47 |