Skip to content

Commit fb397a0

Browse files
committed
CSFix and PHP7 Fix
1 parent 7890e1f commit fb397a0

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/PhpWord/Writer/ODText/Style/Font.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class Font extends AbstractStyle
3333
public function write(): void
3434
{
3535
$style = $this->getStyle();
36-
if (!$style instanceof \PhpOffice\PhpWord\Style\Font) {
36+
if (!$style instanceof FontStyle) {
3737
return;
3838
}
3939
$xmlWriter = $this->getXmlWriter();
@@ -96,11 +96,11 @@ public function write(): void
9696

9797
$underline = $style->getUnderline();
9898
if (isset($underlines[$underline])) {
99-
$xmlWriter->writeAttributeIf($underline != 'none', 'style:text-underline-style', $underlines[$underline]);
100-
$xmlWriter->writeAttributeIf(str_contains(strtolower($underline), 'heavy'), 'style:text-underline-width', 'bold');
101-
$xmlWriter->writeAttributeIf(str_contains(strtolower($underline), 'thick'), 'style:text-underline-width', 'bold');
102-
$xmlWriter->writeAttributeIf(str_contains(strtolower($underline), 'double'), 'style:text-underline-type', 'double');
103-
$xmlWriter->writeAttributeIf(str_contains(strtolower($underline), 'words'), 'style:text-underline-mode', 'skip-white-space');
99+
$xmlWriter->writeAttribute('style:text-underline-style', $underlines[$underline]);
100+
$xmlWriter->writeAttributeIf(strpos(strtolower($underline), 'heavy') !== false, 'style:text-underline-width', 'bold');
101+
$xmlWriter->writeAttributeIf(strpos(strtolower($underline), 'thick') !== false, 'style:text-underline-width', 'bold');
102+
$xmlWriter->writeAttributeIf(strpos(strtolower($underline), 'double') !== false, 'style:text-underline-type', 'double');
103+
$xmlWriter->writeAttributeIf(strpos(strtolower($underline), 'words') !== false, 'style:text-underline-mode', 'skip-white-space');
104104
}
105105

106106
// Strikethrough, double strikethrough

0 commit comments

Comments
 (0)