Skip to content

Commit a192508

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 62740bf commit a192508

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

src/Input/TranslateTextRequest.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,7 @@ final class TranslateTextRequest extends Input
8282
* SourceLanguageCode?: string,
8383
* TargetLanguageCode?: string,
8484
* Settings?: TranslationSettings|array,
85-
*
86-
* @region?: string,
85+
* '@region'?: string|null,
8786
* } $input
8887
*/
8988
public function __construct(array $input = [])

src/TranslateClient.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,7 @@ class TranslateClient extends AbstractApi
3636
* SourceLanguageCode: string,
3737
* TargetLanguageCode: string,
3838
* Settings?: TranslationSettings|array,
39-
*
40-
* @region?: string,
39+
* '@region'?: string|null,
4140
* }|TranslateTextRequest $input
4241
*
4342
* @throws InvalidRequestException

0 commit comments

Comments
 (0)