Description
Related Objects
- Mentioned Here
- T231636: Butcher the list of phan suppressions in MW core
T168994: Add sniff to check if all returns of a function are void or non-void returns
T222935: HttpRequestFactory get method always return null (was: All local file description pages pointing to Commons do not display description locally from 1.34.0-wmf.4)
Event Timeline
Can't we implement this in MediaWiki-Codesniffer instead? That's faster to run, and the check is fairly simplistic - verify that the method contains T_RETURN or T_YIELD when the accompanying docblock contains @return.
I'd not be against having a rule in CodeSniffer, but this is really something that our static analysis tool should spot regardless. :-)
codesniffer is looking the other way round, so having a return with a value and not @return it would be an issue.
T168994 can improve the situation are also covered by changes to this task.
The phan config contains some disabled issue.
A issue to the return it is only PhanTypeMismatchReturn but that is only for types and I have not tested, if it can find the actual void vs. the type from @return
Change 517740 had a related patch set uploaded (by Umherirrender; owner: Umherirrender):
[mediawiki/core@master] phan: Enable PhanTypeMismatchReturn issue