Skip to content

Commit 958abce

Browse files
authored
Added expireat(key, timestamp)` method (#97)
1 parent 8884530 commit 958abce

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/M6Web/Component/RedisMock/RedisMock.php

+6-1
Original file line numberDiff line numberDiff line change
@@ -164,12 +164,17 @@ public function ttl($key)
164164
}
165165

166166
public function expire($key, $seconds)
167+
{
168+
return $this->expireat($key, time() + $seconds);
169+
}
170+
171+
public function expireat($key, $timestamp)
167172
{
168173
if (!array_key_exists($key, self::$dataValues[$this->storage]) || $this->deleteOnTtlExpired($key)) {
169174
return $this->returnPipedInfo(0);
170175
}
171176

172-
self::$dataTtl[$this->storage][$key] = time() + $seconds;
177+
self::$dataTtl[$this->storage][$key] = $timestamp;
173178

174179
return $this->returnPipedInfo(1);
175180
}

0 commit comments

Comments
 (0)