Skip to content

Commit badd1ec

Browse files
authored
Generate the phpdoc for the static create method of objects (#1464)
1 parent a192508 commit badd1ec

File tree

4 files changed

+28
-0
lines changed

4 files changed

+28
-0
lines changed

src/Input/TranslateTextRequest.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,16 @@ public function __construct(array $input = [])
9595
parent::__construct($input);
9696
}
9797

98+
/**
99+
* @param array{
100+
* Text?: string,
101+
* TerminologyNames?: string[],
102+
* SourceLanguageCode?: string,
103+
* TargetLanguageCode?: string,
104+
* Settings?: TranslationSettings|array,
105+
* '@region'?: string|null,
106+
* }|TranslateTextRequest $input
107+
*/
98108
public static function create($input): self
99109
{
100110
return $input instanceof self ? $input : new self($input);

src/ValueObject/AppliedTerminology.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,12 @@ public function __construct(array $input)
3333
$this->terms = isset($input['Terms']) ? array_map([Term::class, 'create'], $input['Terms']) : null;
3434
}
3535

36+
/**
37+
* @param array{
38+
* Name?: null|string,
39+
* Terms?: null|Term[],
40+
* }|AppliedTerminology $input
41+
*/
3642
public static function create($input): self
3743
{
3844
return $input instanceof self ? $input : new self($input);

src/ValueObject/Term.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,12 @@ public function __construct(array $input)
2929
$this->targetText = $input['TargetText'] ?? null;
3030
}
3131

32+
/**
33+
* @param array{
34+
* SourceText?: null|string,
35+
* TargetText?: null|string,
36+
* }|Term $input
37+
*/
3238
public static function create($input): self
3339
{
3440
return $input instanceof self ? $input : new self($input);

src/ValueObject/TranslationSettings.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,12 @@ public function __construct(array $input)
5959
$this->profanity = $input['Profanity'] ?? null;
6060
}
6161

62+
/**
63+
* @param array{
64+
* Formality?: null|Formality::*,
65+
* Profanity?: null|Profanity::*,
66+
* }|TranslationSettings $input
67+
*/
6268
public static function create($input): self
6369
{
6470
return $input instanceof self ? $input : new self($input);

0 commit comments

Comments
 (0)