coding-standard icon indicating copy to clipboard operation
coding-standard copied to clipboard

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

Open mathroc opened this issue 2 months ago • 0 comments

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

mathroc avatar Nov 07 '25 13:11 mathroc