From 1d7c8a028dc6d1d2d2c30e8262ac2afef835a237 Mon Sep 17 00:00:00 2001 From: Michel Roux Date: Sat, 17 Jun 2023 12:12:40 +0200 Subject: [PATCH] All hooks is static and fix null --- lib/Db/ReaderMapper.php | 4 ++-- lib/Hooks.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/Db/ReaderMapper.php b/lib/Db/ReaderMapper.php index 1f6af8d..ce6b9be 100644 --- a/lib/Db/ReaderMapper.php +++ b/lib/Db/ReaderMapper.php @@ -25,10 +25,10 @@ abstract class ReaderMapper extends QBMapper { /** * @param IDBConnection $db Instance of the Db abstraction layer * @param string $table the name of the table. set this to allow entity - * @param class-string|null $entity the name of the entity that the sql should be mapped to queries without using sql + * @param class-string $entity the name of the entity that the sql should be mapped to queries without using sql * @param Time $time */ - public function __construct(IDBConnection $db, string $table, ?string $entity = null, Time $time) { + public function __construct(IDBConnection $db, string $table, string $entity, Time $time) { parent::__construct($db, $table, $entity); $this->time = $time; } diff --git a/lib/Hooks.php b/lib/Hooks.php index 35cea44..3864fb3 100644 --- a/lib/Hooks.php +++ b/lib/Hooks.php @@ -39,7 +39,7 @@ class Hooks { } } - protected function deleteFile(IDBConnection $connection, int $fileId): void { + protected static function deleteFile(IDBConnection $connection, int $fileId): void { $queryBuilder = $connection->getQueryBuilder(); $queryBuilder->delete('reader_bookmarks')->where('file_id = file_id')->setParameter('file_id', $fileId); $queryBuilder->executeStatement(); @@ -49,7 +49,7 @@ class Hooks { $queryBuilder->executeStatement(); } - protected function deleteUser(IDBConnection $connection, string $userId): void { + protected static function deleteUser(IDBConnection $connection, string $userId): void { $queryBuilder = $connection->getQueryBuilder(); $queryBuilder->delete('reader_bookmarks')->where('user_id = user_id')->setParameter('user_id', $userId); $queryBuilder->executeStatement();