Code Coverage |
||||||||||
Classes and Traits |
Functions and Methods |
Lines |
||||||||
| Total | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
CRAP | |
100.00% |
4 / 4 |
| Product | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
2 | |
100.00% |
4 / 4 |
| scalar | |
100.00% |
1 / 1 |
2 | |
100.00% |
4 / 4 |
|||
| <?php | |
| declare (strict_types = 1); | |
| namespace Phpml\Math; | |
| class Product | |
| { | |
| /** | |
| * @param array $a | |
| * @param array $b | |
| * | |
| * @return mixed | |
| */ | |
| public static function scalar(array $a, array $b) | |
| { | |
| $product = 0; | |
| foreach ($a as $index => $value) { | |
| $product += $value * $b[$index]; | |
| } | |
| return $product; | |
| } | |
| } |