Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions phpstan-baseline.php
Original file line number Diff line number Diff line change
Expand Up @@ -3036,11 +3036,6 @@
'count' => 1,
'path' => __DIR__ . '/system/Session/Handlers/RedisHandler.php',
];
$ignoreErrors[] = [
'message' => '#^Only booleans are allowed in a negated boolean, int given\\.$#',
'count' => 1,
'path' => __DIR__ . '/system/Session/Handlers/RedisHandler.php',
];
$ignoreErrors[] = [
'message' => '#^Accessing offset \'HTTP_X_REQUESTED_WITH\' directly on \\$_SERVER is discouraged\\.$#',
'count' => 2,
Expand Down
1 change: 1 addition & 0 deletions system/Cache/Handlers/RedisHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,7 @@ public function getMetaData(string $key)
if ($value !== null) {
$time = Time::now()->getTimestamp();
$ttl = $this->redis->ttl(static::validateKey($key, $this->prefix));
assert(is_int($ttl));

return [
'expire' => $ttl > 0 ? $time + $ttl : null,
Expand Down
5 changes: 4 additions & 1 deletion system/Session/Handlers/RedisHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,10 @@ protected function lockSession(string $sessionID): bool
$attempt = 0;

do {
if (($ttl = $this->redis->ttl($lockKey)) > 0) {
$ttl = $this->redis->ttl($lockKey);
assert(is_int($ttl));

if ($ttl > 0) {
sleep(1);

continue;
Expand Down