Skip to content

Commit 1fdee23

Browse files
authored
Update Mpdf (Php8.5 compatibility) r210 (#4593)
1 parent 9300fca commit 1fdee23

File tree

2 files changed

+18
-11
lines changed

2 files changed

+18
-11
lines changed

composer.lock

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

tests/PhpSpreadsheetTests/Writer/Xls/WorkbookTest.php

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,18 @@ private function setUpWorkbook(): void
4040
$this->workbook = new Workbook($spreadsheet, $strTotal, $strUnique, $str_table, $colors, $parser);
4141
}
4242

43+
/** @var int */
44+
protected static $accessibleNoop = 80100;
45+
4346
public function xtestAddColor(array $testColors, array $expectedResult): void
4447
{
4548
$workbookReflection = new ReflectionClass(Workbook::class);
4649
$methodAddColor = $workbookReflection->getMethod('addColor');
4750
$propertyPalette = $workbookReflection->getProperty('palette');
48-
$methodAddColor->setAccessible(true);
49-
$propertyPalette->setAccessible(true);
51+
if (self::$accessibleNoop > PHP_VERSION_ID) {
52+
$methodAddColor->setAccessible(true);
53+
$propertyPalette->setAccessible(true);
54+
}
5055

5156
foreach ($testColors as $testColor) {
5257
$methodAddColor->invoke($this->workbook, $testColor);
@@ -74,7 +79,9 @@ public function arrayAddColor(): array
7479

7580
$workbookReflection = new ReflectionClass(Workbook::class);
7681
$propertyPalette = $workbookReflection->getProperty('palette');
77-
$propertyPalette->setAccessible(true);
82+
if (self::$accessibleNoop > PHP_VERSION_ID) {
83+
$propertyPalette->setAccessible(true);
84+
}
7885

7986
$palette = $propertyPalette->getValue($this->workbook);
8087
self::assertIsArray($palette);

0 commit comments

Comments
 (0)