Passed
Push — master ( 9ff768...b736eb )
by Laurens
02:33
created

VatParser   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 1
dl 0
loc 15
ccs 5
cts 5
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A parseArray() 0 9 2
1
<?php
2
3
declare(strict_types=1);
4
5
namespace LauLamanApps\IzettleApi\Client\Purchase;
6
7
use Money\Currency;
8
use Money\Money;
9
10
final class VatParser
11
{
12
    /**
13
     * @return Money[]
14
     */
15 3
    public static function parseArray(array $vatAmounts, Currency $currency): array
16
    {
17 3
        $data = [];
18 3
        foreach ($vatAmounts as $vat => $amount) {
19 1
            $data[$vat] = new Money($amount, $currency);
20
        }
21
22 3
        return $data;
23
    }
24
}
25