From 07d68b3bc8fa81484e0000eb8f64fafb54c1ce25 Mon Sep 17 00:00:00 2001 From: Robin van der Vliet Date: Thu, 13 Nov 2025 19:03:21 +0100 Subject: [PATCH] Add support for remaining types --- .../Calculation/Information/Info.php | 7 ++++++ tests/data/Calculation/Information/INFO.php | 24 +++++++++++++++++++ 2 files changed, 31 insertions(+) diff --git a/src/PhpSpreadsheet/Calculation/Information/Info.php b/src/PhpSpreadsheet/Calculation/Information/Info.php index fd4fb17c6..61138fe1e 100644 --- a/src/PhpSpreadsheet/Calculation/Information/Info.php +++ b/src/PhpSpreadsheet/Calculation/Information/Info.php @@ -7,6 +7,9 @@ use PhpOffice\PhpSpreadsheet\Cell\Cell; class Info { + /** + * @internal + */ public static bool $infoSupported = true; /** @@ -27,10 +30,14 @@ class Info } return match (is_string($typeText) ? strtolower($typeText) : $typeText) { + 'directory' => '/', 'numfile' => $cell?->getWorksheetOrNull()?->getParent()?->getSheetCount() ?? 1, + 'origin' => '$A:$A$1', 'osversion' => 'PHP ' . PHP_VERSION, 'recalc' => 'Automatic', + 'release' => PHP_VERSION, 'system' => 'PHP', + 'memavail', 'memused', 'totmem' => ExcelError::NA(), default => ExcelError::VALUE(), }; } diff --git a/tests/data/Calculation/Information/INFO.php b/tests/data/Calculation/Information/INFO.php index 36e3eb582..9b46d7e31 100644 --- a/tests/data/Calculation/Information/INFO.php +++ b/tests/data/Calculation/Information/INFO.php @@ -3,10 +3,18 @@ declare(strict_types=1); return [ + [ + '/', + 'directory', + ], [ 1, 'numfile', ], + [ + '$A:$A$1', + 'origin', + ], [ 'PHP ' . PHP_VERSION, 'osversion', @@ -19,10 +27,26 @@ return [ 'Automatic', 'RECALC', ], + [ + PHP_VERSION, + 'release', + ], [ 'PHP', 'system', ], + [ + '#N/A', + 'memavail', + ], + [ + '#N/A', + 'memused', + ], + [ + '#N/A', + 'totmem', + ], [ '#VALUE!', '1',