@phpstan-type annotation makes PHPStorm go crazy

Hello,

I've been trying to use custom reusable types for autocomplete using the @phpstan-type annotation.

I noticed PHPStorm exhibiting multiple abnormal behaviors when doing so, notably:
- When trying to use those types I defined it will say the class with that name does not exists
- It will start giving “expression result not used anywhere” warnings when it makes no sense, for example when concataining strings it underline part of the express
- It will keep warning about problems that have been fixed, for example saying that there's a typo in a variable name while the variable has been renamed.

For it to work properly again, I have to invalidate cache and restart. Restarting alone does not help.

Has anyone experience something similar?

My work environment is Windows 11 with files hosted on a WSL instance.

0

请先登录再写评论。