Product   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 4
eloc 6
dl 0
loc 15
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A scalar() 0 10 4
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Phpml\Math;
6
7
class Product
8
{
9
    /**
10
     * @return mixed
11
     */
12
    public static function scalar(array $a, array $b)
13
    {
14
        $product = 0;
15
        foreach ($a as $index => $value) {
16
            if (is_numeric($value) && is_numeric($b[$index])) {
17
                $product += (float) $value * (float) $b[$index];
18
            }
19
        }
20
21
        return $product;
22
    }
23
}
24