Skip to content

Commit 6ed0ac1

Browse files
committed
More Scrutinizer Recommendations
Hopefully this clears 3 remaining issues.
1 parent 8054949 commit 6ed0ac1

File tree

2 files changed

+6
-9
lines changed

2 files changed

+6
-9
lines changed

src/PhpWord/Writer/HTML/Element/Text.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,9 @@ public function write()
7878
if (Settings::isOutputEscapingEnabled()) {
7979
// Scrutinizer notes that escapeHTML does not exist on AbstractEscaper.
8080
// Nevertheless, it does exist for HTML writer.
81+
$escaper = $this->escaper;
8182
/** @scrutinizer ignore-call */
82-
$contenx = $this->escaper->escapeHtml($element->getText());
83+
$contenx = $escaper->escapeHtml($element->getText());
8384
} else {
8485
$contenx = $element->getText();
8586
}

src/PhpWord/Writer/HTML/Style/Paragraph.php

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -84,15 +84,11 @@ public function write()
8484
$ind = $style->getIndentation();
8585
if (!is_null($ind)) {
8686
$left = $ind->getLeft();
87-
if (is_int($left) || is_float($left)) {
88-
$inches = $left * 1.0 / \PhpOffice\PhpWord\Shared\Converter::INCH_TO_TWIP;
89-
$css['margin-left'] = ((string) $inches) . 'in';
90-
}
87+
$inches = $left * 1.0 / \PhpOffice\PhpWord\Shared\Converter::INCH_TO_TWIP;
88+
$css['margin-left'] = ((string) $inches) . 'in';
9189
$left = $ind->getRight();
92-
if (is_int($left) || is_float($left)) {
93-
$inches = $left * 1.0 / \PhpOffice\PhpWord\Shared\Converter::INCH_TO_TWIP;
94-
$css['margin-right'] = ((string) $inches) . 'in';
95-
}
90+
$inches = $left * 1.0 / \PhpOffice\PhpWord\Shared\Converter::INCH_TO_TWIP;
91+
$css['margin-right'] = ((string) $inches) . 'in';
9692
}
9793
if ($style->hasPageBreakBefore()) {
9894
$css['page-break-before'] = 'always';

0 commit comments

Comments
 (0)