BankAccount::getHolder()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 1
1
<?php
2
namespace MrPrompt\ShipmentCommon\Base;
3
4
/**
5
 * Bank Account
6
 *
7
 * @author Thiago Paes <[email protected]>
8
 */
9
class BankAccount
10
{
11
    /**
12
     * @var int
13
     */
14
    private $account;
15
16
    /**
17
     * @var int
18
     */
19
    private $digit;
20
21
    /**
22
     * @var int
23
     */
24
    private $operation;
25
26
    /**
27
     * @var bool
28
     */
29
    private $security;
30
31
    /**
32
     * @var Bank
33
     */
34
    private $bank;
35
36
    /**
37
     * @var Holder
38
     */
39
    private $holder;
40
41
    /**
42
     * Constructor
43
     * 
44
     * @param Bank $bank
45
     * @param Holder $holder
46
     */
47 15
    public function __construct(
48
        Bank $bank = null, 
49
        Holder $holder = null,
50
        int $account = 0,
51
        int $digit = 0,
52
        int $operation = 0,
53
        bool $security = false
54
    ) {
55 15
        $this->bank     = $bank ?? new Bank;
56 15
        $this->holder   = $holder ?? new Holder;
57 15
        $this->account = $account;
58 15
        $this->digit = $digit;
59 15
        $this->operation = $operation;
60 15
        $this->security = $security;
61 15
    }
62
63
    /**
64
     * @return int
65
     */
66 1
    public function getNumber(): int
67
    {
68 1
        return $this->account;
69
    }
70
71
    /**
72
     * @param  int $account
73
     */
74 1
    public function setNumber(int $account)
75
    {
76 1
        $this->account = $account;
77 1
    }
78
79
    /**
80
     * @return int
81
     */
82 1
    public function getDigit(): int
83
    {
84 1
        return $this->digit;
85
    }
86
87
    /**
88
     * @param  int $digit
89
     */
90 1
    public function setDigit(int $digit)
91
    {
92 1
        $this->digit = $digit;
93 1
    }
94
95
    /**
96
     * @return int
97
     */
98 1
    public function getOperation(): int
99
    {
100 1
        return $this->operation;
101
    }
102
103
    /**
104
     * @param  string $operation
105
     */
106 1
    public function setOperation(int $operation)
107
    {
108 1
        $this->operation = $operation;
109 1
    }
110
111
    /**
112
     * @return bool
113
     */
114 1
    public function getSecurity(): bool
115
    {
116 1
        return $this->security;
117
    }
118
119
    /**
120
     * @param  bool $security
121
     */
122 1
    public function setSecurity(bool $security = false)
123
    {
124 1
        $this->security = $security;
125 1
    }
126
127
    /**
128
     * @return Bank
129
     */
130 1
    public function getBank(): Bank
131
    {
132 1
        return $this->bank;
133
    }
134
135
    /**
136
     * @param Bank $bank
137
     */
138 1
    public function setBank(Bank $bank)
139
    {
140 1
        $this->bank = $bank;
141 1
    }
142
143
    /**
144
     * @return Holder
145
     */
146 1
    public function getHolder(): Holder
147
    {
148 1
        return $this->holder;
149
    }
150
151
    /**
152
     * @param Holder $holder
153
     */
154 1
    public function setHolder(Holder $holder)
155
    {
156 1
        $this->holder = $holder;
157 1
    }
158
}
159