From 799506e87e8019d09dd530d993ef7878b7fc8dd4 Mon Sep 17 00:00:00 2001 From: Christophe Coevoet Date: Fri, 23 Jun 2023 11:12:59 +0200 Subject: [PATCH] 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 --- src/Input/PutTraceSegmentsRequest.php | 3 +-- src/XRayClient.php | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/Input/PutTraceSegmentsRequest.php b/src/Input/PutTraceSegmentsRequest.php index 0320cc3..76a6e68 100644 --- a/src/Input/PutTraceSegmentsRequest.php +++ b/src/Input/PutTraceSegmentsRequest.php @@ -21,8 +21,7 @@ final class PutTraceSegmentsRequest extends Input /** * @param array{ * TraceSegmentDocuments?: string[], - * - * @region?: string, + * '@region'?: string|null, * } $input */ public function __construct(array $input = []) diff --git a/src/XRayClient.php b/src/XRayClient.php index 6a7cd25..b4d2f86 100644 --- a/src/XRayClient.php +++ b/src/XRayClient.php @@ -55,8 +55,7 @@ class XRayClient extends AbstractApi * * @param array{ * TraceSegmentDocuments: string[], - * - * @region?: string, + * '@region'?: string|null, * }|PutTraceSegmentsRequest $input * * @throws InvalidRequestException