Skip to content

Commit

Permalink
Avoid func prefix in function name
Browse files Browse the repository at this point in the history
As decided in
#1954 (comment)
  • Loading branch information
PowerKiKi committed May 14, 2021
1 parent 4bd506b commit ac5b96d
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/PhpSpreadsheet/Calculation/Calculation.php
Expand Up @@ -2314,7 +2314,7 @@ class Calculation
],
'SUM' => [
'category' => Category::CATEGORY_MATH_AND_TRIG,
'functionCall' => [MathTrig\Sum::class, 'funcSumNoStrings'],
'functionCall' => [MathTrig\Sum::class, 'sumErroringStrings'],
'argumentCount' => '1+',
],
'SUMIF' => [
Expand Down
2 changes: 1 addition & 1 deletion src/PhpSpreadsheet/Calculation/Database/DSum.php
Expand Up @@ -38,7 +38,7 @@ public static function evaluate($database, $field, $criteria)
return null;
}

return MathTrig\Sum::funcSum(
return MathTrig\Sum::sumIgnoringStrings(
self::getFilteredColumn($database, $field, $criteria)
);
}
Expand Down
6 changes: 3 additions & 3 deletions src/PhpSpreadsheet/Calculation/MathTrig.php
Expand Up @@ -771,8 +771,8 @@ public static function SUBTOTAL($functionType, ...$args)
*
* @Deprecated 1.18.0
*
* @See MathTrig\Sum::funcSumNoStrings()
* Use the funcSumNoStrings method in the MathTrig\Sum class instead
* @See MathTrig\Sum::sumErroringStrings()
* Use the sumErroringStrings method in the MathTrig\Sum class instead
*
* Excel Function:
* SUM(value1[,value2[, ...]])
Expand All @@ -783,7 +783,7 @@ public static function SUBTOTAL($functionType, ...$args)
*/
public static function SUM(...$args)
{
return MathTrig\Sum::funcSum(...$args);
return MathTrig\Sum::sumIgnoringStrings(...$args);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/PhpSpreadsheet/Calculation/MathTrig/Subtotal.php
Expand Up @@ -60,7 +60,7 @@ function ($index) use ($cellReference) {
[Product::class, 'evaluate'], // 6
[Statistical\StandardDeviations::class, 'STDEV'], // 7
[Statistical\StandardDeviations::class, 'STDEVP'], // 8
[Sum::class, 'funcSum'], // 9
[Sum::class, 'sumIgnoringStrings'], // 9
[Statistical\Variances::class, 'VAR'], // 10
[Statistical\Variances::class, 'VARP'], // 11
];
Expand Down
4 changes: 2 additions & 2 deletions src/PhpSpreadsheet/Calculation/MathTrig/Sum.php
Expand Up @@ -18,7 +18,7 @@ class Sum
*
* @return float|string
*/
public static function funcSum(...$args)
public static function sumIgnoringStrings(...$args)
{
$returnValue = 0;

Expand Down Expand Up @@ -47,7 +47,7 @@ public static function funcSum(...$args)
*
* @return float|string
*/
public static function funcSumNoStrings(...$args)
public static function sumErroringStrings(...$args)
{
$returnValue = 0;
// Loop through the arguments
Expand Down

0 comments on commit ac5b96d

Please sign in to comment.