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

PHPStan type-aliases are converted to FQCN

Open mxr576 opened this issue 1 year ago • 3 comments

When you use type aliases by PHPStan, even if you use a @phpstan- prefixed annotation, like @phpstan-param, the SlevomatCodingStandard.Namespaces.FullyQualifiedClassNameInAnnotation rule auto-corrects it to a FQCN and with that ruins it.

Suggested solution: Add @phpstan-param,@phpstan-return,@phpstan-var (any other?) to the ignoredAnnotationNames as sane defaults.

mxr576 avatar May 07 '24 14:05 mxr576

Will you prepare PR please?

kukulich avatar May 07 '24 14:05 kukulich

If the suggested fix is acceptable, gladly! :)

mxr576 avatar May 07 '24 15:05 mxr576

Although, it came to my mind that is there a realistic scenario where @phpstan-param is used to specify a class/interface reference instead of @param? Is these a scenario where somebody would like to override what is in @param like this and that is also a class/interface reference? I hope not...

mxr576 avatar May 08 '24 06:05 mxr576