jschaedl / iban-validation

:bank: A small library for validating International Bank Account Numbers (IBANs)
MIT License
90 stars 19 forks source link

Fixed the scale of bcmod for PHP versions 7.2+ #13

Closed CodeDuck42 closed 5 years ago

CodeDuck42 commented 5 years ago

Fixes the issue, that a previous bcscale screws with the precision of the bcmod function.

jayawiperera commented 5 years ago

@jschaedl Would it be possible to get this fix in ASAP?

I've been having strange issues with many of my tests that deal with the IBAN validation. For some odd reason, with PHPUnit running a test suite / directory, the IBAN validation was failing in places where it should not. After much investigation, I came to realise that it had to do with the bcscale being set to 2, which caused 1.00 to be returned instead of 1. I could not find where this is happening in my code, which leads me to believe it's something in configuration tucked away somewhere or a change happening due to another package. I was about to make a PR when I found this fix PR. Regardless of the cause, I believe this change will let us use the IBAN validator without issue and without causing other packages relying on bcmath to break.

jschaedl commented 5 years ago

Fixes #14

jschaedl commented 5 years ago

Thank you @CodeDuck42