From d731e9284fc5a6b26e750009cb31dece7fea0ba0 Mon Sep 17 00:00:00 2001 From: DE TROOSTEMBERGH Antoine Date: Wed, 14 Apr 2021 22:15:58 +0200 Subject: [PATCH] fix checkstyle issues --- src/PhpWord/Shared/Html.php | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/src/PhpWord/Shared/Html.php b/src/PhpWord/Shared/Html.php index d5a5b657..fbdc051b 100644 --- a/src/PhpWord/Shared/Html.php +++ b/src/PhpWord/Shared/Html.php @@ -663,19 +663,15 @@ class Html $matches = array(); if (preg_match('/([a-z]+)/', $cValue, $matches)) { //$cvalue text and not number - if($cValue == 'normal') { + if ($cValue == 'normal') { $cValue = 1.12; - $spacingLineRule = \PhpOffice\PhpWord\SimpleType\LineSpacingRule::AUTO; - //we are subtracting 1 line height because the Spacing writer is adding one line - $spacing = ($cValue * Paragraph::LINE_HEIGHT) - Paragraph::LINE_HEIGHT; - }else{ + } else { $cValue = 1.13; - $spacingLineRule = \PhpOffice\PhpWord\SimpleType\LineSpacingRule::AUTO; - //we are subtracting 1 line height because the Spacing writer is adding one line - $spacing = ($cValue * Paragraph::LINE_HEIGHT) - Paragraph::LINE_HEIGHT; } - } - elseif (preg_match('/([0-9]+\.?[0-9]*[a-z]+)/', $cValue, $matches)) { + $spacingLineRule = \PhpOffice\PhpWord\SimpleType\LineSpacingRule::AUTO; + //we are subtracting 1 line height because the Spacing writer is adding one line + $spacing = ($cValue * Paragraph::LINE_HEIGHT) - Paragraph::LINE_HEIGHT; + } elseif (preg_match('/([0-9]+\.?[0-9]*[a-z]+)/', $cValue, $matches)) { //matches number with a unit, e.g. 12px, 15pt, 20mm, ... $spacingLineRule = \PhpOffice\PhpWord\SimpleType\LineSpacingRule::EXACT; $spacing = Converter::cssToTwip($matches[1]);