aboutsummaryrefslogtreecommitdiffstats
path: root/core/Controller/TextToImageApiController.php
diff options
context:
space:
mode:
authorprovokateurin <kate@provokateurin.de>2024-09-24 15:53:13 +0200
committerprovokateurin <kate@provokateurin.de>2024-11-05 09:58:11 +0100
commit77114fb3277742fc69ddcf2432311ecb263af97e (patch)
tree0f360660038c65acc5f9cd014f183e45b0c5355b /core/Controller/TextToImageApiController.php
parent1140e41db2ef6241f806eb605df48642a2a32c62 (diff)
downloadnextcloud-server-fix/openapi/array-syntax.tar.gz
nextcloud-server-fix/openapi/array-syntax.zip
fix(OpenAPI): Adjust array syntax to avoid ambiguitiesfix/openapi/array-syntax
Signed-off-by: provokateurin <kate@provokateurin.de>
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,