From af37467128e8b83e72ffa7de02528f9f51d953fb Mon Sep 17 00:00:00 2001 From: Matias De lellis Date: Mon, 20 Sep 2021 21:39:10 -0300 Subject: [PATCH] More return types --- lib/Db/Note.php | 4 ++-- lib/Db/NoteMapper.php | 2 +- lib/Db/NoteTagMapper.php | 2 +- lib/Service/NoteService.php | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/Db/Note.php b/lib/Db/Note.php index 3407359..d962560 100644 --- a/lib/Db/Note.php +++ b/lib/Db/Note.php @@ -57,11 +57,11 @@ class Note extends Entity implements JsonSerializable { $this->sharedBy = $sharedBy; } - public function setTags(array $tags) { + public function setTags(array $tags): void { $this->tags = $tags; } - public function setAttachts(array $attachts) { + public function setAttachts(array $attachts): void { $this->attachts = $attachts; } diff --git a/lib/Db/NoteMapper.php b/lib/Db/NoteMapper.php index a5a1e4f..bfb0b37 100644 --- a/lib/Db/NoteMapper.php +++ b/lib/Db/NoteMapper.php @@ -98,7 +98,7 @@ class NoteMapper extends QBMapper { /** * @return int */ - public function colorIdCount($colorid): int { + public function colorIdCount(int $colorid): int { $qb = $this->db->getQueryBuilder(); $qb->select('id') ->from($this->tableName) diff --git a/lib/Db/NoteTagMapper.php b/lib/Db/NoteTagMapper.php index 1bb25e5..f218e45 100644 --- a/lib/Db/NoteTagMapper.php +++ b/lib/Db/NoteTagMapper.php @@ -15,7 +15,7 @@ class NoteTagMapper extends QBMapper { parent::__construct($db, 'quicknotes_note_tags', NoteTag::class); } - public function findNoteTag(string $userId, int $noteId, $tagId): NoteTag { + public function findNoteTag(string $userId, int $noteId, int $tagId): NoteTag { $qb = $this->db->getQueryBuilder(); $qb->select('*') ->from($this->getTableName()) diff --git a/lib/Service/NoteService.php b/lib/Service/NoteService.php index e433235..9f20e96 100644 --- a/lib/Service/NoteService.php +++ b/lib/Service/NoteService.php @@ -150,7 +150,7 @@ class NoteService { public function get(string $userId, int $id): ?Note { try { return $this->notemapper->find($id, $userId); - } catch(Exception $e) { + } catch(DoesNotExistException $e) { return null; } }