psalm: The phpdoc is not inherited anymore when we're adding phpdoc for one param.

https://psalm.dev/r/8b358668a7

Here, I would expect to inherit the @param int|string $id annotation.

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 18 (5 by maintainers)

Most upvoted comments

The main point of contention here (for me at least) is that it becomes unclear what tags apply and where they come from. I’d almost want to require @override or something (which could also have additional semantics like Phan) to make it clear that there may be annotations coming from the parent.

IDEs also help a lot with that, maybe we could improve our language server to provide better info when overriding methods as well? It’d be nice to see what method is being overridden when you hover on the declaration. Even better would be to show Psalm’s type for a parameter when hovering on it, you could have several ancestors before you actually get to the @param tag for a particular parameter.