Skip to content

Commit d731e92

Browse files
DE TROOSTEMBERGH AntoineDE TROOSTEMBERGH Antoine
authored andcommitted
fix checkstyle issues
1 parent 7f78322 commit d731e92

File tree

1 file changed

+6
-10
lines changed

1 file changed

+6
-10
lines changed

src/PhpWord/Shared/Html.php

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -663,19 +663,15 @@ protected static function parseStyle($attribute, $styles)
663663
$matches = array();
664664
if (preg_match('/([a-z]+)/', $cValue, $matches)) {
665665
//$cvalue text and not number
666-
if($cValue == 'normal') {
666+
if ($cValue == 'normal') {
667667
$cValue = 1.12;
668-
$spacingLineRule = \PhpOffice\PhpWord\SimpleType\LineSpacingRule::AUTO;
669-
//we are subtracting 1 line height because the Spacing writer is adding one line
670-
$spacing = ($cValue * Paragraph::LINE_HEIGHT) - Paragraph::LINE_HEIGHT;
671-
}else{
668+
} else {
672669
$cValue = 1.13;
673-
$spacingLineRule = \PhpOffice\PhpWord\SimpleType\LineSpacingRule::AUTO;
674-
//we are subtracting 1 line height because the Spacing writer is adding one line
675-
$spacing = ($cValue * Paragraph::LINE_HEIGHT) - Paragraph::LINE_HEIGHT;
676670
}
677-
}
678-
elseif (preg_match('/([0-9]+\.?[0-9]*[a-z]+)/', $cValue, $matches)) {
671+
$spacingLineRule = \PhpOffice\PhpWord\SimpleType\LineSpacingRule::AUTO;
672+
//we are subtracting 1 line height because the Spacing writer is adding one line
673+
$spacing = ($cValue * Paragraph::LINE_HEIGHT) - Paragraph::LINE_HEIGHT;
674+
} elseif (preg_match('/([0-9]+\.?[0-9]*[a-z]+)/', $cValue, $matches)) {
679675
//matches number with a unit, e.g. 12px, 15pt, 20mm, ...
680676
$spacingLineRule = \PhpOffice\PhpWord\SimpleType\LineSpacingRule::EXACT;
681677
$spacing = Converter::cssToTwip($matches[1]);

0 commit comments

Comments
 (0)