Cancelled
Pull Request — master (#11)
by Laurens
23:42
created

VatBuilder   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 12
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 12
ccs 5
cts 5
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A createFromJson() 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 VatBuilder implements VatBuilderInterface
11
{
12 1
    public function createFromJson(array $vatAmounts, Currency $currency): array
13
    {
14 1
        $data = [];
15 1
        foreach ($vatAmounts as $vat => $amount) {
16 1
            $data[$vat] = new Money($amount, $currency);
17
        }
18
19 1
        return $data;
20
    }
21
}
22