Skip to content

Commit e73b240

Browse files
committed
fix: psalm issues
Signed-off-by: Jana Peper <[email protected]>
1 parent 8eb513a commit e73b240

5 files changed

Lines changed: 19 additions & 11 deletions

File tree

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
"nextcloud/ocp": "dev-master",
3535
"nextcloud/openapi-extractor": "^1.0.0",
3636
"phpunit/phpunit": "^9.5",
37-
"psalm/phar": "6.7"
37+
"psalm/phar": "6.15"
3838
},
3939
"config": {
4040
"sort-packages": true,

composer.lock

Lines changed: 8 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/Controller/ChattyLLMController.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -422,7 +422,9 @@ public function getMessages(int $sessionId, int $limit = 20, int $cursor = 0): J
422422
array_shift($messages);
423423
}
424424

425-
return new JSONResponse(array_map(static function (Message $message) { return $message->jsonSerialize(); }, $messages));
425+
return new JSONResponse(array_map(static function (Message $message) {
426+
return $message->jsonSerialize();
427+
}, $messages));
426428
} catch (\OCP\DB\Exception $e) {
427429
$this->logger->warning('Failed to get chat messages', ['exception' => $e]);
428430
return new JSONResponse(['error' => $this->l10n->t('Failed to get chat messages')], Http::STATUS_INTERNAL_SERVER_ERROR);

psalm.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<psalm
77
errorBaseline="tests/psalm-baseline.xml"
88
errorLevel="4"
9-
findUnusedBaselineEntry="true"
9+
findUnusedBaselineEntry="false"
1010
findUnusedCode="false"
1111
resolveFromConfigFile="true"
1212
ensureOverrideAttribute="false"

tests/psalm-baseline.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@
55
-->
66
<files psalm-version="5.26.1@d747f6500b38ac4f7dfc5edbcae6e4b637d7add0">
77
<file src="lib/Controller/AssistantApiController.php">
8+
<InvalidReturnStatement>
9+
<code><![CDATA[$response]]></code>
10+
</InvalidReturnStatement>
11+
<InvalidReturnType>
12+
<code><![CDATA[DataDownloadResponse<Http::STATUS_OK, string, array{}>|DataResponse<Http::STATUS_NOT_FOUND, '', array{}>]]></code>
13+
</InvalidReturnType>
814
<LessSpecificReturnStatement>
915
<code><![CDATA[new DataResponse(['tasks' => $serializedTasks])]]></code>
1016
<code><![CDATA[new DataResponse(['types' => $taskTypes])]]></code>

0 commit comments

Comments
 (0)