Skip to content

Commit 4c457c4

Browse files
committed
fix: fix some psalm issues
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
1 parent dd51bb2 commit 4c457c4

3 files changed

Lines changed: 7 additions & 4 deletions

File tree

lib/Dav/Faces/FacePhoto.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,9 @@ public function hasPreview(): bool {
123123

124124
public function isFavorite(): bool {
125125
$tagger = $this->tagManager->load('files');
126+
if ($tagger === null) {
127+
return false;
128+
}
126129
$tags = $tagger->getTagsForObjects([$this->getFile()->getId()]);
127130

128131
if ($tags === false || empty($tags)) {

lib/Migration/Version011000002Date20260129094821.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public function __construct(
2020
) {
2121
}
2222

23-
public function postSchemaChange(IOutput $output, Closure $schemaClosure, array $options) {
23+
public function postSchemaChange(IOutput $output, Closure $schemaClosure, array $options): void {
2424
foreach (SettingsService::LAZY_SETTINGS as $settingsKey) {
2525
if ($this->appConfig->hasAppKey($settingsKey, lazy: false)) {
2626
$value = $this->appConfig->getAppValueString($settingsKey);

lib/Service/TagManager.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,13 +73,13 @@ public function assignTags(int $fileId, array $tags): void {
7373
}, $tags);
7474
$tags[] = $this->getProcessedTag()->getId();
7575
/** @var array<string, string[]> $tagsByFile */
76-
$tagsByFile = $this->objectMapper->getTagIdsForObjects([$fileId], 'files');
76+
$tagsByFile = $this->objectMapper->getTagIdsForObjects([(string)$fileId], 'files');
7777
$oldTags = $tagsByFile[(string) $fileId];
78-
$this->objectMapper->assignTags((string)$fileId, 'files', array_unique(array_merge($tags, $oldTags)));
78+
$this->objectMapper->assignTags((string)$fileId, 'files', array_values(array_unique(array_merge($tags, $oldTags))));
7979
}
8080

8181
/**
82-
* @param array $fileIds
82+
* @param list<string> $fileIds
8383
* @return array<array-key, array<array-key,ISystemTag>>
8484
*/
8585
public function getTagsForFiles(array $fileIds): array {

0 commit comments

Comments
 (0)