Conditions | 3 |
Paths | 2 |
Total Lines | 9 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Tests | 6 |
CRAP Score | 3 |
Changes | 0 |
1 | <?php |
||
22 | 2 | public function setIban(string $iban): void |
|
23 | { |
||
24 | 2 | $iban = str_replace(' ', '', mb_strtoupper($iban)); |
|
25 | |||
26 | 2 | $validator = new Iban(['allow_non_sepa' => false]); |
|
27 | 2 | if (empty($iban) || $validator->isValid($iban)) { |
|
28 | 2 | $this->iban = $iban; |
|
29 | } else { |
||
30 | 1 | throw new Exception('Invalid IBAN number'); |
|
31 | } |
||
42 |