Apply suggestions from code review
Co-authored-by: Progi1984 <progi1984@gmail.com>
This commit is contained in:
parent
4b7e7e4612
commit
46e61d4c18
@ -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;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -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');
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user