aboutsummaryrefslogtreecommitdiffstats
path: root/core/Controller/TextToImageApiController.php
diff options
context:
space:
mode:
authorJohn Molakvoæ <skjnldsv@users.noreply.github.com>2024-11-06 08:56:30 +0100
committerGitHub <noreply@github.com>2024-11-06 08:56:30 +0100
commitd53fde8eef13d408fcf035ea8a95e6345df9b99b (patch)
tree60f6b612d967a9a264589cdd6cc0c6d008e1bf05 /core/Controller/TextToImageApiController.php
parent8fab143aa486904f7a17c4f1c2f6364cd43bf9d9 (diff)
parent77114fb3277742fc69ddcf2432311ecb263af97e (diff)
downloadnextcloud-server-d53fde8eef13d408fcf035ea8a95e6345df9b99b.tar.gz
nextcloud-server-d53fde8eef13d408fcf035ea8a95e6345df9b99b.zip
Merge pull request #49015 from nextcloud/fix/openapi/array-syntax
Diffstat (limited to 'core/Controller/TextToImageApiController.php')
-rw-r--r--core/Controller/TextToImageApiController.php7
1 files changed, 3 insertions, 4 deletions
diff --git a/core/Controller/TextToImageApiController.php b/core/Controller/TextToImageApiController.php
index 241c752ea01..3ffc868e80f 100644
--- a/core/Controller/TextToImageApiController.php
+++ b/core/Controller/TextToImageApiController.php
@@ -212,7 +212,7 @@ class TextToImageApiController 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: CoreTextToImageTask[]}, array{}>|DataResponse<Http::STATUS_INTERNAL_SERVER_ERROR, array{message: string}, array{}>
+ * @return DataResponse<Http::STATUS_OK, array{tasks: list<CoreTextToImageTask>}, array{}>|DataResponse<Http::STATUS_INTERNAL_SERVER_ERROR, array{message: string}, array{}>
*
* 200: Task list returned
*/
@@ -222,10 +222,9 @@ class TextToImageApiController extends \OCP\AppFramework\OCSController {
public function listTasksByApp(string $appId, ?string $identifier = null): DataResponse {
try {
$tasks = $this->textToImageManager->getUserTasksByApp($this->userId, $appId, $identifier);
- /** @var CoreTextToImageTask[] $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,