Conditions | 3 |
Paths | 3 |
Total Lines | 17 |
Lines | 0 |
Ratio | 0 % |
Tests | 9 |
CRAP Score | 3 |
Changes | 0 |
1 | <?php |
||
27 | 18 | public function render(AbstractInline $inline, ElementRendererInterface $htmlRenderer) |
|
28 | { |
||
29 | 18 | if (!($inline instanceof TaskListItemMarker)) { |
|
30 | 3 | throw new \InvalidArgumentException('Incompatible inline type: ' . \get_class($inline)); |
|
31 | } |
||
32 | |||
33 | 15 | $checkbox = new HtmlElement('input', [], '', true); |
|
34 | |||
35 | 15 | if ($inline->isChecked()) { |
|
36 | 12 | $checkbox->setAttribute('checked', ''); |
|
37 | } |
||
38 | |||
39 | 15 | $checkbox->setAttribute('disabled', ''); |
|
40 | 15 | $checkbox->setAttribute('type', 'checkbox'); |
|
41 | |||
42 | 15 | return $checkbox; |
|
43 | } |
||
44 | } |
||
45 |