Skip to content

[Cache] Add PdoTagAwareAdapter #58296

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

Open
wants to merge 18 commits into
base: 7.4
Choose a base branch
from
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ abstract class AbstractTagAwareAdapter implements TagAwareAdapterInterface, TagA
use AbstractAdapterTrait;
use ContractsTrait;

private const TAGS_PREFIX = "\1tags\1";
protected const TAGS_PREFIX = "\1tags\1";

protected function __construct(string $namespace = '', int $defaultLifetime = 0)
{
Expand Down Expand Up @@ -168,7 +168,7 @@ protected function doDeleteYieldTags(array $ids): iterable
public function commit(): bool
{
$ok = true;
$byLifetime = (self::$mergeByLifetime)($this->deferred, $expiredIds, $this->getId(...), self::TAGS_PREFIX, $this->defaultLifetime);
$byLifetime = (self::$mergeByLifetime)($this->deferred, $expiredIds, $this->getId(...), static::TAGS_PREFIX, $this->defaultLifetime);
$retry = $this->deferred = [];

if ($expiredIds) {
Expand Down Expand Up @@ -244,7 +244,7 @@ public function deleteItems(array $keys): bool
try {
foreach ($this->doDeleteYieldTags(array_values($ids)) as $id => $tags) {
foreach ($tags as $tag) {
$tagData[$this->getId(self::TAGS_PREFIX.$tag)][] = $id;
$tagData[$this->getId(static::TAGS_PREFIX.$tag)][] = $id;
}
}
} catch (\Exception) {
Expand Down Expand Up @@ -283,7 +283,7 @@ public function invalidateTags(array $tags): bool

$tagIds = [];
foreach (array_unique($tags) as $tag) {
$tagIds[] = $this->getId(self::TAGS_PREFIX.$tag);
$tagIds[] = $this->getId(static::TAGS_PREFIX.$tag);
}

try {
Expand Down
Loading
Loading