Skip to content

Commit 7327aa0

Browse files
committed
Upgrade Dompdf, Tcpdf, .gitattributes
1 parent 2dac558 commit 7327aa0

File tree

9 files changed

+171
-144
lines changed

9 files changed

+171
-144
lines changed

.gitattributes

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,18 @@
33
/.gitattributes export-ignore
44
/.github export-ignore
55
/.gitignore export-ignore
6-
/.php_cs.dist export-ignore
6+
/.phpcs.xml.dist export-ignore
7+
/.php-cs-fixer.dist.php export-ignore
8+
/.readthedocs.yaml export-ignore
79
/.scrutinizer.yml export-ignore
810
/CHANGELOG.PHPExcel.md export-ignore
911
/bin export-ignore
1012
/composer.lock export-ignore
1113
/docs export-ignore
1214
/infra export-ignore
1315
/mkdocs.yml export-ignore
16+
/phpstan.neon.dist export-ignore
17+
/phpstan-baseline.neon export-ignore
1418
/phpunit.xml.dist export-ignore
1519
/samples export-ignore
1620
/tests export-ignore

CHANGELOG.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,15 @@ 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 - 2.1.5
8+
## 2024-12-08 - 2.1.5
99

1010
### Fixed
1111

1212
- Fix Minor Break Handling Drawings. Backport of [PR #4244](https://github.com/PHPOffice/PhpSpreadsheet/pull/4244)
13+
- Swapped Row and Column Indexes in Reference Helper. Backport of [PR #4247](https://github.com/PHPOffice/PhpSpreadsheet/pull/4247)
14+
- Upgrade locked version of Tcpdf (security advisory).
15+
- Upgrade locked version of Dompdf (Php8.4 compatibility).
16+
- Remove unnecessary files from Composer package.
1317

1418
## 2024-11-22 - 2.1.4
1519

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@
8888
},
8989
"require-dev": {
9090
"dealerdirect/phpcodesniffer-composer-installer": "dev-main",
91-
"dompdf/dompdf": "^2.0",
91+
"dompdf/dompdf": "^2.0 || ^3.0",
9292
"friendsofphp/php-cs-fixer": "^3.2",
9393
"mitoteam/jpgraph": "^10.3",
9494
"mpdf/mpdf": "^8.1.1",

composer.lock

Lines changed: 110 additions & 107 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;
@@ -130,11 +129,7 @@ public function write(Spreadsheet $spreadsheet, string $filename, array $writers
130129
$writerCallback($writer);
131130
}
132131
$callStartTime = microtime(true);
133-
if (PHP_VERSION_ID >= 80400 && $writer instanceof Dompdf) {
134-
@$writer->save($path);
135-
} else {
136-
$writer->save($path);
137-
}
132+
$writer->save($path);
138133
$this->logWrite($writer, $path, $callStartTime);
139134
if ($this->isCli() === false) {
140135
// @codeCoverageIgnoreStart

src/PhpSpreadsheet/ReferenceHelper.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1217,7 +1217,7 @@ private function duplicateStylesByRow(Worksheet $worksheet, int $beforeColumn, i
12171217
if ($worksheet->cellExists($coordinate)) {
12181218
$xfIndex = $worksheet->getCell($coordinate)->getXfIndex();
12191219
for ($j = $beforeRow; $j <= $beforeRow - 1 + $numberOfRows; ++$j) {
1220-
if (!empty($xfIndex) || $worksheet->cellExists([$j, $i])) {
1220+
if (!empty($xfIndex) || $worksheet->cellExists([$i, $j])) {
12211221
$worksheet->getCell(Coordinate::stringFromColumnIndex($i) . $j)->setXfIndex($xfIndex);
12221222
}
12231223
}

tests/PhpSpreadsheetTests/Functional/StreamTest.php

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +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-
* @runTestsInSeparateProcesses
16-
*/
1711
class StreamTest extends TestCase
1812
{
1913
public static function providerFormats(): array
@@ -48,11 +42,7 @@ public function testAllWritersCanWriteToStream(string $format): void
4842
} else {
4943
self::assertSame(0, $stat['size']);
5044

51-
if ($format === 'Dompdf' && PHP_VERSION_ID >= 80400) {
52-
@$writer->save($stream);
53-
} else {
54-
$writer->save($stream);
55-
}
45+
$writer->save($stream);
5646

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

0 commit comments

Comments
 (0)