Skip to content

Commit a58a808

Browse files
committed
Fixed PHPStan & PHPCSFixer
1 parent 779aaff commit a58a808

File tree

3 files changed

+14
-9
lines changed

3 files changed

+14
-9
lines changed

src/PhpWord/Style/Indentation.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,8 @@ public function getFirstLineChars(): int
138138
*/
139139
public function setFirstLineChars(int $value): self
140140
{
141-
$this->firstLineChars = $this->setNumericVal($value, $this->firstLineChars);
141+
$this->firstLineChars = $this->setIntVal($value, $this->firstLineChars);
142+
142143
return $this;
143144
}
144145

tests/PhpWordTests/Reader/Word2007/StyleTest.php

+5-5
Original file line numberDiff line numberDiff line change
@@ -379,39 +379,39 @@ public static function providerIndentation()
379379
488.00,
380380
10.0,
381381
490.00,
382-
140
382+
140,
383383
];
384384
yield [
385385
'<w:ind w:left="709" w:right="488" w:hanging="10" w:firstLine="490"/>',
386386
709.00,
387387
488.00,
388388
10.0,
389389
490.00,
390-
0
390+
0,
391391
];
392392
yield [
393393
'<w:ind w:hanging="10" w:firstLine="490"/>',
394394
0,
395395
0,
396396
10.0,
397397
490.00,
398-
0
398+
0,
399399
];
400400
yield [
401401
'<w:ind w:left="709"/>',
402402
709.00,
403403
0,
404404
0,
405405
0,
406-
0
406+
0,
407407
];
408408
yield [
409409
'<w:ind w:right="488"/>',
410410
0,
411411
488.00,
412412
0,
413413
0,
414-
0
414+
0,
415415
];
416416
}
417417
}

tests/PhpWordTests/Writer/Word2007/Style/IndentationTest.php

+7-3
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
use PhpOffice\PhpWord\PhpWord;
2222
use PhpOffice\PhpWord\Settings;
23-
use PhpOffice\PhpWord\Shared\Html as SharedHtml;
23+
use PhpOffice\PhpWord\Style\Paragraph;
2424
use PhpOffice\PhpWordTests\TestHelperDOCX;
2525

2626
class IndentationTest extends \PHPUnit\Framework\TestCase
@@ -40,7 +40,9 @@ public function testDefault(): void
4040
Settings::setDefaultRtl(true);
4141
$section = $word->addSection();
4242
$text = $section->addText('AA');
43-
$text->getParagraphStyle()->setIndentation([]);
43+
$paragraphStyle = $text->getParagraphStyle();
44+
self::assertInstanceOf(Paragraph::class, $paragraphStyle);
45+
$paragraphStyle->setIndentation([]);
4446
$doc = TestHelperDOCX::getDocument($word, 'Word2007');
4547

4648
$path = '/w:document/w:body/w:p[1]/w:pPr/w:ind';
@@ -54,7 +56,9 @@ public function testFirstLineChars(): void
5456
Settings::setDefaultRtl(true);
5557
$section = $word->addSection();
5658
$text = $section->addText('AA');
57-
$text->getParagraphStyle()->setIndentation([
59+
$paragraphStyle = $text->getParagraphStyle();
60+
self::assertInstanceOf(Paragraph::class, $paragraphStyle);
61+
$paragraphStyle->setIndentation([
5862
'firstLineChars' => 1440,
5963
]);
6064
$doc = TestHelperDOCX::getDocument($word, 'Word2007');

0 commit comments

Comments
 (0)