Skip to content

Commit 07d68b3

Browse files
Add support for remaining types
1 parent 536c63e commit 07d68b3

File tree

2 files changed

+31
-0
lines changed
  • src/PhpSpreadsheet/Calculation/Information
  • tests/data/Calculation/Information

2 files changed

+31
-0
lines changed

src/PhpSpreadsheet/Calculation/Information/Info.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77

88
class Info
99
{
10+
/**
11+
* @internal
12+
*/
1013
public static bool $infoSupported = true;
1114

1215
/**
@@ -27,10 +30,14 @@ public static function getInfo(mixed $typeText = '', ?Cell $cell = null): int|st
2730
}
2831

2932
return match (is_string($typeText) ? strtolower($typeText) : $typeText) {
33+
'directory' => '/',
3034
'numfile' => $cell?->getWorksheetOrNull()?->getParent()?->getSheetCount() ?? 1,
35+
'origin' => '$A:$A$1',
3136
'osversion' => 'PHP ' . PHP_VERSION,
3237
'recalc' => 'Automatic',
38+
'release' => PHP_VERSION,
3339
'system' => 'PHP',
40+
'memavail', 'memused', 'totmem' => ExcelError::NA(),
3441
default => ExcelError::VALUE(),
3542
};
3643
}

tests/data/Calculation/Information/INFO.php

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,18 @@
33
declare(strict_types=1);
44

55
return [
6+
[
7+
'/',
8+
'directory',
9+
],
610
[
711
1,
812
'numfile',
913
],
14+
[
15+
'$A:$A$1',
16+
'origin',
17+
],
1018
[
1119
'PHP ' . PHP_VERSION,
1220
'osversion',
@@ -19,10 +27,26 @@
1927
'Automatic',
2028
'RECALC',
2129
],
30+
[
31+
PHP_VERSION,
32+
'release',
33+
],
2234
[
2335
'PHP',
2436
'system',
2537
],
38+
[
39+
'#N/A',
40+
'memavail',
41+
],
42+
[
43+
'#N/A',
44+
'memused',
45+
],
46+
[
47+
'#N/A',
48+
'totmem',
49+
],
2650
[
2751
'#VALUE!',
2852
'1',

0 commit comments

Comments
 (0)