From 24c69e27d214e14d7dd90f09f0729eb52d6ecd05 Mon Sep 17 00:00:00 2001 From: Julius Knorr Date: Tue, 26 Nov 2024 22:34:27 +0100 Subject: [PATCH] chore: Match more strict psalm typings Signed-off-by: Julius Knorr --- lib/AppInfo/DashboardWidget.php | 4 ++-- lib/Service/TagService.php | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/AppInfo/DashboardWidget.php b/lib/AppInfo/DashboardWidget.php index d9d95d4fc..2c5866866 100644 --- a/lib/AppInfo/DashboardWidget.php +++ b/lib/AppInfo/DashboardWidget.php @@ -98,7 +98,7 @@ public function getWidgetButtons(string $userId): array { public function getItems(string $userId, ?string $since = null, int $limit = 7): array { $notes = $this->notesService->getTopNotes($userId); $notes = array_slice($notes, 0, $limit); - return array_map(function (Note $note) { + return array_values(array_map(function (Note $note): WidgetItem { $excerpt = ''; try { $excerpt = $note->getExcerpt(); @@ -109,7 +109,7 @@ public function getItems(string $userId, ?string $since = null, int $limit = 7): ? $this->url->getAbsoluteURL($this->url->imagePath('core', 'actions/starred.svg')) : $this->getIconUrl(); return new WidgetItem($note->getTitle(), $excerpt, $link, $icon, (string)$note->getModified()); - }, $notes); + }, $notes)); } public function getIconUrl(): string { diff --git a/lib/Service/TagService.php b/lib/Service/TagService.php index 6b78e0ad7..54d975221 100644 --- a/lib/Service/TagService.php +++ b/lib/Service/TagService.php @@ -20,6 +20,10 @@ public function __construct(ITagManager $tagManager) { $this->tagger = $tagManager->load('files'); } + /** + * @param list $fileIds + * @return void + */ public function loadTags(array $fileIds) : void { $this->cachedTags = $this->tagger->getTagsForObjects($fileIds); }