Skip to content
Open
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
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
28.3.0
28.3.1
2 changes: 1 addition & 1 deletion src/Adyen/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

class Client
{
const LIB_VERSION = "28.3.0";
const LIB_VERSION = "28.3.1";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

There's a maintainability risk here. The library version is hardcoded in this file and also in the root VERSION file. This duplication means a version update needs to happen in two places, and it's possible to forget one, leading to inconsistencies.

To mitigate this without a breaking change, I suggest adding a unit test to verify that Client::LIB_VERSION always matches the version in the VERSION file. This will act as a safeguard during future releases.

Here's an example of what you could add to tests/Unit/ClientTest.php:

public function testLibraryVersionMatchesVersionFile(): void
{
    $versionFromFile = trim(file_get_contents(__DIR__ . '/../../VERSION'));
    $this->assertSame($versionFromFile, \Adyen\Client::LIB_VERSION, 'Client::LIB_VERSION should match the VERSION file.');
}

const LIB_NAME = "adyen-php-api-library";
const USER_AGENT_SUFFIX = "adyen-php-api-library/";
const ENDPOINT_TEST = "https://pal-test.adyen.com";
Expand Down