From 887f261c88b6ddd38f21e772b90e8307f04d5c2c Mon Sep 17 00:00:00 2001 From: Nicolas CARPi Date: Fri, 9 Dec 2022 18:18:55 +0100 Subject: [PATCH] add CHANGELOG.md --- CHANGELOG.md | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 CHANGELOG.md diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..11c01b5 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,32 @@ +# RobThree\TwoFactorAuth changelog + +# Version 2.x + +## Breaking changes + +### PHP Version + +Version 2.x requires at least PHP 8.1. + +### Constructor signature + +With version 2.x, the `algorithm` parameter of `RobThree\Auth\TwoFactorAuth` constructor is now an `enum`. + +On version 1.x: + +~~~php +use RobThree\Auth\TwoFactorAuth; + +$lib = new TwoFactorAuth('issuer-name', 6, 30, 'sha1'); +~~~ + +On version 2.x, simple change the algorithm from a `string` to the correct `enum`: + +~~~php +use RobThree\Auth\TwoFactorAuth; +use RobThree\Auth\Algorithm; + +$lib = new TwoFactorAuth('issuer-name', 6, 30, Algorithm::Sha1); +~~~ + +See the [Algorithm.php](./lib/Algorithm.php) file to see available algorithms.