Fixed Add throws hinting to AbstractAdapter::query

Xon

Well-known member
Affected version
2.0
Recent phpstorm updates adds exception tracing to hint if a method throws an exception. This has issues across interface boundaries which aren't type hinted resulting in false positives on invalid catch statements. This will flag most uses of DuplicateKeyException
 
I *think* the @throws need to be applied to Statement->execute() actually - as that's where PHPstorm seems to want to place it, but feel free to tell me I'm wrong :)
 
Yeah, Statement->execute() should work. I think the default exception tracing will go deep enough for that.

Should then hint that Statement->prepare() can also throw stuff too.
 
Yeah, Statement->execute() should work. I think the default exception tracing will go deep enough for that.

Should then hint that Statement->prepare() can also throw stuff too.
Yep, I've done that too :)
 
Maybe it would be worth going through the entire project with phpStorm's Code Inspector and allow it to generate phpDoc for all methods? It should be a one-click solution once it's done scanning, and would take care of all of this :)


Fillip
 
Top Bottom