diff options
| author | 2024-01-15 10:36:30 +0100 | |
|---|---|---|
| committer | 2024-01-15 10:36:30 +0100 | |
| commit | 314077a457f04cc2f0472e036af029e2676fbf02 (patch) | |
| tree | 1f38bb78761a56b8ee2034caba0dbda3912ef7c1 /app/Models/EntryDAO.php | |
| parent | 52f6c8399b41e0c8be49dd56c89f451843189791 (diff) | |
PHPStan prepare exceptions (#6037)
Take advantage of
https://phpstan.org/blog/bring-your-exceptions-under-control
Minimum changes to pass `tooWideThrowType` and `implicitThrows`.
Revert some mistakes from:
https://github.com/FreshRSS/FreshRSS/pull/5504
Preparation needed before new PRs of the same type:
https://github.com/FreshRSS/FreshRSS/pull/5962
Fix several wrong PHPDocs and catches:
> Method ... has ...Exception in PHPDoc @throws tag but it's not thrown.
> Dead catch - ...Exception is never thrown in the try block.
Diffstat (limited to 'app/Models/EntryDAO.php')
| -rw-r--r-- | app/Models/EntryDAO.php | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/app/Models/EntryDAO.php b/app/Models/EntryDAO.php index b809c7475..abcc33a1a 100644 --- a/app/Models/EntryDAO.php +++ b/app/Models/EntryDAO.php @@ -1007,6 +1007,7 @@ SQL; /** * @param 'ASC'|'DESC' $order * @return array{0:array<int|string>,1:string} + * @throws FreshRSS_EntriesGetter_Exception */ protected function sqlListEntriesWhere(string $alias = '', ?FreshRSS_BooleanSearch $filters = null, int $state = FreshRSS_Entry::STATE_ALL, @@ -1059,6 +1060,7 @@ SQL; * @param int $id category/feed/tag ID * @param 'ASC'|'DESC' $order * @return array{0:array<int|string>,1:string} + * @throws FreshRSS_EntriesGetter_Exception */ private function sqlListWhere(string $type = 'a', int $id = 0, int $state = FreshRSS_Entry::STATE_ALL, string $order = 'DESC', int $limit = 1, string $firstId = '', ?FreshRSS_BooleanSearch $filters = null, @@ -1126,6 +1128,7 @@ SQL; * @param 'ASC'|'DESC' $order * @param int $id category/feed/tag ID * @return PDOStatement|false + * @throws FreshRSS_EntriesGetter_Exception */ private function listWhereRaw(string $type = 'a', int $id = 0, int $state = FreshRSS_Entry::STATE_ALL, string $order = 'DESC', int $limit = 1, string $firstId = '', ?FreshRSS_BooleanSearch $filters = null, @@ -1161,6 +1164,7 @@ SQL; * @param int $id category/feed/tag ID * @param 'ASC'|'DESC' $order * @return Traversable<FreshRSS_Entry> + * @throws FreshRSS_EntriesGetter_Exception */ public function listWhere(string $type = 'a', int $id = 0, int $state = FreshRSS_Entry::STATE_ALL, string $order = 'DESC', int $limit = 1, string $firstId = '', @@ -1226,6 +1230,7 @@ SQL; * @param int $id category/feed/tag ID * @param 'ASC'|'DESC' $order * @return array<numeric-string>|null + * @throws FreshRSS_EntriesGetter_Exception */ public function listIdsWhere(string $type = 'a', int $id = 0, int $state = FreshRSS_Entry::STATE_ALL, string $order = 'DESC', int $limit = 1, string $firstId = '', ?FreshRSS_BooleanSearch $filters = null): ?array { |
