Conditions | 4 |
Paths | 4 |
Total Lines | 15 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Tests | 8 |
CRAP Score | 4 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
21 | 28 | public static function funcSum(...$args) |
|
22 | { |
||
23 | 28 | $returnValue = 0; |
|
24 | |||
25 | // Loop through the arguments |
||
26 | 28 | foreach (Functions::flattenArray($args) as $arg) { |
|
27 | // Is it a numeric value? |
||
28 | 28 | if (is_numeric($arg)) { |
|
29 | 27 | $returnValue += $arg; |
|
30 | 4 | } elseif (Functions::isError($arg)) { |
|
31 | 1 | return $arg; |
|
32 | } |
||
33 | } |
||
34 | |||
35 | 27 | return $returnValue; |
|
36 | } |
||
69 |