Apply suggestions from code review

Co-authored-by: Progi1984 <progi1984@gmail.com>
This commit is contained in:
Krystian Marcisz 2022-11-06 19:02:32 +01:00 committed by simivar
parent 4b7e7e4612
commit 46e61d4c18
2 changed files with 2 additions and 3 deletions

View File

@ -797,7 +797,6 @@ class TemplateProcessor
// Check if there's a cell spanning multiple rows. // Check if there's a cell spanning multiple rows.
if (preg_match('#<w:vMerge w:val="restart"/>#', $xmlRow)) { if (preg_match('#<w:vMerge w:val="restart"/>#', $xmlRow)) {
// $extraRowStart = $rowEnd;
$extraRowStart = $rowStart; $extraRowStart = $rowStart;
while (true) { while (true) {
$extraRowStart = $this->findRowStart($extraRowStart + 1); $extraRowStart = $this->findRowStart($extraRowStart + 1);
@ -1182,7 +1181,7 @@ class TemplateProcessor
* *
* @return integer * @return integer
*/ */
protected function findTableEnd($offset) protected function findTableEnd(int $offset): int
{ {
return strpos($this->tempDocumentMainPart, '</w:tbl>', $offset) + 7; return strpos($this->tempDocumentMainPart, '</w:tbl>', $offset) + 7;
} }

View File

@ -188,7 +188,7 @@ final class TemplateProcessorTest extends \PHPUnit\Framework\TestCase
* @covers ::saveAs * @covers ::saveAs
* @test * @test
*/ */
public function testDeleteRow() public function testDeleteRow(): void
{ {
$templateProcessor = new TemplateProcessor(__DIR__ . '/_files/templates/delete-row.docx'); $templateProcessor = new TemplateProcessor(__DIR__ . '/_files/templates/delete-row.docx');