PHP 8.1 compatibility

This commit is contained in:
Adrien Crivelli 2022-02-18 13:14:25 +01:00
parent 0371ccb686
commit f4885d90dc
No known key found for this signature in database
GPG Key ID: 16D79B903B4B5874
1 changed files with 4 additions and 1 deletions

View File

@ -39,7 +39,10 @@ class Subtotal
if ($cellReference->getWorksheet()->cellExists($column . $row)) {
//take this cell out if it contains the SUBTOTAL or AGGREGATE functions in a formula
$isFormula = $cellReference->getWorksheet()->getCell($column . $row)->isFormula();
$cellFormula = !preg_match('/^=.*\b(SUBTOTAL|AGGREGATE)\s*\(/i', $cellReference->getWorksheet()->getCell($column . $row)->getValue());
$cellFormula = !preg_match(
'/^=.*\b(SUBTOTAL|AGGREGATE)\s*\(/i',
$cellReference->getWorksheet()->getCell($column . $row)->getValue() ?? ''
);
$retVal = !$isFormula || $cellFormula;
}