Skip to content

Commit bce5db9

Browse files
authored
Merge pull request #4267 from oleibman/dompdf84b
Upgrade Dompdf to 8.4-Compatible Version
2 parents e23c987 + e8e8b3c commit bce5db9

File tree

5 files changed

+12
-38
lines changed

5 files changed

+12
-38
lines changed

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com)
66
and this project adheres to [Semantic Versioning](https://semver.org).
77

8-
## TBD - 3.6.0
8+
## 2024-12-08 - 3.6.0
99

1010
### Added
1111

@@ -31,6 +31,7 @@ and this project adheres to [Semantic Versioning](https://semver.org).
3131
- 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)
3232
- Fix minor break handling drawings. [Issue #4241](https://github.com/PHPOffice/PhpSpreadsheet/issues/4241) [PR #4244](https://github.com/PHPOffice/PhpSpreadsheet/pull/4244)
3333
- 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)
34+
- Upgrade Dompdf to Php-8.4 compatible version [PR #4267](https://github.com/PHPOffice/PhpSpreadsheet/pull/4267)
3435

3536
## 2024-11-22 - 3.5.0
3637

composer.lock

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/PhpSpreadsheet/Helper/Sample.php

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
use PhpOffice\PhpSpreadsheet\Spreadsheet;
1010
use PhpOffice\PhpSpreadsheet\Worksheet\Worksheet;
1111
use PhpOffice\PhpSpreadsheet\Writer\IWriter;
12-
use PhpOffice\PhpSpreadsheet\Writer\Pdf\Dompdf;
1312
use RecursiveDirectoryIterator;
1413
use RecursiveIteratorIterator;
1514
use RecursiveRegexIterator;
@@ -129,11 +128,7 @@ public function write(Spreadsheet $spreadsheet, string $filename, array $writers
129128
$writerCallback($writer);
130129
}
131130
$callStartTime = microtime(true);
132-
if (PHP_VERSION_ID >= 80400 && $writer instanceof Dompdf) {
133-
@$writer->save($path);
134-
} else {
135-
$writer->save($path);
136-
}
131+
$writer->save($path);
137132
$this->logWrite($writer, $path, $callStartTime);
138133
if ($this->isCli() === false) {
139134
// @codeCoverageIgnoreStart

tests/PhpSpreadsheetTests/Functional/StreamTest.php

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,6 @@
88
use PhpOffice\PhpSpreadsheet\Spreadsheet;
99
use PHPUnit\Framework\TestCase;
1010

11-
/**
12-
* Not clear that Dompdf will be Php8.4 compatible in time.
13-
* Run in separate process and add version test till it is ready.
14-
*/
15-
#[\PHPUnit\Framework\Attributes\RunTestsInSeparateProcesses]
1611
class StreamTest extends TestCase
1712
{
1813
public static function providerFormats(): array
@@ -45,11 +40,7 @@ public function testAllWritersCanWriteToStream(string $format): void
4540
} else {
4641
self::assertSame(0, $stat['size']);
4742

48-
if ($format === 'Dompdf' && PHP_VERSION_ID >= 80400) {
49-
@$writer->save($stream);
50-
} else {
51-
$writer->save($stream);
52-
}
43+
$writer->save($stream);
5344

5445
self::assertIsResource($stream, 'should not close the stream for further usage out of PhpSpreadsheet');
5546
$stat = fstat($stream);

tests/PhpSpreadsheetTests/Writer/Dompdf/PaperSizeArrayTest.php

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,6 @@
1010
use PhpOffice\PhpSpreadsheet\Writer\Pdf\Dompdf;
1111
use PHPUnit\Framework\TestCase;
1212

13-
/**
14-
* Not clear that Dompdf will be Php8.4 compatible in time.
15-
* Run in separate process and add version test till it is ready.
16-
*/
17-
#[\PHPUnit\Framework\Attributes\RunTestsInSeparateProcesses]
1813
class PaperSizeArrayTest extends TestCase
1914
{
2015
private string $outfile = '';
@@ -41,11 +36,7 @@ public function testPaperSizeArray(): void
4136
$sheet->setCellValue('A7', 'Lorem Ipsum');
4237
$writer = new Dompdf($spreadsheet);
4338
$this->outfile = File::temporaryFilename();
44-
if (PHP_VERSION_ID >= 80400) { // hopefully temporary
45-
@$writer->save($this->outfile);
46-
} else {
47-
$writer->save($this->outfile);
48-
}
39+
$writer->save($this->outfile);
4940
$spreadsheet->disconnectWorksheets();
5041
unset($spreadsheet);
5142
$contents = file_get_contents($this->outfile);
@@ -65,11 +56,7 @@ public function testPaperSizeNotArray(): void
6556
$sheet->setCellValue('A7', 'Lorem Ipsum');
6657
$writer = new Dompdf($spreadsheet);
6758
$this->outfile = File::temporaryFilename();
68-
if (PHP_VERSION_ID >= 80400) { // hopefully temporary
69-
@$writer->save($this->outfile);
70-
} else {
71-
$writer->save($this->outfile);
72-
}
59+
$writer->save($this->outfile);
7360
$spreadsheet->disconnectWorksheets();
7461
unset($spreadsheet);
7562
$contents = file_get_contents($this->outfile);

0 commit comments

Comments
 (0)