Skip to content

Commit 52ebcd1

Browse files
authored
Generate valid phpdoc param tags (#1457)
* Fix the phpdoc of the RequestContext * Generate valid phpdoc param tags When an array shape key starts with a `@` like `@region`, it must be quoted in the phpdoc as the unquoted one would be interpreted as the next phpdoc tag. * Use an unsealed shape for the type in Input This avoids reports about passing extra keys from child classes in Psalm. * Allow passing null as the region in the input The base input class already accept null values in addition to omitted values for the region. * Update the psalm baseline * Disallow invalid docblocks in Psalm as well
1 parent 1b4f29f commit 52ebcd1

9 files changed

+16
-32
lines changed

src/CodeCommitClient.php

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,7 @@ class CodeCommitClient extends AbstractApi
8686
* repositoryName: string,
8787
* repositoryDescription?: string,
8888
* tags?: array<string, string>,
89-
*
90-
* @region?: string,
89+
* '@region'?: string|null,
9190
* }|CreateRepositoryInput $input
9291
*
9392
* @throws RepositoryNameExistsException
@@ -139,8 +138,7 @@ public function createRepository($input): CreateRepositoryOutput
139138
*
140139
* @param array{
141140
* repositoryName: string,
142-
*
143-
* @region?: string,
141+
* '@region'?: string|null,
144142
* }|DeleteRepositoryInput $input
145143
*
146144
* @throws RepositoryNameRequiredException
@@ -176,8 +174,7 @@ public function deleteRepository($input): DeleteRepositoryOutput
176174
* @param array{
177175
* repositoryName: string,
178176
* blobId: string,
179-
*
180-
* @region?: string,
177+
* '@region'?: string|null,
181178
* }|GetBlobInput $input
182179
*
183180
* @throws RepositoryNameRequiredException
@@ -223,8 +220,7 @@ public function getBlob($input): GetBlobOutput
223220
* @param array{
224221
* repositoryName?: string,
225222
* branchName?: string,
226-
*
227-
* @region?: string,
223+
* '@region'?: string|null,
228224
* }|GetBranchInput $input
229225
*
230226
* @throws RepositoryNameRequiredException
@@ -268,8 +264,7 @@ public function getBranch($input = []): GetBranchOutput
268264
* @param array{
269265
* repositoryName: string,
270266
* commitId: string,
271-
*
272-
* @region?: string,
267+
* '@region'?: string|null,
273268
* }|GetCommitInput $input
274269
*
275270
* @throws RepositoryNameRequiredException
@@ -319,8 +314,7 @@ public function getCommit($input): GetCommitOutput
319314
* afterPath?: string,
320315
* MaxResults?: int,
321316
* NextToken?: string,
322-
*
323-
* @region?: string,
317+
* '@region'?: string|null,
324318
* }|GetDifferencesInput $input
325319
*
326320
* @throws RepositoryNameRequiredException
@@ -375,8 +369,7 @@ public function getDifferences($input): GetDifferencesOutput
375369
* nextToken?: string,
376370
* sortBy?: SortByEnum::*,
377371
* order?: OrderEnum::*,
378-
*
379-
* @region?: string,
372+
* '@region'?: string|null,
380373
* }|ListRepositoriesInput $input
381374
*
382375
* @throws InvalidSortByException
@@ -404,8 +397,7 @@ public function listRepositories($input = []): ListRepositoriesOutput
404397
* @param array{
405398
* repositoryName: string,
406399
* triggers: RepositoryTrigger[],
407-
*
408-
* @region?: string,
400+
* '@region'?: string|null,
409401
* }|PutRepositoryTriggersInput $input
410402
*
411403
* @throws RepositoryDoesNotExistException

src/Input/CreateRepositoryInput.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,7 @@ final class CreateRepositoryInput extends Input
5151
* repositoryName?: string,
5252
* repositoryDescription?: string,
5353
* tags?: array<string, string>,
54-
*
55-
* @region?: string,
54+
* '@region'?: string|null,
5655
* } $input
5756
*/
5857
public function __construct(array $input = [])

src/Input/DeleteRepositoryInput.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,7 @@ final class DeleteRepositoryInput extends Input
2424
/**
2525
* @param array{
2626
* repositoryName?: string,
27-
*
28-
* @region?: string,
27+
* '@region'?: string|null,
2928
* } $input
3029
*/
3130
public function __construct(array $input = [])

src/Input/GetBlobInput.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,7 @@ final class GetBlobInput extends Input
3434
* @param array{
3535
* repositoryName?: string,
3636
* blobId?: string,
37-
*
38-
* @region?: string,
37+
* '@region'?: string|null,
3938
* } $input
4039
*/
4140
public function __construct(array $input = [])

src/Input/GetBranchInput.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,7 @@ final class GetBranchInput extends Input
2929
* @param array{
3030
* repositoryName?: string,
3131
* branchName?: string,
32-
*
33-
* @region?: string,
32+
* '@region'?: string|null,
3433
* } $input
3534
*/
3635
public function __construct(array $input = [])

src/Input/GetCommitInput.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,7 @@ final class GetCommitInput extends Input
3434
* @param array{
3535
* repositoryName?: string,
3636
* commitId?: string,
37-
*
38-
* @region?: string,
37+
* '@region'?: string|null,
3938
* } $input
4039
*/
4140
public function __construct(array $input = [])

src/Input/GetDifferencesInput.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,7 @@ final class GetDifferencesInput extends Input
7676
* afterPath?: string,
7777
* MaxResults?: int,
7878
* NextToken?: string,
79-
*
80-
* @region?: string,
79+
* '@region'?: string|null,
8180
* } $input
8281
*/
8382
public function __construct(array $input = [])

src/Input/ListRepositoriesInput.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,7 @@ final class ListRepositoriesInput extends Input
4242
* nextToken?: string,
4343
* sortBy?: SortByEnum::*,
4444
* order?: OrderEnum::*,
45-
*
46-
* @region?: string,
45+
* '@region'?: string|null,
4746
* } $input
4847
*/
4948
public function __construct(array $input = [])

src/Input/PutRepositoryTriggersInput.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,7 @@ final class PutRepositoryTriggersInput extends Input
3535
* @param array{
3636
* repositoryName?: string,
3737
* triggers?: RepositoryTrigger[],
38-
*
39-
* @region?: string,
38+
* '@region'?: string|null,
4039
* } $input
4140
*/
4241
public function __construct(array $input = [])

0 commit comments

Comments
 (0)