-
-
Notifications
You must be signed in to change notification settings - Fork 686
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
False positive of RemoveUselessVarTagRector #8870
False positive of RemoveUselessVarTagRector #8870
Comments
That's expected even child implementor, using
see: https://phpstan.org/r/abf330cf-4372-49ac-ba92-51ffa77d0c3a so possibly a phpstan bug on invalid detecting it :) I suggest to change to just direct property definition, if child is used, see |
@samsonasik Here is another example https://getrector.com/demo/00f806a6-3347-4011-aa9d-6ac589f56d21 |
You define |
From a native perspective, you are right, they are the same. But it's not about native types. In the case of a Does Rector only look at the types only from a native perspective ? |
You can use direct child implementor of native type as docblock if you don't want it to be removed, see https://getrector.com/demo/59fb3ce1-5118-44e2-a52f-2b3bdcaf66e1 |
I need to keep the property in the base abstract class. I've made the 2 versions for PHPStan: I do not consider this a PHPStan bug. I also made it in Psalm: |
Ok, reopen then. |
Bug Report
Minimal PHP Code Causing Issue
See https://getrector.com/demo/c779dd90-39ba-4cf1-8222-984a30d19816
Responsible rules
RemoveUselessVarTagRector
Expected Behavior
Tag should not be removed
The text was updated successfully, but these errors were encountered: