Skip to content

Commit

Permalink
Bugfix :)
Browse files Browse the repository at this point in the history
  • Loading branch information
TiiFuchs committed Feb 6, 2023
1 parent 24ad216 commit fd35215
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/Cache/SimpleCacheBridge.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ public function get(string $key, mixed $default = null): mixed
public function set(string $key, mixed $value, \DateInterval|int|null $ttl = null): bool
{
$item = $this->cacheItemPool->getItem($key);
$item->expiresAfter($ttl);

$item->set($value);
$item->expiresAfter($ttl);

return $this->cacheItemPool->save($item);
}
Expand Down Expand Up @@ -65,13 +65,13 @@ public function getMultiple(iterable $keys, mixed $default = null): iterable
public function setMultiple(iterable $values, \DateInterval|int|null $ttl = null): bool
{
$keys = [];
$values = [];
$result = [];

foreach ($values as $key => $value) {
$key = (string) $key;

$keys[] = $key;
$values[$key] = $value;
$result[$key] = $value;
}

$items = $this->cacheItemPool->getItems($keys);
Expand All @@ -80,7 +80,7 @@ public function setMultiple(iterable $values, \DateInterval|int|null $ttl = null

/** @var CacheItemInterface $item */
foreach ($items as $key => $item) {
$item->set($values[$key]);
$item->set($result[$key]);
$item->expiresAfter($ttl);

$success = $success && $this->cacheItemPool->saveDeferred($item);
Expand Down

0 comments on commit fd35215

Please sign in to comment.