From 9c9bdc685ba1c5e0840a9c8dd77bd51305583f6f Mon Sep 17 00:00:00 2001 From: Benjamin Freoua Date: Fri, 8 Mar 2024 10:41:28 +0100 Subject: [PATCH 1/2] add sprintf in throw exception checkMandatoryKeys --- src/Lib/ArrayUtils.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Lib/ArrayUtils.php b/src/Lib/ArrayUtils.php index daebf3a5..cd078e90 100644 --- a/src/Lib/ArrayUtils.php +++ b/src/Lib/ArrayUtils.php @@ -55,7 +55,12 @@ public function checkMandatoryKeys($keys, $array) { foreach ($keys as $key) { if(!array_key_exists($key, $array)){ - throw new MissingKeyException('The key "%s" is missing from the array "%s"', $key, json_encode($array)); + throw new MissingKeyException( + sprintf( + 'The key "%s" is missing from the array "%s"', + $key, + json_encode($array) + )); } } } From 6fa673d874b226e8129b99001cb3fba00926f4aa Mon Sep 17 00:00:00 2001 From: Benjamin Freoua Date: Fri, 8 Mar 2024 10:43:13 +0100 Subject: [PATCH 2/2] chore version dump --- CHANGELOG.md | 4 ++++ composer.json | 2 +- src/Client.php | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1ba4e58a..d637b2db 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,10 @@ CHANGELOG ========= +v2.0.6 +------- +* Fix error in throw exception without sprintf + v2.0.5 ------- * Fix endpoint customer-carts diff --git a/composer.json b/composer.json index 4092ae39..40b8bd9c 100644 --- a/composer.json +++ b/composer.json @@ -1,7 +1,7 @@ { "name": "alma/alma-php-client", "description": "PHP API client for the Alma payments API", - "version": "2.0.5", + "version": "2.0.6", "type": "library", "require": { "php": "^5.6 || ~7.0 || ~7.1 || ~7.2 || ~7.3 || ~7.4 || ~8.0 || ~8.1 || ~8.2", diff --git a/src/Client.php b/src/Client.php index ab8a69b7..5e20a8d0 100644 --- a/src/Client.php +++ b/src/Client.php @@ -30,7 +30,7 @@ class Client { - const VERSION = '2.0.5'; + const VERSION = '2.0.6'; const LIVE_MODE = 'live'; const TEST_MODE = 'test';