From 1a0616562db5c096dc7ca187f0210b3d57bffebf Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Wed, 22 Mar 2023 08:26:39 +0100 Subject: Remove FreshRSS_Searchable for better types (#5212) * Remove FreshRSS_Searchable for better types The interface was not used, and it was preventing more precise types for the different `searchById()` methods, as they each have different input and output types. * Fix type --- app/Models/CategoryDAO.php | 5 ++--- app/Models/EntryDAO.php | 5 ++--- app/Models/FeedDAO.php | 7 ++----- app/Models/Searchable.php | 10 ---------- app/Models/TagDAO.php | 7 ++----- 5 files changed, 8 insertions(+), 26 deletions(-) delete mode 100644 app/Models/Searchable.php (limited to 'app/Models') diff --git a/app/Models/CategoryDAO.php b/app/Models/CategoryDAO.php index c855f1495..02845ebe7 100644 --- a/app/Models/CategoryDAO.php +++ b/app/Models/CategoryDAO.php @@ -1,6 +1,6 @@ pdo->prepare($sql); if ($stm && diff --git a/app/Models/EntryDAO.php b/app/Models/EntryDAO.php index aab17d01e..0740f1ac4 100644 --- a/app/Models/EntryDAO.php +++ b/app/Models/EntryDAO.php @@ -1,6 +1,6 @@ pdo->inTransaction()) { @@ -284,10 +284,7 @@ SQL; } } - /** - * @return FreshRSS_Feed|null - */ - public function searchById($id) { + public function searchById(int $id): ?FreshRSS_Feed { $sql = 'SELECT * FROM `_feed` WHERE id=:id'; $stm = $this->pdo->prepare($sql); $stm->bindParam(':id', $id, PDO::PARAM_INT); diff --git a/app/Models/Searchable.php b/app/Models/Searchable.php deleted file mode 100644 index a15a44ed7..000000000 --- a/app/Models/Searchable.php +++ /dev/null @@ -1,10 +0,0 @@ -pdo->prepare($sql); $values = array($id); -- cgit v1.2.3