Skip to content

Commit 6a2a310

Browse files
committed
Moved Hungarian IBAN validator and adapter to rikudou/iban
1 parent f792d27 commit 6a2a310

6 files changed

Lines changed: 4 additions & 193 deletions

File tree

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,10 @@ This package already contains Adapter for Hungarian account numbers:
4747
```php
4848
<?php
4949

50-
use hubipe\HuQrPayment\Iban\HungarianBbanAdapter;use hubipe\HuQrPayment\QrPayment;
50+
use hubipe\HuQrPayment\QrPayment;
51+
use Rikudou\Iban\Iban\HungarianIbanAdapter;
5152

52-
$payment = new QrPayment(new HungarianBbanAdapter('11773016-11111018-00000000'));
53+
$payment = new QrPayment(new HungarianIbanAdapter('11773016-11111018-00000000'));
5354

5455
```
5556

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"require": {
1919
"php": "^7.3|^8.0",
2020
"ext-mbstring": "*",
21-
"rikudou/iban": "^1.1",
21+
"rikudou/iban": "^1.2",
2222
"rikudou/qr-payment-interface": "^1.1",
2323
"rikudou/qr-payment-qr-code-provider": "^1.1"
2424
},

src/Helper/ToStringIban.php

Lines changed: 0 additions & 19 deletions
This file was deleted.

src/Helper/Utils.php

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -50,32 +50,4 @@ public static function getConstants(string $class)
5050
return static::$constants[$class];
5151
}
5252

53-
public static function bcmod(string $dividend, string $divisor, bool $forceOwnImplementation = false): ?string
54-
{
55-
if (!is_numeric($dividend)) {
56-
throw new InvalidArgumentException('The dividend must be a number');
57-
}
58-
if (!is_numeric($divisor)) {
59-
throw new InvalidArgumentException('The divisor must be a number');
60-
}
61-
if (!function_exists('bcmod') || $forceOwnImplementation) {
62-
if (strval(intval($divisor)) !== $divisor) {
63-
throw new InvalidArgumentException('The custom implementation does not support large numbers in divisor');
64-
}
65-
66-
$mod = '';
67-
68-
foreach (str_split($dividend) as $char) {
69-
if ($char === '-') {
70-
throw new InvalidArgumentException('The custom implementation of bcmod does not support negative numbers');
71-
}
72-
$mod = ($mod . $char) % $divisor;
73-
}
74-
75-
return (string) $mod;
76-
}
77-
78-
/* @noinspection PhpComposerExtensionStubsInspection */
79-
return bcmod($dividend, $divisor);
80-
}
8153
}

src/Iban/HungarianBbanAdapter.php

Lines changed: 0 additions & 81 deletions
This file was deleted.

src/Iban/Validator/HungarianIbanValidator.php

Lines changed: 0 additions & 62 deletions
This file was deleted.

0 commit comments

Comments
 (0)