Skip to content

Commit 8e14400

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 9ac4594 commit 8e14400

8 files changed

+14
-28
lines changed

src/Input/AddLayerVersionPermissionRequest.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,7 @@ final class AddLayerVersionPermissionRequest extends Input
8080
* Principal?: string,
8181
* OrganizationId?: string,
8282
* RevisionId?: string,
83-
*
84-
* @region?: string,
83+
* '@region'?: string|null,
8584
* } $input
8685
*/
8786
public function __construct(array $input = [])

src/Input/DeleteFunctionRequest.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,7 @@ final class DeleteFunctionRequest extends Input
3838
* @param array{
3939
* FunctionName?: string,
4040
* Qualifier?: string,
41-
*
42-
* @region?: string,
41+
* '@region'?: string|null,
4342
* } $input
4443
*/
4544
public function __construct(array $input = [])

src/Input/InvocationRequest.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,7 @@ final class InvocationRequest extends Input
8181
* ClientContext?: string,
8282
* Payload?: string,
8383
* Qualifier?: string,
84-
*
85-
* @region?: string,
84+
* '@region'?: string|null,
8685
* } $input
8786
*/
8887
public function __construct(array $input = [])

src/Input/ListFunctionsRequest.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,7 @@ final class ListFunctionsRequest extends Input
4747
* FunctionVersion?: FunctionVersion::*,
4848
* Marker?: string,
4949
* MaxItems?: int,
50-
*
51-
* @region?: string,
50+
* '@region'?: string|null,
5251
* } $input
5352
*/
5453
public function __construct(array $input = [])

src/Input/ListLayerVersionsRequest.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,7 @@ final class ListLayerVersionsRequest extends Input
6161
* Marker?: string,
6262
* MaxItems?: int,
6363
* CompatibleArchitecture?: Architecture::*,
64-
*
65-
* @region?: string,
64+
* '@region'?: string|null,
6665
* } $input
6766
*/
6867
public function __construct(array $input = [])

src/Input/ListVersionsByFunctionRequest.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,7 @@ final class ListVersionsByFunctionRequest extends Input
4747
* FunctionName?: string,
4848
* Marker?: string,
4949
* MaxItems?: int,
50-
*
51-
* @region?: string,
50+
* '@region'?: string|null,
5251
* } $input
5352
*/
5453
public function __construct(array $input = [])

src/Input/PublishLayerVersionRequest.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,7 @@ final class PublishLayerVersionRequest extends Input
7979
* CompatibleRuntimes?: list<Runtime::*>,
8080
* LicenseInfo?: string,
8181
* CompatibleArchitectures?: list<Architecture::*>,
82-
*
83-
* @region?: string,
82+
* '@region'?: string|null,
8483
* } $input
8584
*/
8685
public function __construct(array $input = [])

src/LambdaClient.php

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,7 @@ class LambdaClient extends AbstractApi
8484
* Principal: string,
8585
* OrganizationId?: string,
8686
* RevisionId?: string,
87-
*
88-
* @region?: string,
87+
* '@region'?: string|null,
8988
* }|AddLayerVersionPermissionRequest $input
9089
*
9190
* @throws ServiceException
@@ -126,8 +125,7 @@ public function addLayerVersionPermission($input): AddLayerVersionPermissionResp
126125
* @param array{
127126
* FunctionName: string,
128127
* Qualifier?: string,
129-
*
130-
* @region?: string,
128+
* '@region'?: string|null,
131129
* }|DeleteFunctionRequest $input
132130
*
133131
* @throws ServiceException
@@ -200,8 +198,7 @@ public function deleteFunction($input): Result
200198
* ClientContext?: string,
201199
* Payload?: string,
202200
* Qualifier?: string,
203-
*
204-
* @region?: string,
201+
* '@region'?: string|null,
205202
* }|InvocationRequest $input
206203
*
207204
* @throws ServiceException
@@ -293,8 +290,7 @@ public function invoke($input): InvocationResponse
293290
* FunctionVersion?: FunctionVersion::*,
294291
* Marker?: string,
295292
* MaxItems?: int,
296-
*
297-
* @region?: string,
293+
* '@region'?: string|null,
298294
* }|ListFunctionsRequest $input
299295
*
300296
* @throws ServiceException
@@ -330,8 +326,7 @@ public function listFunctions($input = []): ListFunctionsResponse
330326
* Marker?: string,
331327
* MaxItems?: int,
332328
* CompatibleArchitecture?: Architecture::*,
333-
*
334-
* @region?: string,
329+
* '@region'?: string|null,
335330
* }|ListLayerVersionsRequest $input
336331
*
337332
* @throws ServiceException
@@ -365,8 +360,7 @@ public function listLayerVersions($input): ListLayerVersionsResponse
365360
* FunctionName: string,
366361
* Marker?: string,
367362
* MaxItems?: int,
368-
*
369-
* @region?: string,
363+
* '@region'?: string|null,
370364
* }|ListVersionsByFunctionRequest $input
371365
*
372366
* @throws ServiceException
@@ -405,8 +399,7 @@ public function listVersionsByFunction($input): ListVersionsByFunctionResponse
405399
* CompatibleRuntimes?: list<Runtime::*>,
406400
* LicenseInfo?: string,
407401
* CompatibleArchitectures?: list<Architecture::*>,
408-
*
409-
* @region?: string,
402+
* '@region'?: string|null,
410403
* }|PublishLayerVersionRequest $input
411404
*
412405
* @throws ServiceException

0 commit comments

Comments
 (0)