PaymentType::getBankName()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
rs 10
c 1
b 0
f 0
1
<?php
2
declare(strict_types=1);
3
4
namespace Shoman4eg\Nalog\Model\PaymentType;
5
6
use Shoman4eg\Nalog\Model\CreatableFromArray;
7
8
/**
9
 * @author Artem Dubinin <[email protected]>
10
 */
11
final class PaymentType implements CreatableFromArray
12
{
13
    private int $id;
14
    private string $type;
15
    private string $bankName;
16
    private string $bankBik;
17
    private string $corrAccount;
18
    private bool $favorite;
19
    private ?string $phone;
20
    private ?string $bankId;
21
    private string $currentAccount;
22
    private bool $availableForPa;
23
24
    private function __construct() {}
25
26
    public static function createFromArray(array $data): self
27
    {
28
        $model = new self();
29
        $model->id = $data['id'];
30
        $model->type = $data['type'];
31
        $model->bankName = $data['bankName'];
32
        $model->bankBik = $data['bankBik'];
33
        $model->currentAccount = $data['currentAccount'];
34
        $model->corrAccount = $data['corrAccount'];
35
        $model->phone = $data['phone'];
36
        $model->bankId = $data['bankId'];
37
        $model->favorite = $data['favorite'];
38
        $model->availableForPa = $data['availableForPa'];
39
40
        return $model;
41
    }
42
43
    public function getId(): int
44
    {
45
        return $this->id;
46
    }
47
48
    public function getType(): string
49
    {
50
        return $this->type;
51
    }
52
53
    public function getBankName(): string
54
    {
55
        return $this->bankName;
56
    }
57
58
    public function getCorrAccount(): string
59
    {
60
        return $this->corrAccount;
61
    }
62
63
    public function isFavorite(): bool
64
    {
65
        return $this->favorite;
66
    }
67
68
    public function getPhone(): ?string
69
    {
70
        return $this->phone;
71
    }
72
73
    public function getBankId(): ?string
74
    {
75
        return $this->bankId;
76
    }
77
78
    public function getCurrentAccount(): string
79
    {
80
        return $this->currentAccount;
81
    }
82
83
    public function isAvailableForPa(): bool
84
    {
85
        return $this->availableForPa;
86
    }
87
88
    public function getBankBik(): string
89
    {
90
        return $this->bankBik;
91
    }
92
}
93