Skip to content

Commit fffe56d

Browse files
committed
Phpstan 7.2/7.3/7.4
1 parent a5dd310 commit fffe56d

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed

src/PhpWord/Escaper/Rtf.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ protected function escapeMultibyteCharacter($code)
5656
protected function escapeSingleValue($input)
5757
{
5858
$escapedValue = '';
59-
$utf16 = mb_convert_encoding($input, 'UTF-16BE', 'UTF-8');
59+
$utf16 = (string) mb_convert_encoding($input, 'UTF-16BE', 'UTF-8');
6060
$utf16len = strlen($utf16);
6161
for ($i = 0; $i < $utf16len; $i += 2) {
6262
$code = (ord($utf16[$i]) << 8) | ord($utf16[$i + 1]);

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,8 @@ public function write()
137137
$content .= $this->getValueIf($style->getKerning() !== null, '\kerning' . round($style->getKerning() * 2));
138138

139139
// noProof
140+
// This is also specified above as \\langnp{$langId}
141+
// Not sure why, or if, both are needed.
140142
$content .= $this->getValueIf($style->isNoProof(), '\noproof\lang1024');
141143

142144
// Background-Color

tests/PhpWordTests/Writer/RTF/Style/FontTest.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,12 @@ public function testFontLang(): void
235235
$style->setLang(Language::EN_US);
236236
$expect = '\lang1033\ltrch ';
237237
self::assertEquals($expect, $this->removeCr($writer));
238+
239+
$style->setRTL(false);
240+
$style->setLang(Language::EN_US);
241+
$style->setNoProof(true);
242+
$expect = '\langnp1033\noproof\lang1024\ltrch ';
243+
self::assertEquals($expect, $this->removeCr($writer));
238244
}
239245

240246
/**

0 commit comments

Comments
 (0)