Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions lib/ResponseDefinitions.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@
* mimeType: string,
* hasPreview: bool,
* reason: string,
* owner: ?string,
* permissions: int,
* size: int,
* }
*
* @psalm-suppress UnusedClass
Expand Down
3 changes: 3 additions & 0 deletions lib/Service/RecommendedFile.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,11 @@
}

/**
* @return RecommendationsRecommendedFile

Check failure on line 65 in lib/Service/RecommendedFile.php

View workflow job for this annotation

GitHub Actions / static-psalm-analysis dev-master

MoreSpecificReturnType

lib/Service/RecommendedFile.php:65:13: MoreSpecificReturnType: The declared return type 'array{directory: string, extension: string, hasPreview: bool, id: string, mimeType: string, name: string, owner: null|string, permissions: int, reason: string, size: int, timestamp: int}' for OCA\Recommendations\Service\RecommendedFile::jsonSerialize is more specific than the inferred return type 'array{directory: string, extension: string, hasPreview: bool, id: string, mimeType: string, name: string, owner: non-falsy-string|null, permissions: int, reason: string, size: float|int, timestamp: int}' (see https://psalm.dev/070)
*/
#[\ReturnTypeWillChange]
public function jsonSerialize() {
return [

Check failure on line 69 in lib/Service/RecommendedFile.php

View workflow job for this annotation

GitHub Actions / static-psalm-analysis dev-master

LessSpecificReturnStatement

lib/Service/RecommendedFile.php:69:10: LessSpecificReturnStatement: The type 'array{directory: string, extension: string, hasPreview: bool, id: string, mimeType: string, name: string, owner: non-falsy-string|null, permissions: int, reason: string, size: float|int, timestamp: int}' is more general than the declared return type 'array{directory: string, extension: string, hasPreview: bool, id: string, mimeType: string, name: string, owner: null|string, permissions: int, reason: string, size: int, timestamp: int}' for OCA\Recommendations\Service\RecommendedFile::jsonSerialize (see https://psalm.dev/129)
'id' => $this->getId(),
'timestamp' => $this->getTimestamp(),
'name' => $this->node->getName(),
Expand All @@ -75,6 +75,9 @@
'mimeType' => $this->node->getMimetype(),
'hasPreview' => $this->hasPreview(),
'reason' => $this->getReason(),
'owner' => $this->node->getOwner()?->getUID() ?: null,
'permissions' => $this->node->getPermissions(),
'size' => $this->node->getSize(),
];
}
}
17 changes: 16 additions & 1 deletion openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,10 @@
"extension",
"mimeType",
"hasPreview",
"reason"
"reason",
"owner",
"permissions",
"size"
],
"properties": {
"id": {
Expand All @@ -97,6 +100,18 @@
},
"reason": {
"type": "string"
},
"owner": {
"type": "string",
"nullable": true
},
"permissions": {
"type": "integer",
"format": "int64"
},
"size": {
"type": "integer",
"format": "int64"
}
}
}
Expand Down
Loading