From abcd0e8ba205aac8bd9006e99d783afc999af0af Mon Sep 17 00:00:00 2001 From: wn_ Date: Sat, 23 Nov 2024 17:43:24 +0000 Subject: Use native union types in most places. --- classes/Sessions.php | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'classes/Sessions.php') 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(); } -- cgit v1.2.3-54-g00ecf