1 | <?php |
||
7 | class AndorraBban implements BbanInterface |
||
8 | { |
||
9 | /** |
||
10 | * @var string |
||
11 | */ |
||
12 | private $bankCode; |
||
13 | |||
14 | /** |
||
15 | * @var string |
||
16 | */ |
||
17 | private $branchCode; |
||
18 | |||
19 | /** |
||
20 | * @var string |
||
21 | */ |
||
22 | private $accountNumber; |
||
23 | |||
24 | /** |
||
25 | * AndorraBban constructor. |
||
26 | * |
||
27 | * @param string $bankCode |
||
28 | * @param string $branchCode |
||
29 | * @param string $accountNumber |
||
30 | * |
||
31 | * @throws InvalidArgumentException |
||
32 | */ |
||
33 | 14 | public function __construct( |
|
46 | |||
47 | /** |
||
48 | * @param string $bban |
||
49 | * |
||
50 | * @throws InvalidArgumentException |
||
51 | * |
||
52 | * @return static |
||
53 | */ |
||
54 | 4 | public static function fromString($bban) |
|
68 | |||
69 | /** |
||
70 | * @return string |
||
71 | */ |
||
72 | 2 | public function bankCode() |
|
76 | |||
77 | /** |
||
78 | * @return string |
||
79 | */ |
||
80 | 2 | public function branchCode() |
|
84 | |||
85 | /** |
||
86 | * @return string |
||
87 | */ |
||
88 | 1 | public function checkDigits() |
|
91 | |||
92 | /** |
||
93 | * @return string |
||
94 | */ |
||
95 | 2 | public function accountNumber() |
|
99 | |||
100 | /** |
||
101 | * @return string |
||
102 | */ |
||
103 | 1 | public function __toString() |
|
107 | |||
108 | /** |
||
109 | * @param $bankCode |
||
110 | * |
||
111 | * @throws InvalidArgumentException |
||
112 | */ |
||
113 | 14 | private static function validateBankCodeFormat($bankCode) |
|
119 | |||
120 | /** |
||
121 | * @param $branchCode |
||
122 | * |
||
123 | * @throws InvalidArgumentException |
||
124 | */ |
||
125 | 10 | private static function validateBranchCodeFormat($branchCode) |
|
131 | |||
132 | /** |
||
133 | * @param $accountNumber |
||
134 | * |
||
135 | * @throws InvalidArgumentException |
||
136 | */ |
||
137 | 6 | private static function validateAccountNumberFormat($accountNumber) |
|
143 | } |
||
144 |