diff --git a/CHANGELOG.md b/CHANGELOG.md index 0b0bfe17b2..67915c7052 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,7 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com) and this project adheres to [Semantic Versioning](https://semver.org). -## TBD - 3.6.0 +## 2024-12-08 - 3.6.0 ### Added @@ -31,6 +31,7 @@ and this project adheres to [Semantic Versioning](https://semver.org). - Swapped row and column indexes in ReferenceHelper. [Issue #4246](https://github.com/PHPOffice/PhpSpreadsheet/issues/4246) [PR #4247](https://github.com/PHPOffice/PhpSpreadsheet/pull/4247) - Fix minor break handling drawings. [Issue #4241](https://github.com/PHPOffice/PhpSpreadsheet/issues/4241) [PR #4244](https://github.com/PHPOffice/PhpSpreadsheet/pull/4244) - Ignore cell formatting when the format is a single @. [Issue #4242](https://github.com/PHPOffice/PhpSpreadsheet/issues/4242) [PR #4243](https://github.com/PHPOffice/PhpSpreadsheet/pull/4243) +- Upgrade Dompdf to Php-8.4 compatible version [PR #4267](https://github.com/PHPOffice/PhpSpreadsheet/pull/4267) ## 2024-11-22 - 3.5.0 diff --git a/composer.lock b/composer.lock index 6f3dc17666..6533b316ad 100644 --- a/composer.lock +++ b/composer.lock @@ -788,16 +788,16 @@ }, { "name": "dompdf/dompdf", - "version": "v3.0.0", + "version": "v3.0.1", "source": { "type": "git", "url": "https://github.com/dompdf/dompdf.git", - "reference": "fbc7c5ee5d94f7a910b78b43feb7931b7f971b59" + "reference": "2d622faf9aa1f8f7f24dd094e49b5cf6c0c5d4e6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/dompdf/dompdf/zipball/fbc7c5ee5d94f7a910b78b43feb7931b7f971b59", - "reference": "fbc7c5ee5d94f7a910b78b43feb7931b7f971b59", + "url": "https://api.github.com/repos/dompdf/dompdf/zipball/2d622faf9aa1f8f7f24dd094e49b5cf6c0c5d4e6", + "reference": "2d622faf9aa1f8f7f24dd094e49b5cf6c0c5d4e6", "shasum": "" }, "require": { @@ -846,9 +846,9 @@ "homepage": "https://github.com/dompdf/dompdf", "support": { "issues": "https://github.com/dompdf/dompdf/issues", - "source": "https://github.com/dompdf/dompdf/tree/v3.0.0" + "source": "https://github.com/dompdf/dompdf/tree/v3.0.1" }, - "time": "2024-04-29T14:01:28+00:00" + "time": "2024-12-05T14:59:38+00:00" }, { "name": "dompdf/php-font-lib", diff --git a/src/PhpSpreadsheet/Helper/Sample.php b/src/PhpSpreadsheet/Helper/Sample.php index 136c458d44..420e80b7be 100644 --- a/src/PhpSpreadsheet/Helper/Sample.php +++ b/src/PhpSpreadsheet/Helper/Sample.php @@ -9,7 +9,6 @@ use PhpOffice\PhpSpreadsheet\Spreadsheet; use PhpOffice\PhpSpreadsheet\Worksheet\Worksheet; use PhpOffice\PhpSpreadsheet\Writer\IWriter; -use PhpOffice\PhpSpreadsheet\Writer\Pdf\Dompdf; use RecursiveDirectoryIterator; use RecursiveIteratorIterator; use RecursiveRegexIterator; @@ -129,11 +128,7 @@ public function write(Spreadsheet $spreadsheet, string $filename, array $writers $writerCallback($writer); } $callStartTime = microtime(true); - if (PHP_VERSION_ID >= 80400 && $writer instanceof Dompdf) { - @$writer->save($path); - } else { - $writer->save($path); - } + $writer->save($path); $this->logWrite($writer, $path, $callStartTime); if ($this->isCli() === false) { // @codeCoverageIgnoreStart diff --git a/tests/PhpSpreadsheetTests/Functional/StreamTest.php b/tests/PhpSpreadsheetTests/Functional/StreamTest.php index 4a43f77c5f..9d062d2b85 100644 --- a/tests/PhpSpreadsheetTests/Functional/StreamTest.php +++ b/tests/PhpSpreadsheetTests/Functional/StreamTest.php @@ -8,11 +8,6 @@ use PhpOffice\PhpSpreadsheet\Spreadsheet; use PHPUnit\Framework\TestCase; -/** - * Not clear that Dompdf will be Php8.4 compatible in time. - * Run in separate process and add version test till it is ready. - */ -#[\PHPUnit\Framework\Attributes\RunTestsInSeparateProcesses] class StreamTest extends TestCase { public static function providerFormats(): array @@ -45,11 +40,7 @@ public function testAllWritersCanWriteToStream(string $format): void } else { self::assertSame(0, $stat['size']); - if ($format === 'Dompdf' && PHP_VERSION_ID >= 80400) { - @$writer->save($stream); - } else { - $writer->save($stream); - } + $writer->save($stream); self::assertIsResource($stream, 'should not close the stream for further usage out of PhpSpreadsheet'); $stat = fstat($stream); diff --git a/tests/PhpSpreadsheetTests/Writer/Dompdf/PaperSizeArrayTest.php b/tests/PhpSpreadsheetTests/Writer/Dompdf/PaperSizeArrayTest.php index 3abf561103..4c0b86b637 100644 --- a/tests/PhpSpreadsheetTests/Writer/Dompdf/PaperSizeArrayTest.php +++ b/tests/PhpSpreadsheetTests/Writer/Dompdf/PaperSizeArrayTest.php @@ -10,11 +10,6 @@ use PhpOffice\PhpSpreadsheet\Writer\Pdf\Dompdf; use PHPUnit\Framework\TestCase; -/** - * Not clear that Dompdf will be Php8.4 compatible in time. - * Run in separate process and add version test till it is ready. - */ -#[\PHPUnit\Framework\Attributes\RunTestsInSeparateProcesses] class PaperSizeArrayTest extends TestCase { private string $outfile = ''; @@ -41,11 +36,7 @@ public function testPaperSizeArray(): void $sheet->setCellValue('A7', 'Lorem Ipsum'); $writer = new Dompdf($spreadsheet); $this->outfile = File::temporaryFilename(); - if (PHP_VERSION_ID >= 80400) { // hopefully temporary - @$writer->save($this->outfile); - } else { - $writer->save($this->outfile); - } + $writer->save($this->outfile); $spreadsheet->disconnectWorksheets(); unset($spreadsheet); $contents = file_get_contents($this->outfile); @@ -65,11 +56,7 @@ public function testPaperSizeNotArray(): void $sheet->setCellValue('A7', 'Lorem Ipsum'); $writer = new Dompdf($spreadsheet); $this->outfile = File::temporaryFilename(); - if (PHP_VERSION_ID >= 80400) { // hopefully temporary - @$writer->save($this->outfile); - } else { - $writer->save($this->outfile); - } + $writer->save($this->outfile); $spreadsheet->disconnectWorksheets(); unset($spreadsheet); $contents = file_get_contents($this->outfile);