Skip to content

Commit

Permalink
Generate valid phpdoc param tags (#1457)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
stof committed Jun 23, 2023
1 parent 09b2c0f commit 799506e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
3 changes: 1 addition & 2 deletions src/Input/PutTraceSegmentsRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ final class PutTraceSegmentsRequest extends Input
/**
* @param array{
* TraceSegmentDocuments?: string[],
*
* @region?: string,
* '@region'?: string|null,
* } $input
*/
public function __construct(array $input = [])
Expand Down
3 changes: 1 addition & 2 deletions src/XRayClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,7 @@ class XRayClient extends AbstractApi
*
* @param array{
* TraceSegmentDocuments: string[],
*
* @region?: string,
* '@region'?: string|null,
* }|PutTraceSegmentsRequest $input
*
* @throws InvalidRequestException
Expand Down

0 comments on commit 799506e

Please sign in to comment.