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

VatParser::parseArray()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 9
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 2

Importance

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