Releases: Ekman/luhn-algorithm
Releases · Ekman/luhn-algorithm
Fix parameter $checkDigit as nullable is deprecated
PHP 8.1
Implement new __serialize() and __unserialize() functions. Silences:
PHP Deprecated: Nekman\LuhnAlgorithm\Number implements the Serializable interface, which is deprecated. Implement __serialize() and __unserialize() instead (or in addition, if support for old PHP versions is necessary) in luhn-algorithm\src\Number.php on line 39
PHP 8 support
- Increased upper PHP version to 8
- Increased lower PHP version to 7.4
- Properly type hinting
NumberInterface::getCheckDigit()return - Added
throws LuhnAlgorithmExceptionInterfaceto all functions
Migrating from v4 to v5
There's a high probability that this change is not breaking for you
- Make sure your application runs and supports PHP >= 7.4
- If you've implemented
NumberInterface, then add?intto thegetCheckDigit()return - If you want to, catch
LugnAlgorithmExceptionInterface
Exception handling
- Add
ArgumentIsNotNumericExceptionandMissingCheckDigitException - Add
@throws MissingCheckDigitExceptionto the facadeisValidmethod clearly explaining that it can be thrown from there. Old code is still compatible due toMissingCheckDigitExceptionextending\InvalidArgumentException - Update copyright notice
- Implement
\SerializableonNumber
Update copyright notice
Update the copyright notice
PHP 7.3
Lower the minimum PHP version to 7.0
- Lower the minimum PHP version to 7.0
Numbers larger than PHP_INT_MAX
- Fixed implementation not working for numbers larger than PHP_INT_MAX.
Minor fixes to new implementation.
- Declare strict types.
- Minor bug fix to calculating checksum.
- Add test for
InvalidArgumentExceptionin validation method. - Update readme.
- Update travis build process.
Rewrite of the implementation
- The Luhn Algorithm implementation has been completely rewritten.
- Added a
NumberInterfacecontract in order to properly separate the number with the check digit.