PluginProbe
TablePress – Tables in WordPress made easy / 3.4
TablePress – Tables in WordPress made easy v3.4
3.4 3.3.4 3.3.3 3.3.2 3.3.1 trunk 1.12 1.14 1.9.2 2.0.4 2.1.7 2.1.8 2.2 2.2.1 2.2.2 2.2.3 2.2.4 2.2.5 2.3 2.3.1 2.3.2 2.4 2.4.1 2.4.2 2.4.3 All 45 releases
tablepress / libraries / vendor / PhpSpreadsheet / Calculation / Information / Info.php

Info.php in TablePress – Tables in WordPress made easy 3.4, at libraries/vendor/PhpSpreadsheet/Calculation/Information/Info.php

56 lines 1.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace TablePress\PhpOffice\PhpSpreadsheet\Calculation\Information;
4
5 use TablePress\PhpOffice\PhpSpreadsheet\Calculation\Functions;
6 use TablePress\PhpOffice\PhpSpreadsheet\Cell\Cell;
7
8 class Info
9 {
10 /**
11 * @internal
12 */
13 public static bool $infoSupported = true;
14
15 /**
16 * INFO.
17 *
18 * Excel Function:
19 * =INFO(type_text)
20 *
21 * @param mixed $typeText String specifying the type of information to be returned
22 * @param ?Cell $cell Cell from which spreadsheet information is retrieved
23 *
24 * @return int|string The requested information about the current operating environment
25 */
26 public static function getInfo($typeText = '', ?Cell $cell = null)
27 {
28 if (!self::$infoSupported) {
29 return Functions::DUMMY();
30 }
31
32 switch (is_string($typeText) ? strtolower($typeText) : $typeText) {
33 case 'directory':
34 return '/';
35 case 'numfile':
36 return (($nullsafeVariable1 = ($nullsafeVariable2 = ($nullsafeVariable3 = $cell) ? $nullsafeVariable3->getWorksheetOrNull() : null) ? $nullsafeVariable2->getParent() : null) ? $nullsafeVariable1->getSheetCount() : null) ?? 1;
37 case 'origin':
38 return '$A:$A$1';
39 case 'osversion':
40 return 'PHP ' . PHP_VERSION;
41 case 'recalc':
42 return 'Automatic';
43 case 'release':
44 return PHP_VERSION;
45 case 'system':
46 return 'PHP';
47 case 'memavail':
48 case 'memused':
49 case 'totmem':
50 return ExcelError::NA();
51 default:
52 return ExcelError::VALUE();
53 }
54 }
55 }
56