Skip to content

Commit

Permalink
Generate the phpdoc for the static create method of objects (#1464)
Browse files Browse the repository at this point in the history
  • Loading branch information
stof committed Jun 24, 2023
1 parent 3aa9c1b commit cce301a
Show file tree
Hide file tree
Showing 10 changed files with 71 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/Input/SendEmailRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,21 @@ public function __construct(array $input = [])
parent::__construct($input);
}

/**
* @param array{
* FromEmailAddress?: string,
* FromEmailAddressIdentityArn?: string,
* Destination?: Destination|array,
* ReplyToAddresses?: string[],
* FeedbackForwardingEmailAddress?: string,
* FeedbackForwardingEmailAddressIdentityArn?: string,
* Content?: EmailContent|array,
* EmailTags?: MessageTag[],
* ConfigurationSetName?: string,
* ListManagementOptions?: ListManagementOptions|array,
* '@region'?: string|null,
* }|SendEmailRequest $input
*/
public static function create($input): self
{
return $input instanceof self ? $input : new self($input);
Expand Down
6 changes: 6 additions & 0 deletions src/ValueObject/Body.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@ public function __construct(array $input)
$this->html = isset($input['Html']) ? Content::create($input['Html']) : null;
}

/**
* @param array{
* Text?: null|Content|array,
* Html?: null|Content|array,
* }|Body $input
*/
public static function create($input): self
{
return $input instanceof self ? $input : new self($input);
Expand Down
6 changes: 6 additions & 0 deletions src/ValueObject/Content.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,12 @@ public function __construct(array $input)
$this->charset = $input['Charset'] ?? null;
}

/**
* @param array{
* Data: string,
* Charset?: null|string,
* }|Content $input
*/
public static function create($input): self
{
return $input instanceof self ? $input : new self($input);
Expand Down
7 changes: 7 additions & 0 deletions src/ValueObject/Destination.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,13 @@ public function __construct(array $input)
$this->bccAddresses = $input['BccAddresses'] ?? null;
}

/**
* @param array{
* ToAddresses?: null|string[],
* CcAddresses?: null|string[],
* BccAddresses?: null|string[],
* }|Destination $input
*/
public static function create($input): self
{
return $input instanceof self ? $input : new self($input);
Expand Down
7 changes: 7 additions & 0 deletions src/ValueObject/EmailContent.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,13 @@ public function __construct(array $input)
$this->template = isset($input['Template']) ? Template::create($input['Template']) : null;
}

/**
* @param array{
* Simple?: null|Message|array,
* Raw?: null|RawMessage|array,
* Template?: null|Template|array,
* }|EmailContent $input
*/
public static function create($input): self
{
return $input instanceof self ? $input : new self($input);
Expand Down
6 changes: 6 additions & 0 deletions src/ValueObject/ListManagementOptions.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,12 @@ public function __construct(array $input)
$this->topicName = $input['TopicName'] ?? null;
}

/**
* @param array{
* ContactListName: string,
* TopicName?: null|string,
* }|ListManagementOptions $input
*/
public static function create($input): self
{
return $input instanceof self ? $input : new self($input);
Expand Down
6 changes: 6 additions & 0 deletions src/ValueObject/Message.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,12 @@ public function __construct(array $input)
$this->body = isset($input['Body']) ? Body::create($input['Body']) : null;
}

/**
* @param array{
* Subject: Content|array,
* Body: Body|array,
* }|Message $input
*/
public static function create($input): self
{
return $input instanceof self ? $input : new self($input);
Expand Down
6 changes: 6 additions & 0 deletions src/ValueObject/MessageTag.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,12 @@ public function __construct(array $input)
$this->value = $input['Value'] ?? null;
}

/**
* @param array{
* Name: string,
* Value: string,
* }|MessageTag $input
*/
public static function create($input): self
{
return $input instanceof self ? $input : new self($input);
Expand Down
5 changes: 5 additions & 0 deletions src/ValueObject/RawMessage.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@ public function __construct(array $input)
$this->data = $input['Data'] ?? null;
}

/**
* @param array{
* Data: string,
* }|RawMessage $input
*/
public static function create($input): self
{
return $input instanceof self ? $input : new self($input);
Expand Down
7 changes: 7 additions & 0 deletions src/ValueObject/Template.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,13 @@ public function __construct(array $input)
$this->templateData = $input['TemplateData'] ?? null;
}

/**
* @param array{
* TemplateName?: null|string,
* TemplateArn?: null|string,
* TemplateData?: null|string,
* }|Template $input
*/
public static function create($input): self
{
return $input instanceof self ? $input : new self($input);
Expand Down

0 comments on commit cce301a

Please sign in to comment.