BankAccount   A
last analyzed

Complexity

Total Complexity 6

Size/Duplication

Total Lines 47
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 2
Bugs 1 Features 0
Metric Value
eloc 12
dl 0
loc 47
ccs 15
cts 15
cp 1
rs 10
c 2
b 1
f 0
wmc 6

6 Methods

Rating   Name   Duplication   Size   Complexity  
A setAccountHolder() 0 3 1
A toArray() 0 5 1
A __construct() 0 4 1
A getIban() 0 3 1
A getAccountHolder() 0 3 1
A setIban() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace VasilDakov\Speedy\Model;
6
7
use JMS\Serializer\Annotation as Serializer;
8
use VasilDakov\Speedy\Property;
9
use VasilDakov\Speedy\Speedy;
10
11
/**
12
 * Class BankAccount.
13
 *
14
 * @Serializer\AccessType("public_method")
15
 *
16
 * @author Valentin Valkanov <[email protected]>
17
 * @copyright
18
 *
19
 * @version
20
 *
21
 * @psalm-suppress MissingConstructor
22
 */
23
class BankAccount
24
{
25
    /**
26
     * @Serializer\Type("string")
27
     */
28
    private string $iban;
29
30
    /**
31
     * @Serializer\Type("string")
32
     * TODO Validated according to IBAN standards
33
     */
34
    private string $accountHolder;
35
36 1
    public function __construct(string $iban, string $accountHolder)
37
    {
38 1
        $this->iban = $iban;
39 1
        $this->accountHolder = $accountHolder;
40
    }
41
42 1
    public function getIban(): string
43
    {
44 1
        return $this->iban;
45
    }
46
47 2
    public function setIban(string $iban): void
48
    {
49 2
        $this->iban = $iban;
50
    }
51
52 1
    public function getAccountHolder(): string
53
    {
54 1
        return $this->accountHolder;
55
    }
56
57 2
    public function setAccountHolder(string $accountHolder): void
58
    {
59 2
        $this->accountHolder = $accountHolder;
60
    }
61
62
    /**
63
     * @return string[]
64
     */
65 1
    public function toArray(): array
66
    {
67 1
        return [
68 1
            Property::IBAN->value => $this->getIban(),
69 1
            Property::ACCOUNT_HOLDER->value => $this->getAccountHolder(),
70 1
        ];
71
    }
72
}
73