mirror of
https://github.com/JanGross/quicknotes.git
synced 2025-12-01 07:37:18 +01:00
More return types
This commit is contained in:
@@ -57,11 +57,11 @@ class Note extends Entity implements JsonSerializable {
|
|||||||
$this->sharedBy = $sharedBy;
|
$this->sharedBy = $sharedBy;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setTags(array $tags) {
|
public function setTags(array $tags): void {
|
||||||
$this->tags = $tags;
|
$this->tags = $tags;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setAttachts(array $attachts) {
|
public function setAttachts(array $attachts): void {
|
||||||
$this->attachts = $attachts;
|
$this->attachts = $attachts;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -98,7 +98,7 @@ class NoteMapper extends QBMapper {
|
|||||||
/**
|
/**
|
||||||
* @return int
|
* @return int
|
||||||
*/
|
*/
|
||||||
public function colorIdCount($colorid): int {
|
public function colorIdCount(int $colorid): int {
|
||||||
$qb = $this->db->getQueryBuilder();
|
$qb = $this->db->getQueryBuilder();
|
||||||
$qb->select('id')
|
$qb->select('id')
|
||||||
->from($this->tableName)
|
->from($this->tableName)
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ class NoteTagMapper extends QBMapper {
|
|||||||
parent::__construct($db, 'quicknotes_note_tags', NoteTag::class);
|
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 = $this->db->getQueryBuilder();
|
||||||
$qb->select('*')
|
$qb->select('*')
|
||||||
->from($this->getTableName())
|
->from($this->getTableName())
|
||||||
|
|||||||
@@ -150,7 +150,7 @@ class NoteService {
|
|||||||
public function get(string $userId, int $id): ?Note {
|
public function get(string $userId, int $id): ?Note {
|
||||||
try {
|
try {
|
||||||
return $this->notemapper->find($id, $userId);
|
return $this->notemapper->find($id, $userId);
|
||||||
} catch(Exception $e) {
|
} catch(DoesNotExistException $e) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user