diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index 274764b1f..78979ae92 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -6800,11 +6800,6 @@ parameters: count: 3 path: tests/PhpSpreadsheetTests/Writer/Html/HtmlCommentsTest.php - - - message: "#^Parameter \\#1 \\$directory of function chdir expects string, string\\|false given\\.$#" - count: 1 - path: tests/PhpSpreadsheetTests/Writer/Html/ImagesRootTest.php - - message: "#^Parameter \\#1 \\$options of static method PhpOffice\\\\PhpSpreadsheet\\\\Settings\\:\\:setLibXmlLoaderOptions\\(\\) expects int, null given\\.$#" count: 1 diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/SubTotalTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/SubTotalTest.php index 2a54e4591..cf79ac0b1 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/SubTotalTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/SubTotalTest.php @@ -92,7 +92,7 @@ class SubTotalTest extends AllSetupTeardown '12' => false, ]; foreach ($visibleRows as $row => $visible) { - $rowDimension = $sheet->getRowDimension($row); + $rowDimension = $sheet->getRowDimension((int) $row); $rowDimension->setVisible($visible); } $sheet->getCell('D2')->setValue("=SUBTOTAL($type, A1:$maxCol$maxRow)"); diff --git a/tests/PhpSpreadsheetTests/Writer/Html/ImagesRootTest.php b/tests/PhpSpreadsheetTests/Writer/Html/ImagesRootTest.php index 40099177f..b36a87c0b 100644 --- a/tests/PhpSpreadsheetTests/Writer/Html/ImagesRootTest.php +++ b/tests/PhpSpreadsheetTests/Writer/Html/ImagesRootTest.php @@ -10,13 +10,18 @@ use PhpOffice\PhpSpreadsheetTests\Functional; class ImagesRootTest extends Functional\AbstractFunctional { /** - * @var false|string + * @var string */ - private $curdir; + private $curdir = ''; protected function setUp(): void { - $this->curdir = getcwd(); + $curdir = getcwd(); + if ($curdir === false) { + self::fail('Unable to obtain current directory'); + } else { + $this->curdir = $curdir; + } } protected function tearDown(): void @@ -64,5 +69,6 @@ class ImagesRootTest extends Functional\AbstractFunctional self::assertCount(1, $img); self::assertEquals("$root/$stub", $img[0]->getAttribute('src')); self::assertEquals($desc, $img[0]->getAttribute('alt')); + $spreadsheet->disconnectWorksheets(); } }