When using static analysers in PHP, a generic service as a Query Bus is usually a point of pain. In this post, we will see how to type-hint a Query Bus correctly.
#Psalm was all, like, “I found some MissingParamType issues. I’ll be happy to fix the types for you.” So, I ran it with --alter, and it proceeded to change mixed parameter types (that conform to an interface) to stringd.
That’s not my typo; there is a “d” on that end of that type name.
Before I open an issue with #Psalm over this, I’ll ask here because maybe I’m missing something simple.
I have a class that extends another class and overrides a method on the parent. That method is type-hinted as returning static, and this appears to confuse Psalm when implemented in the child.