Skip to content

Commit

Permalink
Added optional prefix to `\Phpfastcache\Core\Pool\CacheItemPoolTrait:…
Browse files Browse the repository at this point in the history
…:getKeys()`
  • Loading branch information
Geolim4 committed Jan 11, 2024
1 parent 798f658 commit 1e605b0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions CHANGELOG.md
@@ -1,7 +1,7 @@
## 9.2.2
##### 10 january 2024
##### 11 january 2024
- __Core__
- Added internal proxy class
- Added optional prefix to `\Phpfastcache\Core\Pool\CacheItemPoolTrait::getKeys()`

## 9.2.1
##### 07 january 2024
Expand Down
5 changes: 3 additions & 2 deletions lib/Phpfastcache/Core/Pool/CacheItemPoolTrait.php
Expand Up @@ -617,12 +617,13 @@ protected function handleExpiredCacheItem(ExtendedCacheItemInterface $item): voi
/**
* @param ExtendedCacheItemInterface[] $items
* @param bool $encoded
* @param string $keyPrefix
* @return string[]
*/
protected function getKeys(array $items, bool $encoded = false): array
protected function getKeys(array $items, bool $encoded = false, string $keyPrefix = ''): array
{
return array_map(
static fn(ExtendedCacheItemInterface $item) => $encoded ? $item->getEncodedKey() : $item->getKey(),
static fn(ExtendedCacheItemInterface $item) => $keyPrefix . ($encoded ? $item->getEncodedKey() : $item->getKey()),
$items
);
}
Expand Down

0 comments on commit 1e605b0

Please sign in to comment.