File tree Expand file tree Collapse file tree 5 files changed +35
-4
lines changed
src/PhpSpreadsheet/Calculation Expand file tree Collapse file tree 5 files changed +35
-4
lines changed Original file line number Diff line number Diff line change @@ -189,7 +189,7 @@ Excel Function | PhpSpreadsheet Function
189189-------------------------|--------------------------------------
190190CELL | ** Not yet Implemented**
191191ERROR.TYPE | \PhpOffice\PhpSpreadsheet\Calculation\Information\ExcelError::type
192- INFO | ** Not yet Implemented **
192+ INFO | \PhpOffice\PhpSpreadsheet\Calculation\Information\Info::getInfo
193193ISBLANK | \PhpOffice\PhpSpreadsheet\Calculation\Information\Value::isBlank
194194ISERR | \PhpOffice\PhpSpreadsheet\Calculation\Information\ErrorValue::isErr
195195ISERROR | \PhpOffice\PhpSpreadsheet\Calculation\Information\ErrorValue::isError
Original file line number Diff line number Diff line change @@ -299,7 +299,7 @@ IMSUM | ENGINEERING | Engineering\ComplexOperations
299299IMTAN | ENGINEERING | Engineering\ComplexFunctions::IMTAN
300300INDEX | LOOKUP_AND_REFERENCE | LookupRef\Matrix::index
301301INDIRECT | LOOKUP_AND_REFERENCE | LookupRef\Indirect::INDIRECT
302- INFO | INFORMATION | ** Not yet Implemented **
302+ INFO | INFORMATION | Information\Info::getInfo
303303INT | MATH_AND_TRIG | MathTrig\IntClass::evaluate
304304INTERCEPT | STATISTICAL | Statistical\Trends::INTERCEPT
305305INTRATE | FINANCIAL | Financial\Securities\Rates::interest
Original file line number Diff line number Diff line change @@ -295,7 +295,7 @@ IMSUM | CATEGORY_ENGINEERING | \PhpOffice\PhpSpread
295295IMTAN | CATEGORY_ENGINEERING | \PhpOffice\PhpSpreadsheet\Calculation\Engineering\ComplexFunctions::IMTAN
296296INDEX | CATEGORY_LOOKUP_AND_REFERENCE | \PhpOffice\PhpSpreadsheet\Calculation\LookupRef\Matrix::index
297297INDIRECT | CATEGORY_LOOKUP_AND_REFERENCE | \PhpOffice\PhpSpreadsheet\Calculation\LookupRef\Indirect::INDIRECT
298- INFO | CATEGORY_INFORMATION | ** Not yet Implemented **
298+ INFO | CATEGORY_INFORMATION | \PhpOffice\PhpSpreadsheet\Calculation\Information\Info::getInfo
299299INT | CATEGORY_MATH_AND_TRIG | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig\IntClass::evaluate
300300INTERCEPT | CATEGORY_STATISTICAL | \PhpOffice\PhpSpreadsheet\Calculation\Statistical\Trends::INTERCEPT
301301INTRATE | CATEGORY_FINANCIAL | \PhpOffice\PhpSpreadsheet\Calculation\Financial\Securities\Rates::interest
Original file line number Diff line number Diff line change @@ -1284,8 +1284,9 @@ class FunctionArray extends CalculationBase
12841284 ],
12851285 'INFO ' => [
12861286 'category ' => Category::CATEGORY_INFORMATION ,
1287- 'functionCall ' => [Functions ::class, 'DUMMY ' ],
1287+ 'functionCall ' => [Information \Info ::class, 'getInfo ' ],
12881288 'argumentCount ' => '1 ' ,
1289+ 'passCellReference ' => true ,
12891290 ],
12901291 'INT ' => [
12911292 'category ' => Category::CATEGORY_MATH_AND_TRIG ,
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ namespace PhpOffice \PhpSpreadsheet \Calculation \Information ;
4+
5+ use PhpOffice \PhpSpreadsheet \Cell \Cell ;
6+
7+ class Info
8+ {
9+ /**
10+ * INFO.
11+ *
12+ * Excel Function:
13+ * =INFO(type_text)
14+ *
15+ * @param mixed $typeText String specifying the type of information to be returned
16+ * @param ?Cell $cell Cell from which spreadsheet information is retrieved
17+ *
18+ * @return string The requested information about the current operating environment
19+ */
20+ public static function getInfo (mixed $ typeText = '' , ?Cell $ cell = null ): string
21+ {
22+ return match (is_string ($ typeText ) ? strtolower ($ typeText ) : $ typeText ) {
23+ 'numfile ' => $ cell ?->getWorksheetOrNull()?->getParent()?->getSheetCount() ?? 1 ,
24+ 'osversion ' => 'PHP ' . phpversion (),
25+ 'recalc ' => 'Automatic ' ,
26+ 'system ' => 'PHP ' ,
27+ default => ExcelError::VALUE (),
28+ };
29+ }
30+ }
You can’t perform that action at this time.
0 commit comments