Skip to content

Generate the phpdoc for the static create method of objects #1464

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 24, 2023

Conversation

stof
Copy link
Member

@stof stof commented Jun 23, 2023

No description provided.

@stof stof force-pushed the create_parameter_type branch from d89703b to 2077f0d Compare June 23, 2023 13:59
@stof stof changed the title Generate the phpdoc for the static create method of value objects Generate the phpdoc for the static create method of objects Jun 23, 2023
* SourceIdentity?: string,
* '@region'?: string|null,
* }|AssumeRoleRequest $input
*/
public static function create($input): self
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This method is just a proxy for --construct.
I'm not sure duplicating this docbloc provides any value.

If the user enters invalid content, the STA should report the issue when calling new self($input); right?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No. STA won't report anything because they will think that the method accept mixed. All SA tools are using functions as boundaries for the analysis. They don't rely on the implementation of methods to decide whether callers are using them properly.

Btw, this is one of the main blocker to increase the phpstan level (and probably also to lower the Psalm level or to re-enable the disabled Psalm rules). At level 6, phpstan complains about functions or properties that don't declare their type precisely because of this.

@stof stof requested a review from jderusse June 23, 2023 17:55
@jderusse jderusse merged commit 22c9b08 into async-aws:master Jun 24, 2023
@stof stof deleted the create_parameter_type branch June 24, 2023 20:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants