Page MenuHomePhabricator

Formalize getQueryInfo() usage
Open, LowPublic

Description

phan-taint-check-plugin assumes that methods named getQueryInfo() are returning an array with tables/fields/conds/etc. We should formalize that definition somehow. I'm not exactly sure what formalizing this would mean, could be an interface or just documenting in [[mw:CC]] that methods named this should have that kind of return value. Or maybe returning a typed object instead of an array (implementing ArrayAccess for b/c)?

Event Timeline

Note that not all getQueryInfo() methods are named that: Revision and RevisionStore have getArchiveQueryInfo(), and RevisionStore also has getSlotsQueryInfo().

Also QueryPage has a getQueryInfo() method that uses a slightly different structure for the return array from the getQueryInfo() present in other classes: "join_conds" rather than "joins" and some extra fields not present in the rest.

Hmm, thanks. An interface won't work then, so I think returning a typed object would work.

Change 459242 had a related patch set uploaded (by Legoktm; owner: Legoktm):
[mediawiki/core@master] [WIP] Introduce QueryInfo

https://gerrit.wikimedia.org/r/459242

WDoranWMF subscribed.

CPT would recommend that this is part of a broader discussion that could be done via an RfC. For now we're going to put it in the Icebox.

Change 459242 abandoned by Legoktm:
[WIP] Introduce QueryInfo

https://gerrit.wikimedia.org/r/459242