Skip to content

Releases: Ekman/luhn-algorithm

PHP 8.1

11 Mar 10:28
12da0bd
Compare
Choose a tag to compare

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

10 Jan 14:00
6e6f0ad
Compare
Choose a tag to compare
  • 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

  1. Make sure your application runs and supports PHP >= 7.4
  2. If you've implemented NumberInterface, then add ?int to the getCheckDigit() return
  3. If you want to, catch LugnAlgorithmExceptionInterface

Exception handling

23 Apr 20:08
27bb5ab
Compare
Choose a tag to compare
  • Add ArgumentIsNotNumericException and MissingCheckDigitException
  • Add @throws MissingCheckDigitException to the facade isValid method clearly explaining that it can be thrown from there. Old code is still compatible due to MissingCheckDigitException extending \InvalidArgumentException
  • Update copyright notice
  • Implement \Serializable on Number

Update copyright notice

23 Nov 08:08
a7d281e
Compare
Choose a tag to compare

Update the copyright notice

PHP 7.3

23 Oct 16:27
9ba100f
Compare
Choose a tag to compare

Changes to this release:

  • Run tests on PHP 7.3
  • Improve tests by adding purpose

Lower the minimum PHP version to 7.0

22 May 17:14
d4cef0a
Compare
Choose a tag to compare
  • Lower the minimum PHP version to 7.0

Numbers larger than PHP_INT_MAX

16 May 17:56
1f03fa6
Compare
Choose a tag to compare
  • Fixed implementation not working for numbers larger than PHP_INT_MAX.

Minor fixes to new implementation.

27 Feb 19:33
235b559
Compare
Choose a tag to compare
  • 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

26 Feb 19:13
cd21b37
Compare
Choose a tag to compare
  • 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

26 Feb 08:23
12b8c62
Compare
Choose a tag to compare
  • Completely restructured the interface of the library. The implementation remains the same.
  • Add Travis.