Skip to content

Commit d53fde8

Browse files
authored
Merge pull request #49015 from nextcloud/fix/openapi/array-syntax
2 parents 8fab143 + 77114fb commit d53fde8

File tree

109 files changed

+698
-448
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

109 files changed

+698
-448
lines changed

apps/cloud_federation_api/lib/Capabilities.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,11 @@ public function __construct(
3131
* enabled: bool,
3232
* apiVersion: string,
3333
* endPoint: string,
34-
* resourceTypes: array{
34+
* resourceTypes: list<array{
3535
* name: string,
36-
* shareTypes: string[],
36+
* shareTypes: list<string>,
3737
* protocols: array<string, string>
38-
* }[],
38+
* }>,
3939
* },
4040
* }
4141
* @throws OCMArgumentException

apps/cloud_federation_api/lib/Controller/RequestHandlerController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ public function __construct(
6767
* @param string|null $ownerDisplayName Display name of the user who shared the item
6868
* @param string|null $sharedBy Provider specific UID of the user who shared the resource
6969
* @param string|null $sharedByDisplayName Display name of the user who shared the resource
70-
* @param array{name: string[], options: array<string, mixed>} $protocol e,.g. ['name' => 'webdav', 'options' => ['username' => 'john', 'permissions' => 31]]
70+
* @param array{name: list<string>, options: array<string, mixed>} $protocol e,.g. ['name' => 'webdav', 'options' => ['username' => 'john', 'permissions' => 31]]
7171
* @param string $shareType 'group' or 'user' share
7272
* @param string $resourceType 'file', 'calendar',...
7373
*

apps/cloud_federation_api/lib/ResponseDefinitions.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@
2020
* }
2121
*
2222
* @psalm-type CloudFederationAPIValidationError = CloudFederationAPIError&array{
23-
* validationErrors: array{
23+
* validationErrors: list<array{
2424
* name: string,
2525
* message: string|null,
26-
* }[],
26+
* }>,
2727
* }
2828
*/
2929
class ResponseDefinitions {

apps/dashboard/lib/Controller/DashboardApiController.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,8 @@ static function (IWidget $widget) use ($widgetIds) {
7474
* @param array<string, string> $sinceIds Array indexed by widget Ids, contains date/id from which we want the new items
7575
* @param int $limit Limit number of result items per widget
7676
* @psalm-param int<1, 30> $limit
77-
* @param string[] $widgets Limit results to specific widgets
78-
* @return DataResponse<Http::STATUS_OK, array<string, DashboardWidgetItem[]>, array{}>
77+
* @param list<string> $widgets Limit results to specific widgets
78+
* @return DataResponse<Http::STATUS_OK, array<string, list<DashboardWidgetItem>>, array{}>
7979
*
8080
* 200: Widget items returned
8181
*/
@@ -102,7 +102,7 @@ public function getWidgetItems(array $sinceIds = [], int $limit = 7, array $widg
102102
* @param array<string, string> $sinceIds Array indexed by widget Ids, contains date/id from which we want the new items
103103
* @param int $limit Limit number of result items per widget, not more than 30 are allowed
104104
* @psalm-param int<1, 30> $limit
105-
* @param string[] $widgets Limit results to specific widgets
105+
* @param list<string> $widgets Limit results to specific widgets
106106
* @return DataResponse<Http::STATUS_OK, array<string, DashboardWidgetItems>, array{}>
107107
*
108108
* 200: Widget items returned

apps/dashboard/lib/ResponseDefinitions.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,13 @@
1818
* icon_url: string,
1919
* widget_url: ?string,
2020
* item_icons_round: bool,
21-
* item_api_versions: int[],
21+
* item_api_versions: list<int>,
2222
* reload_interval: int,
23-
* buttons?: array{
23+
* buttons?: list<array{
2424
* type: string,
2525
* text: string,
2626
* link: string,
27-
* }[],
27+
* }>,
2828
* }
2929
*
3030
* @psalm-type DashboardWidgetItem = array{
@@ -37,7 +37,7 @@
3737
* }
3838
*
3939
* @psalm-type DashboardWidgetItems = array{
40-
* items: DashboardWidgetItem[],
40+
* items: list<DashboardWidgetItem>,
4141
* emptyContentMessage: string,
4242
* halfEmptyContentMessage: string,
4343
* }

apps/dav/lib/Controller/UpcomingEventsController.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public function __construct(
3535
* Get information about upcoming events
3636
*
3737
* @param string|null $location location/URL to filter by
38-
* @return DataResponse<Http::STATUS_OK, array{events: DAVUpcomingEvent[]}, array{}>|DataResponse<Http::STATUS_UNAUTHORIZED, null, array{}>
38+
* @return DataResponse<Http::STATUS_OK, array{events: list<DAVUpcomingEvent>}, array{}>|DataResponse<Http::STATUS_UNAUTHORIZED, null, array{}>
3939
*
4040
* 200: Upcoming events
4141
* 401: When not authenticated
@@ -47,10 +47,10 @@ public function getEvents(?string $location = null): DataResponse {
4747
}
4848

4949
return new DataResponse([
50-
'events' => array_map(fn (UpcomingEvent $e) => $e->jsonSerialize(), $this->service->getEvents(
50+
'events' => array_values(array_map(fn (UpcomingEvent $e) => $e->jsonSerialize(), $this->service->getEvents(
5151
$this->userId,
5252
$location,
53-
)),
53+
))),
5454
]);
5555
}
5656

apps/federatedfilesharing/lib/Controller/RequestHandlerController.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ public function __construct(
7272
* @param int|null $remoteId ID of the remote
7373
* @param string|null $sharedByFederatedId Federated ID of the sender
7474
* @param string|null $ownerFederatedId Federated ID of the receiver
75-
* @return Http\DataResponse<Http::STATUS_OK, array<empty>, array{}>
75+
* @return Http\DataResponse<Http::STATUS_OK, list<empty>, array{}>
7676
* @throws OCSException
7777
*
7878
* 200: Share created successfully
@@ -186,7 +186,7 @@ public function reShare(int $id, ?string $token = null, ?string $shareWith = nul
186186
*
187187
* @param int $id ID of the remote share
188188
* @param string|null $token Shared secret between servers
189-
* @return Http\DataResponse<Http::STATUS_OK, array<empty>, array{}>
189+
* @return Http\DataResponse<Http::STATUS_OK, list<empty>, array{}>
190190
* @throws OCSException
191191
* @throws ShareNotFound
192192
* @throws HintException
@@ -221,7 +221,7 @@ public function acceptShare(int $id, ?string $token = null) {
221221
*
222222
* @param int $id ID of the remote share
223223
* @param string|null $token Shared secret between servers
224-
* @return Http\DataResponse<Http::STATUS_OK, array<empty>, array{}>
224+
* @return Http\DataResponse<Http::STATUS_OK, list<empty>, array{}>
225225
* @throws OCSException
226226
*
227227
* 200: Share declined successfully
@@ -254,7 +254,7 @@ public function declineShare(int $id, ?string $token = null) {
254254
*
255255
* @param int $id ID of the share
256256
* @param string|null $token Shared secret between servers
257-
* @return Http\DataResponse<Http::STATUS_OK, array<empty>, array{}>
257+
* @return Http\DataResponse<Http::STATUS_OK, list<empty>, array{}>
258258
* @throws OCSException
259259
*
260260
* 200: Share unshared successfully
@@ -290,7 +290,7 @@ private function cleanupRemote($remote) {
290290
*
291291
* @param int $id ID of the share
292292
* @param string|null $token Shared secret between servers
293-
* @return Http\DataResponse<Http::STATUS_OK, array<empty>, array{}>
293+
* @return Http\DataResponse<Http::STATUS_OK, list<empty>, array{}>
294294
* @throws OCSBadRequestException Revoking the share is not possible
295295
*
296296
* 200: Share revoked successfully
@@ -332,7 +332,7 @@ private function isS2SEnabled($incoming = false) {
332332
* @param int $id ID of the share
333333
* @param string|null $token Shared secret between servers
334334
* @param int|null $permissions New permissions
335-
* @return Http\DataResponse<Http::STATUS_OK, array<empty>, array{}>
335+
* @return Http\DataResponse<Http::STATUS_OK, list<empty>, array{}>
336336
* @throws OCSBadRequestException Updating permissions is not possible
337337
*
338338
* 200: Permissions updated successfully

apps/federation/lib/Controller/OCSAuthAPIController.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public function __construct(
5252
*
5353
* @param string $url URL of the server
5454
* @param string $token Token of the server
55-
* @return DataResponse<Http::STATUS_OK, array<empty>, array{}>
55+
* @return DataResponse<Http::STATUS_OK, list<empty>, array{}>
5656
* @throws OCSForbiddenException Requesting shared secret is not allowed
5757
*
5858
* 200: Shared secret requested successfully
@@ -87,7 +87,7 @@ public function getSharedSecretLegacy(string $url, string $token): DataResponse
8787
*
8888
* @param string $url URL of the server
8989
* @param string $token Token of the server
90-
* @return DataResponse<Http::STATUS_OK, array<empty>, array{}>
90+
* @return DataResponse<Http::STATUS_OK, list<empty>, array{}>
9191
* @throws OCSForbiddenException Requesting shared secret is not allowed
9292
*
9393
* 200: Shared secret requested successfully

apps/files/lib/Capabilities.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public function __construct(
2121
/**
2222
* Return this classes capabilities
2323
*
24-
* @return array{files: array{'$comment': ?string, bigfilechunking: bool, blacklisted_files: array<mixed>, forbidden_filenames: list<string>, forbidden_filename_basenames: list<string>, forbidden_filename_characters: list<string>, forbidden_filename_extensions: list<string>, chunked_upload: array{max_size: int, max_parallel_count: int}}}
24+
* @return array{files: array{'$comment': ?string, bigfilechunking: bool, blacklisted_files: list<mixed>, forbidden_filenames: list<string>, forbidden_filename_basenames: list<string>, forbidden_filename_characters: list<string>, forbidden_filename_extensions: list<string>, chunked_upload: array{max_size: int, max_parallel_count: int}}}
2525
*/
2626
public function getCapabilities(): array {
2727
return [

apps/files/lib/Controller/DirectEditingController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public function __construct(
3636

3737
/**
3838
* Get the direct editing capabilities
39-
* @return DataResponse<Http::STATUS_OK, array{editors: array<string, array{id: string, name: string, mimetypes: string[], optionalMimetypes: string[], secure: bool}>, creators: array<string, array{id: string, editor: string, name: string, extension: string, templates: bool, mimetypes: string[]}>}, array{}>
39+
* @return DataResponse<Http::STATUS_OK, array{editors: array<string, array{id: string, name: string, mimetypes: list<string>, optionalMimetypes: list<string>, secure: bool}>, creators: array<string, array{id: string, editor: string, name: string, extension: string, templates: bool, mimetypes: list<string>}>}, array{}>
4040
*
4141
* 200: Direct editing capabilities returned
4242
*/

0 commit comments

Comments
 (0)