Conditions | 5 |
Paths | 7 |
Total Lines | 25 |
Code Lines | 12 |
Lines | 0 |
Ratio | 0 % |
Tests | 11 |
CRAP Score | 5 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
21 | 20 | public static function funcProduct(...$args) |
|
22 | { |
||
23 | // Return value |
||
24 | 20 | $returnValue = null; |
|
25 | |||
26 | // Loop through arguments |
||
27 | 20 | foreach (Functions::flattenArray($args) as $arg) { |
|
28 | // Is it a numeric value? |
||
29 | 19 | if (is_numeric($arg)) { |
|
30 | 19 | if ($returnValue === null) { |
|
31 | 19 | $returnValue = $arg; |
|
32 | } else { |
||
33 | 19 | $returnValue *= $arg; |
|
34 | } |
||
35 | } else { |
||
36 | 1 | return Functions::VALUE(); |
|
37 | } |
||
38 | } |
||
39 | |||
40 | // Return |
||
41 | 19 | if ($returnValue === null) { |
|
42 | 1 | return 0; |
|
43 | } |
||
44 | |||
45 | 18 | return $returnValue; |
|
46 | } |
||
48 |