Adding class templates to PhabricatorPolicyAwareQuery and
PhabricatorCursorPagedPolicyAwareQuery to make execute() have the right
return signature, when the query classes are also annotated. Otherwise, the
return type is inferred as PhabricatorPolicyInterface as before.
Details
Details
- Reviewers
- None
- Group Reviewers
O1: Blessed Committers
Add some annotations to query classes and see that $query->execute() infers
the more specific return type.
Diff Detail
Diff Detail
- Repository
- rP Phorge
- Branch
- query_templates (branched from master)
- Lint
Lint Passed - Unit
Tests Passed - Build Status
Buildable 2026 Build 2026: arc lint + arc unit
Event Timeline
Comment Actions
Hmm.. clearly I need to set xdebug.mode correctly, but I'm not sure why it wasn't. It's been fine before.
Comment Actions
Yes to the idea however a related elephant in the room (IMHO) are those non-standard types like list or map or wild being replaced, no clue if that has any effects on...something™ (Diviner docs? Code?) as I haven't managed to understand the consequences of code in https://we.phorge.it/source/arcanist/browse/master/src/parser/PhutilTypeSpec.php yet. (Technically speaking map and list seem to be just arrays, indeed.)