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

PHPStan type-aliases are converted to FQCN #1676

Open
mxr576 opened this issue May 7, 2024 · 3 comments
Open

PHPStan type-aliases are converted to FQCN #1676

mxr576 opened this issue May 7, 2024 · 3 comments

Comments

@mxr576
Copy link

mxr576 commented May 7, 2024

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.

@kukulich
Copy link
Contributor

kukulich commented May 7, 2024

Will you prepare PR please?

@mxr576
Copy link
Author

mxr576 commented May 7, 2024

If the suggested fix is acceptable, gladly! :)

@mxr576
Copy link
Author

mxr576 commented May 8, 2024

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...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants