Releases: Ekman/luhn-algorithm
Releases · Ekman/luhn-algorithm
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 LuhnAlgorithmExceptionInterface
to 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?int
to thegetCheckDigit()
return - If you want to, catch
LugnAlgorithmExceptionInterface
Exception handling
- Add
ArgumentIsNotNumericException
andMissingCheckDigitException
- Add
@throws MissingCheckDigitException
to the facadeisValid
method clearly explaining that it can be thrown from there. Old code is still compatible due toMissingCheckDigitException
extending\InvalidArgumentException
- Update copyright notice
- Implement
\Serializable
onNumber
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
InvalidArgumentException
in validation method. - Update readme.
- Update travis build process.
Rewrite of the implementation
- The Luhn Algorithm implementation has been completely rewritten.
- Added a
NumberInterface
contract in order to properly separate the number with the check digit.
New public interface
- Completely restructured the interface of the library. The implementation remains the same.
- Add Travis.