Completed
Push — develop ( 933078...118ee0 )
by Arkadiusz
02:34
created

Product   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 2
c 1
b 0
f 1
lcom 0
cbo 0
dl 0
loc 20
rs 10

1 Method

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