Skip to content

Commit 5e577d1

Browse files
committed
refactor: Rename OpenAPI type aliases to their namespaces
Signed-off-by: jld3103 <[email protected]>
1 parent ad2423c commit 5e577d1

18 files changed

Lines changed: 125 additions & 125 deletions

apps/cloud_federation_api/lib/Controller/RequestHandlerController.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,9 @@
5151
*
5252
* @package OCA\CloudFederationAPI\Controller
5353
*
54-
* @psalm-import-type CloudFederationApiAddShare from ResponseDefinitions
55-
* @psalm-import-type CloudFederationApiValidationError from ResponseDefinitions
56-
* @psalm-import-type CloudFederationApiError from ResponseDefinitions
54+
* @psalm-import-type CloudFederationAPIAddShare from ResponseDefinitions
55+
* @psalm-import-type CloudFederationAPIValidationError from ResponseDefinitions
56+
* @psalm-import-type CloudFederationAPIError from ResponseDefinitions
5757
*/
5858
class RequestHandlerController extends Controller {
5959
public function __construct(
@@ -90,7 +90,7 @@ public function __construct(
9090
* @param string $shareType 'group' or 'user' share
9191
* @param string $resourceType 'file', 'calendar',...
9292
*
93-
* @return JSONResponse<Http::STATUS_CREATED, CloudFederationApiAddShare, array{}>|JSONResponse<Http::STATUS_BAD_REQUEST, CloudFederationApiValidationError, array{}>|JSONResponse<Http::STATUS_NOT_IMPLEMENTED, CloudFederationApiError, array{}>
93+
* @return JSONResponse<Http::STATUS_CREATED, CloudFederationAPIAddShare, array{}>|JSONResponse<Http::STATUS_BAD_REQUEST, CloudFederationAPIValidationError, array{}>|JSONResponse<Http::STATUS_NOT_IMPLEMENTED, CloudFederationAPIError, array{}>
9494
* 201: The notification was successfully received. The display name of the recipient might be returned in the body
9595
* 400: Bad request due to invalid parameters, e.g. when `shareWith` is not found or required properties are missing
9696
* 501: Share type or the resource type is not supported
@@ -213,7 +213,7 @@ public function addShare($shareWith, $name, $description, $providerId, $owner, $
213213
* @param string|null $providerId ID of the share
214214
* @param array<string, mixed>|null $notification The actual payload of the notification
215215
*
216-
* @return JSONResponse<Http::STATUS_CREATED, array<string, mixed>, array{}>|JSONResponse<Http::STATUS_BAD_REQUEST, CloudFederationApiValidationError, array{}>|JSONResponse<Http::STATUS_FORBIDDEN|Http::STATUS_NOT_IMPLEMENTED, CloudFederationApiError, array{}>
216+
* @return JSONResponse<Http::STATUS_CREATED, array<string, mixed>, array{}>|JSONResponse<Http::STATUS_BAD_REQUEST, CloudFederationAPIValidationError, array{}>|JSONResponse<Http::STATUS_FORBIDDEN|Http::STATUS_NOT_IMPLEMENTED, CloudFederationAPIError, array{}>
217217
* 201: The notification was successfully received
218218
* 400: Bad request due to invalid parameters, e.g. when `type` is invalid or missing
219219
* 403: Getting resource is not allowed

apps/cloud_federation_api/lib/ResponseDefinitions.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,15 @@
2626
namespace OCA\CloudFederationAPI;
2727

2828
/**
29-
* @psalm-type CloudFederationApiAddShare = array{
29+
* @psalm-type CloudFederationAPIAddShare = array{
3030
* recipientDisplayName: string,
3131
* }
3232
*
33-
* @psalm-type CloudFederationApiError = array{
33+
* @psalm-type CloudFederationAPIError = array{
3434
* message: string,
3535
* }
3636
*
37-
* @psalm-type CloudFederationApiValidationError = CloudFederationApiError&array{
37+
* @psalm-type CloudFederationAPIValidationError = CloudFederationAPIError&array{
3838
* validationErrors: array{
3939
* name: string,
4040
* message: string|null,

apps/files_external/lib/Controller/ApiController.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
use OCP\IRequest;
4141

4242
/**
43-
* @psalm-import-type FilesExternalMount from ResponseDefinitions
43+
* @psalm-import-type Files_ExternalMount from ResponseDefinitions
4444
*/
4545
class ApiController extends OCSController {
4646

@@ -64,7 +64,7 @@ public function __construct(
6464
* @param string $mountPoint mount point name, relative to the data dir
6565
* @param StorageConfig $mountConfig mount config to format
6666
*
67-
* @return FilesExternalMount
67+
* @return Files_ExternalMount
6868
*/
6969
private function formatMount(string $mountPoint, StorageConfig $mountConfig): array {
7070
// split path from mount point
@@ -100,7 +100,7 @@ private function formatMount(string $mountPoint, StorageConfig $mountConfig): ar
100100
*
101101
* Get the mount points visible for this user
102102
*
103-
* @return DataResponse<Http::STATUS_OK, FilesExternalMount[], array{}>
103+
* @return DataResponse<Http::STATUS_OK, Files_ExternalMount[], array{}>
104104
*
105105
* 200: User mounts returned
106106
*/

apps/files_external/lib/Lib/StorageConfig.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
/**
3737
* External storage configuration
3838
*
39-
* @psalm-import-type FilesExternalStorageConfig from ResponseDefinitions
39+
* @psalm-import-type Files_ExternalStorageConfig from ResponseDefinitions
4040
*/
4141
class StorageConfig implements \JsonSerializable {
4242
public const MOUNT_TYPE_ADMIN = 1;
@@ -399,7 +399,7 @@ public function setType($type) {
399399

400400
/**
401401
* Serialize config to JSON
402-
* @return FilesExternalStorageConfig
402+
* @return Files_ExternalStorageConfig
403403
*/
404404
public function jsonSerialize(bool $obfuscate = false): array {
405405
$result = [];

apps/files_external/lib/ResponseDefinitions.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
namespace OCA\Files_External;
2727

2828
/**
29-
* @psalm-type FilesExternalStorageConfig = array{
29+
* @psalm-type Files_ExternalStorageConfig = array{
3030
* applicableGroups?: string[],
3131
* applicableUsers?: string[],
3232
* authMechanism: string,
@@ -42,7 +42,7 @@
4242
* userProvided: bool,
4343
* }
4444
*
45-
* @psalm-type FilesExternalMount = array{
45+
* @psalm-type Files_ExternalMount = array{
4646
* name: string,
4747
* path: string,
4848
* type: 'dir',
@@ -51,7 +51,7 @@
5151
* permissions: int,
5252
* id: int,
5353
* class: string,
54-
* config: FilesExternalStorageConfig,
54+
* config: Files_ExternalStorageConfig,
5555
* }
5656
*/
5757
class ResponseDefinitions {

apps/files_sharing/lib/Controller/DeletedShareAPIController.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
use OCP\Share\IShare;
5252

5353
/**
54-
* @psalm-import-type FilesSharingDeletedShare from ResponseDefinitions
54+
* @psalm-import-type Files_SharingDeletedShare from ResponseDefinitions
5555
*/
5656
class DeletedShareAPIController extends OCSController {
5757

@@ -99,7 +99,7 @@ public function __construct(string $appName,
9999
/**
100100
* @suppress PhanUndeclaredClassMethod
101101
*
102-
* @return FilesSharingDeletedShare
102+
* @return Files_SharingDeletedShare
103103
*/
104104
private function formatShare(IShare $share): array {
105105
$result = [
@@ -187,7 +187,7 @@ private function formatShare(IShare $share): array {
187187
*
188188
* Get a list of all deleted shares
189189
*
190-
* @return DataResponse<Http::STATUS_OK, FilesSharingDeletedShare[], array{}>
190+
* @return DataResponse<Http::STATUS_OK, Files_SharingDeletedShare[], array{}>
191191
*
192192
* 200: Deleted shares returned
193193
*/

apps/files_sharing/lib/Controller/RemoteController.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
use Psr\Log\LoggerInterface;
3636

3737
/**
38-
* @psalm-import-type FilesSharingRemoteShare from ResponseDefinitions
38+
* @psalm-import-type Files_SharingRemoteShare from ResponseDefinitions
3939
*/
4040
class RemoteController extends OCSController {
4141
/**
@@ -61,7 +61,7 @@ public function __construct(
6161
*
6262
* Get list of pending remote shares
6363
*
64-
* @return DataResponse<Http::STATUS_OK, FilesSharingRemoteShare[], array{}>
64+
* @return DataResponse<Http::STATUS_OK, Files_SharingRemoteShare[], array{}>
6565
*
6666
* 200: Pending remote shares returned
6767
*/
@@ -139,7 +139,7 @@ private static function extendShareInfo($share) {
139139
*
140140
* Get a list of accepted remote shares
141141
*
142-
* @return DataResponse<Http::STATUS_OK, FilesSharingRemoteShare[], array{}>
142+
* @return DataResponse<Http::STATUS_OK, Files_SharingRemoteShare[], array{}>
143143
*
144144
* 200: Accepted remote shares returned
145145
*/
@@ -156,7 +156,7 @@ public function getShares() {
156156
* Get info of a remote share
157157
*
158158
* @param int $id ID of the share
159-
* @return DataResponse<Http::STATUS_OK, FilesSharingRemoteShare, array{}>
159+
* @return DataResponse<Http::STATUS_OK, Files_SharingRemoteShare, array{}>
160160
* @throws OCSNotFoundException Share not found
161161
*
162162
* 200: Share returned

apps/files_sharing/lib/Controller/ShareAPIController.php

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@
9191
/**
9292
* @package OCA\Files_Sharing\API
9393
*
94-
* @psalm-import-type FilesSharingShare from ResponseDefinitions
94+
* @psalm-import-type Files_SharingShare from ResponseDefinitions
9595
*/
9696
class ShareAPIController extends OCSController {
9797

@@ -177,7 +177,7 @@ public function __construct(
177177
*
178178
* @param \OCP\Share\IShare $share
179179
* @param Node|null $recipientNode
180-
* @return FilesSharingShare
180+
* @return Files_SharingShare
181181
* @throws NotFoundException In case the node can't be resolved.
182182
*
183183
* @suppress PhanUndeclaredClassMethod
@@ -508,7 +508,7 @@ private function getCachedFederatedDisplayName(string $userId, bool $cacheOnly =
508508
*
509509
* @param string $id ID of the share
510510
* @param bool $include_tags Include tags in the share
511-
* @return DataResponse<Http::STATUS_OK, FilesSharingShare, array{}>
511+
* @return DataResponse<Http::STATUS_OK, Files_SharingShare, array{}>
512512
* @throws OCSNotFoundException Share not found
513513
*
514514
* 200: Share returned
@@ -602,7 +602,7 @@ public function deleteShare(string $id): DataResponse {
602602
* @param string $label Label for the share (only used in link and email)
603603
* @param string|null $attributes Additional attributes for the share
604604
*
605-
* @return DataResponse<Http::STATUS_OK, FilesSharingShare, array{}>
605+
* @return DataResponse<Http::STATUS_OK, Files_SharingShare, array{}>
606606
* @throws OCSBadRequestException Unknown share type
607607
* @throws OCSException
608608
* @throws OCSForbiddenException Creating the share is not allowed
@@ -879,7 +879,7 @@ public function createShare(
879879
* @param null|Node $node
880880
* @param boolean $includeTags
881881
*
882-
* @return FilesSharingShare[]
882+
* @return Files_SharingShare[]
883883
*/
884884
private function getSharedWithMe($node, bool $includeTags): array {
885885
$userShares = $this->shareManager->getSharedWith($this->currentUser, IShare::TYPE_USER, $node, -1, 0);
@@ -916,7 +916,7 @@ private function getSharedWithMe($node, bool $includeTags): array {
916916
/**
917917
* @param \OCP\Files\Node $folder
918918
*
919-
* @return FilesSharingShare[]
919+
* @return Files_SharingShare[]
920920
* @throws OCSBadRequestException
921921
* @throws NotFoundException
922922
*/
@@ -978,7 +978,7 @@ private function getSharesInDir(Node $folder): array {
978978
* @param string $path Get shares for a specific path
979979
* @param string $include_tags Include tags in the share
980980
*
981-
* @return DataResponse<Http::STATUS_OK, FilesSharingShare[], array{}>
981+
* @return DataResponse<Http::STATUS_OK, Files_SharingShare[], array{}>
982982
* @throws OCSNotFoundException The folder was not found or is inaccessible
983983
*
984984
* 200: Shares returned
@@ -1026,7 +1026,7 @@ public function getShares(
10261026
* @param bool $subFiles
10271027
* @param bool $includeTags
10281028
*
1029-
* @return FilesSharingShare[]
1029+
* @return Files_SharingShare[]
10301030
* @throws NotFoundException
10311031
* @throws OCSBadRequestException
10321032
*/
@@ -1111,7 +1111,7 @@ private function getFormattedShares(
11111111
*
11121112
* @param string $path Path all shares will be relative to
11131113
*
1114-
* @return DataResponse<Http::STATUS_OK, FilesSharingShare[], array{}>
1114+
* @return DataResponse<Http::STATUS_OK, Files_SharingShare[], array{}>
11151115
* @throws InvalidPathException
11161116
* @throws NotFoundException
11171117
* @throws OCSNotFoundException The given path is invalid
@@ -1213,7 +1213,7 @@ private function hasPermission(int $permissionsSet, int $permissionsToCheck): bo
12131213
* @param string|null $label New label
12141214
* @param string|null $hideDownload New condition if the download should be hidden
12151215
* @param string|null $attributes New additional attributes
1216-
* @return DataResponse<Http::STATUS_OK, FilesSharingShare, array{}>
1216+
* @return DataResponse<Http::STATUS_OK, Files_SharingShare, array{}>
12171217
* @throws OCSBadRequestException Share could not be updated because the requested changes are invalid
12181218
* @throws OCSForbiddenException Missing permissions to update the share
12191219
* @throws OCSNotFoundException Share not found
@@ -1409,7 +1409,7 @@ public function updateShare(
14091409
*
14101410
* Get all shares that are still pending
14111411
*
1412-
* @return DataResponse<Http::STATUS_OK, FilesSharingShare[], array{}>
1412+
* @return DataResponse<Http::STATUS_OK, Files_SharingShare[], array{}>
14131413
*
14141414
* 200: Pending shares returned
14151415
*/

apps/files_sharing/lib/Controller/ShareInfoController.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
use OCP\Share\IManager;
3939

4040
/**
41-
* @psalm-import-type FilesSharingShareInfo from ResponseDefinitions
41+
* @psalm-import-type Files_SharingShareInfo from ResponseDefinitions
4242
*/
4343
class ShareInfoController extends ApiController {
4444

@@ -71,7 +71,7 @@ public function __construct(string $appName,
7171
* @param string|null $password Password of the share
7272
* @param string|null $dir Subdirectory to get info about
7373
* @param int $depth Maximum depth to get info about
74-
* @return JSONResponse<Http::STATUS_OK, FilesSharingShareInfo, array{}>|JSONResponse<Http::STATUS_FORBIDDEN|Http::STATUS_NOT_FOUND, array<empty>, array{}>
74+
* @return JSONResponse<Http::STATUS_OK, Files_SharingShareInfo, array{}>|JSONResponse<Http::STATUS_FORBIDDEN|Http::STATUS_NOT_FOUND, array<empty>, array{}>
7575
*
7676
* 200: Share info returned
7777
* 403: Getting share info is not allowed
@@ -112,7 +112,7 @@ public function info(string $t, ?string $password = null, ?string $dir = null, i
112112
}
113113

114114
/**
115-
* @return FilesSharingShareInfo
115+
* @return Files_SharingShareInfo
116116
*/
117117
private function parseNode(Node $node, int $permissionMask, int $depth): array {
118118
if ($node instanceof File) {
@@ -123,14 +123,14 @@ private function parseNode(Node $node, int $permissionMask, int $depth): array {
123123
}
124124

125125
/**
126-
* @return FilesSharingShareInfo
126+
* @return Files_SharingShareInfo
127127
*/
128128
private function parseFile(File $file, int $permissionMask): array {
129129
return $this->format($file, $permissionMask);
130130
}
131131

132132
/**
133-
* @return FilesSharingShareInfo
133+
* @return Files_SharingShareInfo
134134
*/
135135
private function parseFolder(Folder $folder, int $permissionMask, int $depth): array {
136136
$data = $this->format($folder, $permissionMask);
@@ -150,7 +150,7 @@ private function parseFolder(Folder $folder, int $permissionMask, int $depth): a
150150
}
151151

152152
/**
153-
* @return FilesSharingShareInfo
153+
* @return Files_SharingShareInfo
154154
*/
155155
private function format(Node $node, int $permissionMask): array {
156156
$entry = [];

apps/files_sharing/lib/Controller/ShareesAPIController.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,8 @@
5959
use function usort;
6060

6161
/**
62-
* @psalm-import-type FilesSharingShareesSearchResult from ResponseDefinitions
63-
* @psalm-import-type FilesSharingShareesRecommendedResult from ResponseDefinitions
62+
* @psalm-import-type Files_SharingShareesSearchResult from ResponseDefinitions
63+
* @psalm-import-type Files_SharingShareesRecommendedResult from ResponseDefinitions
6464
*/
6565
class ShareesAPIController extends OCSController {
6666

@@ -82,7 +82,7 @@ class ShareesAPIController extends OCSController {
8282
/** @var int */
8383
protected $limit = 10;
8484

85-
/** @var FilesSharingShareesSearchResult */
85+
/** @var Files_SharingShareesSearchResult */
8686
protected $result = [
8787
'exact' => [
8888
'users' => [],
@@ -145,7 +145,7 @@ public function __construct(
145145
* @param int $perPage Limit amount of search results per page
146146
* @param int|int[]|null $shareType Limit to specific share types
147147
* @param bool $lookup If a global lookup should be performed too
148-
* @return DataResponse<Http::STATUS_OK, FilesSharingShareesSearchResult, array{Link?: string}>
148+
* @return DataResponse<Http::STATUS_OK, Files_SharingShareesSearchResult, array{Link?: string}>
149149
* @throws OCSBadRequestException Invalid search parameters
150150
*
151151
* 200: Sharees search result returned
@@ -347,7 +347,7 @@ private function getAllSharees(string $user, array $shareTypes): ISearchResult {
347347
*
348348
* @param string $itemType Limit to specific item types
349349
* @param int|int[]|null $shareType Limit to specific share types
350-
* @return DataResponse<Http::STATUS_OK, FilesSharingShareesRecommendedResult, array{}>
350+
* @return DataResponse<Http::STATUS_OK, Files_SharingShareesRecommendedResult, array{}>
351351
*
352352
* 200: Recommended sharees returned
353353
*/

0 commit comments

Comments
 (0)