diff options
author | provokateurin <kate@provokateurin.de> | 2024-09-24 15:53:13 +0200 |
---|---|---|
committer | provokateurin <kate@provokateurin.de> | 2024-11-05 09:58:11 +0100 |
commit | 77114fb3277742fc69ddcf2432311ecb263af97e (patch) | |
tree | 0f360660038c65acc5f9cd014f183e45b0c5355b /lib/public/Files/Template/Template.php | |
parent | 1140e41db2ef6241f806eb605df48642a2a32c62 (diff) | |
download | nextcloud-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 'lib/public/Files/Template/Template.php')
-rw-r--r-- | lib/public/Files/Template/Template.php | 28 |
1 files changed, 26 insertions, 2 deletions
diff --git a/lib/public/Files/Template/Template.php b/lib/public/Files/Template/Template.php index 634935d212e..7f01c2afa48 100644 --- a/lib/public/Files/Template/Template.php +++ b/lib/public/Files/Template/Template.php @@ -24,7 +24,7 @@ final class Template implements \JsonSerializable { private $hasPreview = false; /** @var string|null */ private $previewUrl = null; - /** @var array */ + /** @var list<Field> */ private $fields = []; /** @@ -51,6 +51,7 @@ final class Template implements \JsonSerializable { } /** + * @param list<Field> $fields * @since 30.0.0 */ public function setFields(array $fields): void { @@ -58,6 +59,29 @@ final class Template implements \JsonSerializable { } /** + * @return array{ + * templateType: string, + * templateId: string, + * basename: string, + * etag: string, + * fileid: int, + * filename: string, + * lastmod: int, + * mime: string, + * size: int|float, + * type: string, + * hasPreview: bool, + * previewUrl: ?string, + * fields: list<array{ + * index: string, + * type: string, + * alias: ?string, + * tag: ?string, + * id: ?int, + * content?: string, + * checked?: bool, + * }>, + * } * @since 21.0.0 */ public function jsonSerialize(): array { @@ -74,7 +98,7 @@ final class Template implements \JsonSerializable { 'type' => $this->file->getType(), 'hasPreview' => $this->hasPreview, 'previewUrl' => $this->previewUrl, - 'fields' => $this->fields + 'fields' => array_map(static fn (Field $field) => $field->jsonSerialize(), $this->fields), ]; } } |