Skip to content

Commit cb70e6b

Browse files
authored
PLUG-160: Make cache adapter compatible with older versions of psr ca… (#48)
1 parent 0fac529 commit cb70e6b

File tree

7 files changed

+19
-10
lines changed

7 files changed

+19
-10
lines changed

.github/workflows/setup-di-compile.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ jobs:
77
fail-fast: false
88
matrix:
99
include:
10+
- PHP_VERSION: php81-fpm
11+
MAGENTO_VERSION: 2.4.5-p11
1012
- PHP_VERSION: php82-fpm
1113
MAGENTO_VERSION: 2.4.6
1214
runs-on: ubuntu-latest

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres
66
to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [v2.4.2] - 2025-03-20
9+
10+
### Fixed
11+
12+
- Make cache adapter compatible with older PSR cache adapter
13+
814
## [v2.4.1] - 2025-02-24
915

1016
### Fixed

Service/Cache/Psr16CacheAdapter.php

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public function __construct(CacheType $cacheFrontend)
1818
/**
1919
* {@inheritdoc}
2020
*/
21-
public function get(string $key, mixed $default = null): mixed
21+
public function get($key, $default = null): mixed
2222
{
2323
$item = $this->cacheFrontend->load($key);
2424

@@ -32,7 +32,7 @@ public function get(string $key, mixed $default = null): mixed
3232
/**
3333
* {@inheritdoc}
3434
*/
35-
public function set(string $key, $value, $ttl = null): bool
35+
public function set($key, $value, $ttl = null): bool
3636
{
3737
$value = serialize($value);
3838
return $this->cacheFrontend->save(
@@ -62,7 +62,7 @@ public function clear(): bool
6262
/**
6363
* {@inheritdoc}
6464
*/
65-
public function getMultiple(iterable $keys, mixed $default = null): iterable
65+
public function getMultiple($keys, $default = null): iterable
6666
{
6767
if ($keys instanceof \Traversable) {
6868
$keys = iterator_to_array($keys, false);
@@ -76,9 +76,8 @@ public function getMultiple(iterable $keys, mixed $default = null): iterable
7676

7777
/**
7878
* {@inheritdoc}
79-
* @param iterable<int|string, mixed> $values
8079
*/
81-
public function setMultiple(iterable $values, null|int|\DateInterval $ttl = null): bool
80+
public function setMultiple($values, $ttl = null): bool
8281
{
8382
$stringKeyedValues = [];
8483
foreach ($values as $key => $value) {
@@ -103,7 +102,7 @@ public function setMultiple(iterable $values, null|int|\DateInterval $ttl = null
103102
/**
104103
* {@inheritdoc}
105104
*/
106-
public function deleteMultiple(iterable $keys): bool
105+
public function deleteMultiple($keys): bool
107106
{
108107
if ($keys instanceof \Traversable) {
109108
$keys = iterator_to_array($keys, false);
@@ -118,7 +117,7 @@ public function deleteMultiple(iterable $keys): bool
118117
/**
119118
* {@inheritdoc}
120119
*/
121-
public function has(string $key): bool
120+
public function has($key): bool
122121
{
123122
return $this->cacheFrontend->test($key);
124123
}

Service/Client/ClientFactory.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ class ClientFactory
2727
/**
2828
* @param ConfigRepository $configProvider
2929
* @param LogServiceInterface $logger
30+
* @param Psr16CacheAdapter $cacheAdapter
3031
*/
3132
public function __construct(
3233
ConfigRepository $configProvider,
@@ -42,7 +43,7 @@ public function __construct(
4243
* @param int $storeId
4344
* @param array|null $data
4445
* @return ClientInterface|null
45-
* @throws SignerException
46+
* @throws SignerException|InvalidArgumentException
4647
*/
4748
public function create(int $storeId = 0, ?array $data = []): ?ClientInterface
4849
{

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"require-dev": {
1818
"phpstan/phpstan": "*",
1919
"friendsofphp/php-cs-fixer": "^3.64",
20-
"bitexpert/phpstan-magento": "*"
20+
"bitexpert/phpstan-magento": "^0.32.0"
2121
},
2222
"autoload": {
2323
"files": [

etc/config.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<default>
1111
<payment>
1212
<truelayer>
13-
<version>2.4.1</version>
13+
<version>2.4.2</version>
1414
<model>TrueLayerFacade</model>
1515
<title>TrueLayer</title>
1616
<description>Make a direct payment securely from your bank app - no card needed</description>

phpstan.neon

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,6 @@ parameters:
1212
excludePaths:
1313
- docker/*
1414
- vendor/*
15+
- Service/Client/ClientFactory.php
1516
includes:
1617
- vendor/bitexpert/phpstan-magento/extension.neon

0 commit comments

Comments
 (0)