aboutsummaryrefslogtreecommitdiffstats
path: root/core/Controller/TranslationApiController.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/TranslationApiController.php
parent1140e41db2ef6241f806eb605df48642a2a32c62 (diff)
downloadnextcloud-server-77114fb3277742fc69ddcf2432311ecb263af97e.tar.gz
nextcloud-server-77114fb3277742fc69ddcf2432311ecb263af97e.zip
fix(OpenAPI): Adjust array syntax to avoid ambiguitiesfix/openapi/array-syntax
Signed-off-by: provokateurin <kate@provokateurin.de>
Diffstat (limited to 'core/Controller/TranslationApiController.php')
-rw-r--r--core/Controller/TranslationApiController.php4
1 files changed, 2 insertions, 2 deletions
diff --git a/core/Controller/TranslationApiController.php b/core/Controller/TranslationApiController.php
index 81ed190277b..294251baa47 100644
--- a/core/Controller/TranslationApiController.php
+++ b/core/Controller/TranslationApiController.php
@@ -36,7 +36,7 @@ class TranslationApiController extends \OCP\AppFramework\OCSController {
/**
* Get the list of supported languages
*
- * @return DataResponse<Http::STATUS_OK, array{languages: array{from: string, fromLabel: string, to: string, toLabel: string}[], languageDetection: bool}, array{}>
+ * @return DataResponse<Http::STATUS_OK, array{languages: list<array{from: string, fromLabel: string, to: string, toLabel: string}>, languageDetection: bool}, array{}>
*
* 200: Supported languages returned
*/
@@ -44,7 +44,7 @@ class TranslationApiController extends \OCP\AppFramework\OCSController {
#[ApiRoute(verb: 'GET', url: '/languages', root: '/translation')]
public function languages(): DataResponse {
return new DataResponse([
- 'languages' => array_map(fn ($lang) => $lang->jsonSerialize(), $this->translationManager->getLanguages()),
+ 'languages' => array_values(array_map(fn ($lang) => $lang->jsonSerialize(), $this->translationManager->getLanguages())),
'languageDetection' => $this->translationManager->canDetectLanguage(),
]);
}