Skip to content

Commit

Permalink
fix forget
Browse files Browse the repository at this point in the history
  • Loading branch information
januabisconti committed Dec 20, 2024
1 parent e49fd30 commit b8ce6b3
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/SuperCacheManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ public function get(string $key, ?string $connection_name = null, bool $isWithTa
public function forget(string $key, ?string $connection_name = null, bool $isFinalKey = false, bool $isWithTags = false, bool $onlyTags = false): void
{
if ($isFinalKey) {
$finalKey = $key;
$finalKey = str_replace(['{', '}'], '', $key);
} else {
$finalKey = $this->getFinalKey($key, $isWithTags);
}
Expand Down Expand Up @@ -292,12 +292,12 @@ public function flush(?string $connection_name = null): void
public function has(string $key, ?string $connection_name = null, bool $isWithTags = false, bool $isfinalKey = false): bool
{
if ($isfinalKey) {
$finalKey = $key;
$finalKey = str_replace(['{', '}'], '', $key);
} else {
$finalKey = '{' . $this->getFinalKey($key, $isWithTags) . '}';
$finalKey = $this->getFinalKey($key, $isWithTags);
}

return $this->redis->getRedisConnection($connection_name)->exists($finalKey) > 0;
return $this->redis->getRedisConnection($connection_name)->exists('{' . $finalKey . '}') > 0;
}

/**
Expand Down

0 comments on commit b8ce6b3

Please sign in to comment.