Skip to content

Proposal for Sniff: Choosing between @var and @param for promoted properties #1809

@mathroc

Description

@mathroc

Hi!

Currently one can use either @var T or @param T $… to annotate the type of a promoted property (or both!)

For consistency sake, I think a sniff that checks that only one of those is used would be welcome.

Sniff settings suggestion:

  • allowedAnnotation: "either" | "var" | "param"
    • "either" means one or the other but not both
    • "var" means only @var T is allowed
    • "param" means only `@param T $…" is allowed
    • "both" is not an option, the sniff should be disabled instead

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions