Skip to content

Commit 55f8992

Browse files
Merge pull request #96 from alma/feature/ecom-1477-php-client-fix-throw-exception-on-checkmandatorykeys-without
Fix throw exception on checkmandatorykeys without
2 parents 80ed0ec + 6fa673d commit 55f8992

4 files changed

Lines changed: 12 additions & 3 deletions

File tree

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
CHANGELOG
22
=========
33

4+
v2.0.6
5+
-------
6+
* Fix error in throw exception without sprintf
7+
48
v2.0.5
59
-------
610
* Fix endpoint customer-carts

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "alma/alma-php-client",
33
"description": "PHP API client for the Alma payments API",
4-
"version": "2.0.5",
4+
"version": "2.0.6",
55
"type": "library",
66
"require": {
77
"php": "^5.6 || ~7.0 || ~7.1 || ~7.2 || ~7.3 || ~7.4 || ~8.0 || ~8.1 || ~8.2",

src/Client.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030

3131
class Client
3232
{
33-
const VERSION = '2.0.5';
33+
const VERSION = '2.0.6';
3434

3535
const LIVE_MODE = 'live';
3636
const TEST_MODE = 'test';

src/Lib/ArrayUtils.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,12 @@ public function checkMandatoryKeys($keys, $array)
5555
{
5656
foreach ($keys as $key) {
5757
if(!array_key_exists($key, $array)){
58-
throw new MissingKeyException('The key "%s" is missing from the array "%s"', $key, json_encode($array));
58+
throw new MissingKeyException(
59+
sprintf(
60+
'The key "%s" is missing from the array "%s"',
61+
$key,
62+
json_encode($array)
63+
));
5964
}
6065
}
6166
}

0 commit comments

Comments
 (0)