| Total Complexity | 5 |
| Total Lines | 28 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 4 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 11 | class Iban |
||
| 12 | { |
||
| 13 | private string $iban; |
||
| 14 | |||
| 15 | public function __construct(string $iban) |
||
| 16 | { |
||
| 17 | $iban = new IbanDetails($iban); |
||
| 18 | 26 | ||
| 19 | if (!(new Validator())->validate($iban)) { |
||
| 20 | 26 | throw new InvalidArgumentException("Unknown IBAN {$iban}"); |
|
| 21 | } |
||
| 22 | 26 | ||
| 23 | 1 | $this->iban = $iban->getNormalizedIban(); |
|
| 24 | } |
||
| 25 | |||
| 26 | 25 | public function getIban(): string |
|
| 27 | 25 | { |
|
| 28 | return $this->iban; |
||
| 29 | 2 | } |
|
| 30 | |||
| 31 | 2 | public function __toString(): string |
|
| 32 | { |
||
| 33 | return $this->iban; |
||
| 34 | 7 | } |
|
| 35 | |||
| 36 | 7 | public function equals(string $iban): bool |
|
| 39 | } |
||
| 40 | } |
||
| 41 |