generated from jric11/baseProject
Codex's updates...
This commit is contained in:
+25
-1
@@ -32,6 +32,25 @@ class Subtotal
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param mixed[] $args
|
||||
*
|
||||
* @return mixed[]
|
||||
*/
|
||||
protected static function filterFilteredArgs(Cell $cellReference, array $args): array
|
||||
{
|
||||
return array_filter(
|
||||
$args,
|
||||
function ($index) use ($cellReference) {
|
||||
$explodeArray = explode('.', $index);
|
||||
$row = $explodeArray[1] ?? '';
|
||||
|
||||
return is_numeric($row) ? ($cellReference->getWorksheet()->getRowDimension((int) $row)->getVisibleAfterFilter()) : true;
|
||||
},
|
||||
ARRAY_FILTER_USE_KEY
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param mixed[] $args
|
||||
*
|
||||
@@ -125,13 +144,18 @@ class Subtotal
|
||||
if ($subtotal > 100) {
|
||||
$aArgs = self::filterHiddenArgs($cellReference, $aArgs);
|
||||
$subtotal -= 100;
|
||||
} else {
|
||||
$aArgs = self::filterFilteredArgs($cellReference, $aArgs);
|
||||
}
|
||||
|
||||
$aArgs = self::filterFormulaArgs($cellReference, $aArgs);
|
||||
if (array_key_exists($subtotal, self::CALL_FUNCTIONS)) {
|
||||
$call = self::CALL_FUNCTIONS[$subtotal];
|
||||
|
||||
return call_user_func_array($call, $aArgs); //* @phpstan-ignore-line
|
||||
/** @var float|int|string */
|
||||
$temp = call_user_func_array($call, $aArgs);
|
||||
|
||||
return $temp;
|
||||
}
|
||||
|
||||
return ExcelError::VALUE();
|
||||
|
||||
Reference in New Issue
Block a user