aboutsummaryrefslogtreecommitdiff
path: root/classes/Sessions.php
diff options
context:
space:
mode:
authorwn_ <invalid@email.com>2024-11-23 17:43:24 +0000
committerwn_ <invalid@email.com>2024-11-23 17:43:24 +0000
commitabcd0e8ba205aac8bd9006e99d783afc999af0af (patch)
tree8635fcd5b239f18db5ff831c7ef21a290a8ac6d8 /classes/Sessions.php
parentd4636716fb6e1879098823c2f037db5d8d3f24a0 (diff)
Use native union types in most places.
Diffstat (limited to 'classes/Sessions.php')
-rw-r--r--classes/Sessions.php9
1 files changed, 2 insertions, 7 deletions
diff --git a/classes/Sessions.php b/classes/Sessions.php
index 08c6b5855..c54815b0f 100644
--- a/classes/Sessions.php
+++ b/classes/Sessions.php
@@ -53,12 +53,8 @@ class Sessions implements \SessionHandlerInterface {
return true;
}
- /**
- * @todo set return type to string|false, and remove ReturnTypeWillChange, when min supported is PHP 8
- * @return string|false
- */
#[\ReturnTypeWillChange]
- public function read(string $id) {
+ public function read(string $id): false|string {
$sth = Db::pdo()->prepare('SELECT data FROM ttrss_sessions WHERE id=?');
$sth->execute([$id]);
@@ -95,11 +91,10 @@ class Sessions implements \SessionHandlerInterface {
}
/**
- * @todo set return type to int|false, and remove ReturnTypeWillChange, when min supported is PHP 8
* @return int|false the number of deleted sessions on success, or false on failure
*/
#[\ReturnTypeWillChange]
- public function gc(int $max_lifetime) {
+ public function gc(int $max_lifetime): false|int {
$result = Db::pdo()->query('DELETE FROM ttrss_sessions WHERE expire < ' . time());
return $result === false ? false : $result->rowCount();
}