aboutsummaryrefslogtreecommitdiffstats
path: root/core/Controller/TextProcessingApiController.php
diff options
context:
space:
mode:
Diffstat (limited to 'core/Controller/TextProcessingApiController.php')
-rw-r--r--core/Controller/TextProcessingApiController.php9
1 files changed, 4 insertions, 5 deletions
diff --git a/core/Controller/TextProcessingApiController.php b/core/Controller/TextProcessingApiController.php
index a0acf193289..cdf39563167 100644
--- a/core/Controller/TextProcessingApiController.php
+++ b/core/Controller/TextProcessingApiController.php
@@ -52,7 +52,7 @@ class TextProcessingApiController extends \OCP\AppFramework\OCSController {
/**
* This endpoint returns all available LanguageModel task types
*
- * @return DataResponse<Http::STATUS_OK, array{types: array{id: string, name: string, description: string}[]}, array{}>
+ * @return DataResponse<Http::STATUS_OK, array{types: list<array{id: string, name: string, description: string}>}, array{}>
*
* 200: Task types returned
*/
@@ -191,7 +191,7 @@ class TextProcessingApiController extends \OCP\AppFramework\OCSController {
*
* @param string $appId ID of the app
* @param string|null $identifier An arbitrary identifier for the task
- * @return DataResponse<Http::STATUS_OK, array{tasks: CoreTextProcessingTask[]}, array{}>|DataResponse<Http::STATUS_INTERNAL_SERVER_ERROR, array{message: string}, array{}>
+ * @return DataResponse<Http::STATUS_OK, array{tasks: list<CoreTextProcessingTask>}, array{}>|DataResponse<Http::STATUS_INTERNAL_SERVER_ERROR, array{message: string}, array{}>
*
* 200: Task list returned
*/
@@ -200,10 +200,9 @@ class TextProcessingApiController extends \OCP\AppFramework\OCSController {
public function listTasksByApp(string $appId, ?string $identifier = null): DataResponse {
try {
$tasks = $this->textProcessingManager->getUserTasksByApp($this->userId, $appId, $identifier);
- /** @var CoreTextProcessingTask[] $json */
- $json = array_map(static function (Task $task) {
+ $json = array_values(array_map(static function (Task $task) {
return $task->jsonSerialize();
- }, $tasks);
+ }, $tasks));
return new DataResponse([
'tasks' => $json,