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 9bbf5d7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/Phpfastcache/Core/Pool/CacheItemPoolTrait.php
Expand Up @@ -619,10 +619,10 @@ protected function handleExpiredCacheItem(ExtendedCacheItemInterface $item): voi
* @param bool $encoded
* @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 9bbf5d7

Please sign in to comment.