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