Skip to content

Commit 3ce4ece

Browse files
committed
Fix CI test failures and use proper import in Xlsx writer
1 parent ab5f9d4 commit 3ce4ece

3 files changed

Lines changed: 6 additions & 5 deletions

File tree

src/PhpSpreadsheet/Writer/Xlsx.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
use PhpOffice\PhpSpreadsheet\Calculation\Calculation;
66
use PhpOffice\PhpSpreadsheet\Calculation\Functions;
77
use PhpOffice\PhpSpreadsheet\HashTable;
8+
use PhpOffice\PhpSpreadsheet\Parallel\ParallelExecutor;
89
use PhpOffice\PhpSpreadsheet\RichText\RichText;
910
use PhpOffice\PhpSpreadsheet\Spreadsheet;
1011
use PhpOffice\PhpSpreadsheet\Style\Borders;
@@ -419,7 +420,7 @@ public function save($filename, int $flags = 0): void
419420
$sheetCount = $this->spreadSheet->getSheetCount();
420421
// Add worksheets
421422
if ($this->parallelEnabled && $sheetCount > 1) {
422-
$executor = new \PhpOffice\PhpSpreadsheet\Parallel\ParallelExecutor(null, $this->maxWorkers);
423+
$executor = new ParallelExecutor(null, $this->maxWorkers);
423424
/** @var list<string> $sheetXmls */
424425
$sheetXmls = $executor->map(
425426
range(0, $sheetCount - 1),

tests/PhpSpreadsheetTests/Parallel/CpuDetectorTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,8 +129,8 @@ public function testFromNproc(): void
129129
if (PHP_OS_FAMILY === 'Windows') {
130130
self::assertNull($result);
131131
} else {
132-
self::assertIsInt($result);
133-
self::assertGreaterThan(0, $result);
132+
// nproc may not be available on all Unix systems (e.g., macOS without coreutils)
133+
self::assertTrue($result === null || $result > 0);
134134
}
135135
}
136136

tests/PhpSpreadsheetTests/Parallel/ParallelExecutorTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -310,8 +310,8 @@ public function testGetMemoryLimitBytesFormats(string $iniValue, int $expected):
310310
public static function memoryLimitProvider(): array
311311
{
312312
return [
313-
'megabytes' => ['512M', 512 * 1024 * 1024],
314-
'gigabytes' => ['2G', 2 * 1024 * 1024 * 1024],
313+
'megabytes' => ['2048M', 2048 * 1024 * 1024],
314+
'gigabytes' => ['4G', 4 * 1024 * 1024 * 1024],
315315
];
316316
}
317317

0 commit comments

Comments
 (0)