Skip to content

Which tag to use when using constructor property promotion #3626

Description

@mumbomedia

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions