BankAccount   A
last analyzed

Complexity

Total Complexity 9

Size/Duplication

Total Lines 69
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 25
c 0
b 0
f 0
dl 0
loc 69
rs 10
wmc 9

9 Methods

Rating   Name   Duplication   Size   Complexity  
A getTransactionUid() 0 3 1
A getBalanceDate() 0 3 1
A getBalance() 0 3 1
A getStatement() 0 3 1
A getAccountType() 0 3 1
A __construct() 0 18 1
A getAgencyNumber() 0 3 1
A getAccountNumber() 0 3 1
A getRoutingNumber() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Beccha\OfxParser\Entity;
6
7
use DateTime;
8
9
final class BankAccount
10
{
11
    private string $agencyNumber;
12
    private string $accountNumber;
13
    private string $accountType;
14
    private int $balance;
15
    private DateTime $balanceDate;
16
    private string $routingNumber;
17
    private Statement $statement;
18
    private string $transactionUid;
19
20
    public function __construct(
21
        string $agencyNumber,
22
        string $accountNumber,
23
        string $accountType,
24
        float $balance,
25
        DateTime $balanceDate,
26
        string $routingNumber,
27
        Statement $statement,
28
        string $transactionUid
29
    ) {
30
        $this->agencyNumber = $agencyNumber;
31
        $this->accountNumber = $accountNumber;
32
        $this->accountType = $accountType;
33
        $this->balance = (int)\bcmul((string)$balance, '100');
34
        $this->balanceDate = $balanceDate;
35
        $this->routingNumber = $routingNumber;
36
        $this->statement = $statement;
37
        $this->transactionUid = $transactionUid;
38
    }
39
40
    public function getAgencyNumber(): string
41
    {
42
        return $this->agencyNumber;
43
    }
44
45
    public function getAccountNumber(): string
46
    {
47
        return $this->accountNumber;
48
    }
49
50
    public function getAccountType(): string
51
    {
52
        return $this->accountType;
53
    }
54
55
    public function getBalance(): int
56
    {
57
        return $this->balance;
58
    }
59
60
    public function getBalanceDate(): DateTime
61
    {
62
        return $this->balanceDate;
63
    }
64
65
    public function getRoutingNumber(): string
66
    {
67
        return $this->routingNumber;
68
    }
69
70
    public function getStatement(): Statement
71
    {
72
        return $this->statement;
73
    }
74
75
    public function getTransactionUid(): string
76
    {
77
        return $this->transactionUid;
78
    }
79
}
80