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

Product::scalar()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 9
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 9
rs 9.6666
cc 2
eloc 5
nc 2
nop 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