Skip to content

PLUG-160: Make cache adapter compatible with older versions of psr ca… #48

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

Merged
merged 7 commits into from
Mar 20, 2025
Merged
Show file tree
Hide file tree
Changes from 2 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: 2 additions & 0 deletions .github/workflows/setup-di-compile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
13 changes: 6 additions & 7 deletions Service/Cache/Psr16CacheAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand All @@ -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(
Expand Down Expand Up @@ -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);
Expand All @@ -76,9 +76,8 @@ public function getMultiple(iterable $keys, mixed $default = null): iterable

/**
* {@inheritdoc}
* @param iterable<int|string, mixed> $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) {
Expand All @@ -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);
Expand All @@ -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);
}
Expand Down
Empty file added Service/Cache/Test.php
Empty file.
2 changes: 1 addition & 1 deletion etc/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<default>
<payment>
<truelayer>
<version>2.4.1</version>
<version>2.4.2</version>
<model>TrueLayerFacade</model>
<title>TrueLayer</title>
<description>Make a direct payment securely from your bank app - no card needed</description>
Expand Down