iban-validation icon indicating copy to clipboard operation
iban-validation copied to clipboard

Deprecation error when nothing is passed as an argument to Iban\Validation\Swift\Registry::__construct() function

Open menno-ll opened this issue 3 years ago • 1 comments

When using this library, i get the following deprecation:

Not implementing the "Iban\Validation\Swift\RegistryLoaderInterface" for argument "$registryLoader" is deprecated since 1.8.1.

However, this is caused by the internal functions of this library, because they pass nothing to the Iban\Validation\Swift\Registry::__construct() function. That falls back to null, which results in the deprecation beeing triggered.

This can easily be resolved by adding an ! is_null() check to the if statement that checks for the deprecation

menno-ll avatar Mar 17 '22 15:03 menno-ll

When can we expect a fix?

huebner-t avatar Jun 01 '22 09:06 huebner-t

deprecation warning is just triggered if using version 1.8.2

php version 8.x strict mode

public static function iban($iban)
    {
        $out = true;

        $iban = new Iban($iban);
        $validator = new IbanValidator();

        if(!$validator->validate($iban)){
            $out = 'Diese Iban ist ungültig.';
        }

        return $out;
    }

PHP Deprecated: Not implementing the "Iban\Validation\Swift\RegistryLoaderInterface" for argument "$registryLoader" is deprecated since 1.8.1. in /var/www/html/vendor/jschaedl/iban-validation/src/Swift/Registry.php on line 36

composer.lock entry:

            "name": "jschaedl/iban-validation",
            "version": "v1.8.2",
            "source": {
                "type": "git",
                "url": "https://github.com/jschaedl/iban-validation.git",
                "reference": "8b635c4872ff8818e8e9325058092c5add8defcd"
            }

ElTi42 avatar Dec 05 '22 08:12 ElTi42

This fix wasn't released until now. But here you go: https://github.com/jschaedl/iban-validation/releases/tag/v1.8.3

jschaedl avatar Dec 09 '22 17:12 jschaedl

Closing here now. Thanks for reporting this.

jschaedl avatar Dec 09 '22 18:12 jschaedl