Charges   A
last analyzed

Complexity

Total Complexity 6

Size/Duplication

Total Lines 39
Duplicated Lines 0 %

Test Coverage

Coverage 46.15%

Importance

Changes 2
Bugs 1 Features 0
Metric Value
eloc 10
dl 0
loc 39
ccs 6
cts 13
cp 0.4615
rs 10
c 2
b 1
f 0
wmc 6

5 Methods

Rating   Name   Duplication   Size   Complexity  
A getRecords() 0 3 1
A addRecord() 0 3 1
A getRecord() 0 7 2
A setTotalChargesAndTaxAmount() 0 3 1
A getTotalChargesAndTaxAmount() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Genkgo\Camt\DTO;
6
7
use Money\Money;
8
9
class Charges
10
{
11
    private ?Money $totalChargesAndTaxAmount = null;
12
13
    /**
14
     * @var ChargesRecord[]
15
     */
16
    private array $records = [];
17
18
    public function getTotalChargesAndTaxAmount(): ?Money
19
    {
20
        return $this->totalChargesAndTaxAmount;
21
    }
22
23
    public function setTotalChargesAndTaxAmount(Money $money): void
24
    {
25
        $this->totalChargesAndTaxAmount = $money;
26 4
    }
27
28 4
    public function addRecord(ChargesRecord $record): void
29 4
    {
30
        $this->records[] = $record;
31 4
    }
32
33 4
    /**
34 4
     * @return ChargesRecord[]
35
     */
36
    public function getRecords(): array
37
    {
38
        return $this->records;
39
    }
40
41
    public function getRecord(): ?ChargesRecord
42
    {
43
        if (isset($this->records[0])) {
44
            return $this->records[0];
45
        }
46
47
        return null;
48
    }
49
}
50