Skip to content

Commit ad8eecc

Browse files
committed
remove dead code
1 parent 726c8ca commit ad8eecc

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

src/PhpWord/Shared/Html.php

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -244,11 +244,14 @@ protected static function parseParagraph($node, $element, &$styles)
244244
protected static function parseInput($node, $element, &$styles)
245245
{
246246
$attributes = $node->attributes;
247-
248-
if (($type = $attributes->getNamedItem('type')->value) === 'checkbox') {
249-
$checked = ($checked = $attributes->getNamedItem('checked')) && $checked->value === "true" ?? false;
250-
$textrun = $element->addTextRun();
251-
$textrun->addFormField('checkbox')->setValue($checked);
247+
$inputType = $attributes->getNamedItem('type')->value;
248+
249+
switch ($inputType) {
250+
case 'checkbox':
251+
$checked = ($checked = $attributes->getNamedItem('checked')) && $checked->value === "true" ?? false;
252+
$textrun = $element->addTextRun();
253+
$textrun->addFormField('checkbox')->setValue($checked);
254+
break;
252255
}
253256
}
254257

0 commit comments

Comments
 (0)