CALCULATION_REGEXP_NUMBER
CALCULATION_REGEXP_NUMBER = '[-+]?\d*\.?\d+(e[-+]?\d+)?'
$instance : \PhpOffice\PhpSpreadsheet\Calculation\Calculation
Instance of this class.
$spreadsheet : \PhpOffice\PhpSpreadsheet\Spreadsheet
Instance of the spreadsheet this Calculation Engine is using.
$debugLog : \PhpOffice\PhpSpreadsheet\Calculation\Engine\Logger
The debug log generated by the calculation engine.
__construct(\PhpOffice\PhpSpreadsheet\Spreadsheet $spreadsheet = null)
\PhpOffice\PhpSpreadsheet\Spreadsheet | $spreadsheet |
getInstance(\PhpOffice\PhpSpreadsheet\Spreadsheet $spreadsheet = null) : \PhpOffice\PhpSpreadsheet\Calculation\Calculation
Get an instance of this class.
\PhpOffice\PhpSpreadsheet\Spreadsheet | $spreadsheet | Injected spreadsheet for working with a PhpSpreadsheet Spreadsheet object, or NULL to create a standalone claculation engine |
getDebugLog() : \PhpOffice\PhpSpreadsheet\Calculation\Engine\Logger
Get the Logger for this calculation engine instance.
calculate(\PhpOffice\PhpSpreadsheet\Cell\Cell $pCell = null) : mixed
Calculate cell value (using formula from a cell ID) Retained for backward compatibility.
\PhpOffice\PhpSpreadsheet\Cell\Cell | $pCell | Cell to calculate |
calculateCellValue(\PhpOffice\PhpSpreadsheet\Cell\Cell $pCell = null, boolean $resetLog = true) : mixed
Calculate the value of a cell formula.
\PhpOffice\PhpSpreadsheet\Cell\Cell | $pCell | Cell to calculate |
boolean | $resetLog | Flag indicating whether the debug log should be reset or not |
calculateFormula(string $formula, string $cellID = null, \PhpOffice\PhpSpreadsheet\Cell\Cell $pCell = null) : mixed
Calculate the value of a formula.
string | $formula | Formula to parse |
string | $cellID | Address of the cell to calculate |
\PhpOffice\PhpSpreadsheet\Cell\Cell | $pCell | Cell to calculate |
_calculateFormulaValue(string $formula, string $cellID = null, \PhpOffice\PhpSpreadsheet\Cell\Cell $pCell = null) : mixed
Parse a cell formula and calculate its value.
string | $formula | The formula to parse and calculate |
string | $cellID | The ID (e.g. A3) of the cell that we are calculating |
\PhpOffice\PhpSpreadsheet\Cell\Cell | $pCell | Cell to calculate |
getMatrixDimensions(array $matrix) : array<mixed,integer>
Read the dimensions of a matrix, and re-index it with straight numeric keys starting from row 0, column 0.
array | $matrix |
An array comprising the number of rows, and number of columns
extractCellRange( $pRange = 'A1', \PhpOffice\PhpSpreadsheet\Worksheet\Worksheet $pSheet = null, boolean $resetLog = true) : mixed
Extract range values.
$pRange | ||
\PhpOffice\PhpSpreadsheet\Worksheet\Worksheet | $pSheet | Worksheet |
boolean | $resetLog | Flag indicating whether calculation log should be reset or not |
Array of values in range if range contains more than one element. Otherwise, a single value is returned.
extractNamedRange( $pRange = 'A1', \PhpOffice\PhpSpreadsheet\Worksheet\Worksheet $pSheet = null, boolean $resetLog = true) : mixed
Extract range values.
$pRange | ||
\PhpOffice\PhpSpreadsheet\Worksheet\Worksheet | $pSheet | Worksheet |
boolean | $resetLog | Flag indicating whether calculation log should be reset or not |
Array of values in range if range contains more than one element. Otherwise, a single value is returned.
checkMatrixOperands( $operand1, $operand2, integer $resize = 1) : array
Ensure that paired matrix operands are both matrices and of the same size.
$operand1 | ||
$operand2 | ||
integer | $resize | Flag indicating whether the matrices should be resized to match and (if so), whether the smaller dimension should grow or the larger should shrink. 0 = no resize 1 = shrink to fit 2 = extend to fit |
resizeMatricesShrink( $matrix1, $matrix2, integer $matrix1Rows, integer $matrix1Columns, integer $matrix2Rows, integer $matrix2Columns)
Ensure that paired matrix operands are both matrices of the same size.
$matrix1 | ||
$matrix2 | ||
integer | $matrix1Rows | Row size of first matrix operand |
integer | $matrix1Columns | Column size of first matrix operand |
integer | $matrix2Rows | Row size of second matrix operand |
integer | $matrix2Columns | Column size of second matrix operand |
resizeMatricesExtend( $matrix1, $matrix2, integer $matrix1Rows, integer $matrix1Columns, integer $matrix2Rows, integer $matrix2Columns)
Ensure that paired matrix operands are both matrices of the same size.
$matrix1 | ||
$matrix2 | ||
integer | $matrix1Rows | Row size of first matrix operand |
integer | $matrix1Columns | Column size of first matrix operand |
integer | $matrix2Rows | Row size of second matrix operand |
integer | $matrix2Columns | Column size of second matrix operand |
_parseFormula(string $formula, null|\PhpOffice\PhpSpreadsheet\Cell\Cell $pCell = null) : boolean
string | $formula | |
null|\PhpOffice\PhpSpreadsheet\Cell\Cell | $pCell |
processTokenStack(mixed $tokens, null|string $cellID = null, null|\PhpOffice\PhpSpreadsheet\Cell\Cell $pCell = null) : boolean
mixed | $tokens | |
null|string | $cellID | |
null|\PhpOffice\PhpSpreadsheet\Cell\Cell | $pCell |
executeBinaryComparisonOperation(null|string $cellID, mixed $operand1, mixed $operand2, string $operation, \PhpOffice\PhpSpreadsheet\Calculation\Token\Stack $stack, boolean $recursingArrays = false) : boolean
null|string | $cellID | |
mixed | $operand1 | |
mixed | $operand2 | |
string | $operation | |
\PhpOffice\PhpSpreadsheet\Calculation\Token\Stack | $stack | |
boolean | $recursingArrays |
strcmpLowercaseFirst(string $str1, string $str2) : integer
Compare two strings in the same way as strcmp() except that lowercase come before uppercase letters.
string | $str1 | First string value for the comparison |
string | $str2 | Second string value for the comparison |
addCellReference(array $args, boolean $passCellReference, array|string $functionCall, null|\PhpOffice\PhpSpreadsheet\Cell\Cell $pCell = null) : array
Add cell reference if needed while making sure that it is the last argument.
array | $args | |
boolean | $passCellReference | |
array|string | $functionCall | |
null|\PhpOffice\PhpSpreadsheet\Cell\Cell | $pCell |