Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix throw exception on checkmandatorykeys without #96

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
CHANGELOG
=========

v2.0.6
-------
* Fix error in throw exception without sprintf

v2.0.5
-------
* Fix endpoint customer-carts
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
2 changes: 1 addition & 1 deletion src/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

class Client
{
const VERSION = '2.0.5';
const VERSION = '2.0.6';

const LIVE_MODE = 'live';
const TEST_MODE = 'test';
Expand Down
7 changes: 6 additions & 1 deletion src/Lib/ArrayUtils.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)
));
}
}
}
Expand Down