Skip to content
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

Which tag to use when using constructor property promotion #3626

Open
mumbomedia opened this issue Dec 12, 2023 · 0 comments
Open

Which tag to use when using constructor property promotion #3626

mumbomedia opened this issue Dec 12, 2023 · 0 comments

Comments

@mumbomedia
Copy link

Since PHP 8.0 it is possible to use the promotion constructor property.
see https://php.watch/versions/8.0/constructor-property-promotion.

This leads me to consider which tag I should use to document the promoted properties.
@param, because it is a parameter of the constructor method?
But then phpdocumentor will not indicate that it is also a class property
or @var because it is also a class property
Then the parameter part is missing.

or at worst both tags, which would lead to duplicate comments just for the sake of completeness?
You can't be serious.

So if there is no suitable way to document the promotion of constructor properties with just one tag, then I think introducing a separate tag for this would be a benefit for all developers using this new feature. That way the code doesn't have to contain more comments than necessary.

@phpdoc-bot phpdoc-bot added this to Needs triage in phpDoc issue triage board Dec 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
phpDoc issue triage board
  
Needs triage
Development

No branches or pull requests

1 participant