Skip to content

Commit df6d824

Browse files
authored
Update Mpdf (Php8.5) release1291 (#4592)
* Update Mpdf (Php8.5) release1291 * Don't use setAccessible for Php8.1+ * Fix Test
1 parent fc0d8bd commit df6d824

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
@@ -41,13 +41,18 @@ private function setUpWorkbook(): void
4141
$this->workbook = new Workbook($spreadsheet, $strTotal, $strUnique, $str_table, $colors, $parser);
4242
}
4343

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

5257
foreach ($testColors as $testColor) {
5358
$methodAddColor->invoke($this->workbook, $testColor);
@@ -75,7 +80,9 @@ public function arrayAddColor(): array
7580

7681
$workbookReflection = new ReflectionClass(Workbook::class);
7782
$propertyPalette = $workbookReflection->getProperty('palette');
78-
$propertyPalette->setAccessible(true);
83+
if (self::$accessibleNoop > PHP_VERSION_ID) {
84+
$propertyPalette->setAccessible(true);
85+
}
7986

8087
$palette = $propertyPalette->getValue($this->workbook);
8188

0 commit comments

Comments
 (0)