BankAccount::setIban()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

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