Skip to content

Commit b951a15

Browse files
committed
Merge remote-tracking branch 'upstream/develop' into 4.5
2 parents e6e9b59 + 1c33359 commit b951a15

File tree

3 files changed

+5
-6
lines changed

3 files changed

+5
-6
lines changed

phpstan-baseline.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2981,11 +2981,6 @@
29812981
'count' => 1,
29822982
'path' => __DIR__ . '/system/Session/Handlers/RedisHandler.php',
29832983
];
2984-
$ignoreErrors[] = [
2985-
'message' => '#^Only booleans are allowed in a negated boolean, int given\\.$#',
2986-
'count' => 1,
2987-
'path' => __DIR__ . '/system/Session/Handlers/RedisHandler.php',
2988-
];
29892984
$ignoreErrors[] = [
29902985
'message' => '#^Accessing offset \'HTTP_X_REQUESTED_WITH\' directly on \\$_SERVER is discouraged\\.$#',
29912986
'count' => 2,

system/Cache/Handlers/RedisHandler.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,7 @@ public function getMetaData(string $key)
245245
if ($value !== null) {
246246
$time = Time::now()->getTimestamp();
247247
$ttl = $this->redis->ttl(static::validateKey($key, $this->prefix));
248+
assert(is_int($ttl));
248249

249250
return [
250251
'expire' => $ttl > 0 ? $time + $ttl : null,

system/Session/Handlers/RedisHandler.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,10 @@ protected function lockSession(string $sessionID): bool
293293
$attempt = 0;
294294

295295
do {
296-
if (($ttl = $this->redis->ttl($lockKey)) > 0) {
296+
$ttl = $this->redis->ttl($lockKey);
297+
assert(is_int($ttl));
298+
299+
if ($ttl > 0) {
297300
sleep(1);
298301

299302
continue;

0 commit comments

Comments
 (0)