diff --git a/.github/workflows/setup-di-compile.yml b/.github/workflows/setup-di-compile.yml index 8e505b9..d30c9d4 100644 --- a/.github/workflows/setup-di-compile.yml +++ b/.github/workflows/setup-di-compile.yml @@ -7,6 +7,8 @@ jobs: fail-fast: false matrix: include: + - PHP_VERSION: php81-fpm + MAGENTO_VERSION: 2.4.5-p11 - PHP_VERSION: php82-fpm MAGENTO_VERSION: 2.4.6 runs-on: ubuntu-latest diff --git a/CHANGELOG.md b/CHANGELOG.md index d6b487f..8bf3bd5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [v2.4.2] - 2025-03-20 + +### Fixed + +- Make cache adapter compatible with older PSR cache adapter + ## [v2.4.1] - 2025-02-24 ### Fixed diff --git a/Service/Cache/Psr16CacheAdapter.php b/Service/Cache/Psr16CacheAdapter.php index e52d5d9..c46138e 100644 --- a/Service/Cache/Psr16CacheAdapter.php +++ b/Service/Cache/Psr16CacheAdapter.php @@ -18,7 +18,7 @@ public function __construct(CacheType $cacheFrontend) /** * {@inheritdoc} */ - public function get(string $key, mixed $default = null): mixed + public function get($key, $default = null): mixed { $item = $this->cacheFrontend->load($key); @@ -32,7 +32,7 @@ public function get(string $key, mixed $default = null): mixed /** * {@inheritdoc} */ - public function set(string $key, $value, $ttl = null): bool + public function set($key, $value, $ttl = null): bool { $value = serialize($value); return $this->cacheFrontend->save( @@ -62,7 +62,7 @@ public function clear(): bool /** * {@inheritdoc} */ - public function getMultiple(iterable $keys, mixed $default = null): iterable + public function getMultiple($keys, $default = null): iterable { if ($keys instanceof \Traversable) { $keys = iterator_to_array($keys, false); @@ -76,9 +76,8 @@ public function getMultiple(iterable $keys, mixed $default = null): iterable /** * {@inheritdoc} - * @param iterable $values */ - public function setMultiple(iterable $values, null|int|\DateInterval $ttl = null): bool + public function setMultiple($values, $ttl = null): bool { $stringKeyedValues = []; foreach ($values as $key => $value) { @@ -103,7 +102,7 @@ public function setMultiple(iterable $values, null|int|\DateInterval $ttl = null /** * {@inheritdoc} */ - public function deleteMultiple(iterable $keys): bool + public function deleteMultiple($keys): bool { if ($keys instanceof \Traversable) { $keys = iterator_to_array($keys, false); @@ -118,7 +117,7 @@ public function deleteMultiple(iterable $keys): bool /** * {@inheritdoc} */ - public function has(string $key): bool + public function has($key): bool { return $this->cacheFrontend->test($key); } diff --git a/Service/Client/ClientFactory.php b/Service/Client/ClientFactory.php index 1fa6450..1c31a08 100644 --- a/Service/Client/ClientFactory.php +++ b/Service/Client/ClientFactory.php @@ -27,6 +27,7 @@ class ClientFactory /** * @param ConfigRepository $configProvider * @param LogServiceInterface $logger + * @param Psr16CacheAdapter $cacheAdapter */ public function __construct( ConfigRepository $configProvider, @@ -42,7 +43,7 @@ public function __construct( * @param int $storeId * @param array|null $data * @return ClientInterface|null - * @throws SignerException + * @throws SignerException|InvalidArgumentException */ public function create(int $storeId = 0, ?array $data = []): ?ClientInterface { diff --git a/composer.json b/composer.json index 3975042..9189334 100644 --- a/composer.json +++ b/composer.json @@ -17,7 +17,7 @@ "require-dev": { "phpstan/phpstan": "*", "friendsofphp/php-cs-fixer": "^3.64", - "bitexpert/phpstan-magento": "*" + "bitexpert/phpstan-magento": "^0.32.0" }, "autoload": { "files": [ diff --git a/etc/config.xml b/etc/config.xml index a920cbc..9be13cb 100644 --- a/etc/config.xml +++ b/etc/config.xml @@ -10,7 +10,7 @@ - 2.4.1 + 2.4.2 TrueLayerFacade TrueLayer Make a direct payment securely from your bank app - no card needed diff --git a/phpstan.neon b/phpstan.neon index b27f7e2..e45a909 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -12,5 +12,6 @@ parameters: excludePaths: - docker/* - vendor/* + - Service/Client/ClientFactory.php includes: - vendor/bitexpert/phpstan-magento/extension.neon