Page MenuHomePhabricator

Lift class map construction into a new class map query
ClosedPublic

Authored by epriestley on Jun 22 2015, 4:44 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Jul 3, 1:06 AM
Unknown Object (File)
Wed, Jul 2, 6:02 PM
Unknown Object (File)
Wed, Jul 2, 5:48 AM
Unknown Object (File)
Jun 6 2025, 2:11 AM
Unknown Object (File)
Jun 2 2025, 1:25 PM
Unknown Object (File)
Jun 1 2025, 6:49 PM
Unknown Object (File)
May 20 2025, 5:44 PM
Unknown Object (File)
May 19 2025, 9:48 AM
Subscribers

Details

Summary

Ref T8637. The "load concrete subclasses" pattern has enjoyed wide success, but we're starting to collect a lot of instances of "loop over this list of things and make sure they all really have unique keys".

We can better support this, caching, subclass expansion, and sorting in a thin layer on top of PhutilSymbolLoader.

Test Plan

See next diff.

Diff Detail

Repository
rPHU libphutil
Branch
classmap
Lint
Lint Passed
Unit
Tests Passed
Build Status
Buildable 6939
Build 6961: [Placeholder Plan] Wait for 30 Seconds

Event Timeline

epriestley retitled this revision from to Lift class map construction into a new class map query.
epriestley updated this object.
epriestley edited the test plan for this revision. (Show Details)
epriestley added reviewers: btrahan, joshuaspence.
btrahan edited edge metadata.
This revision is now accepted and ready to land.Jun 22 2015, 9:11 PM
joshuaspence edited edge metadata.

This should maybe have some unit tests?

src/symbols/PhutilClassMapQuery.php
4

There's no technical reason that the parent class needs to be abstract, although that is the normal use case.

95–97

Add ```lang=php?

102–108

As above

I think we should definitely get code blocks inside source code documentation defaulting to their source file language per T5323 as a solution for the lang=php thing.

This revision was automatically updated to reflect the committed changes.

I also don't see an easy way to unit test this without building two (three? four?) separate class trees for each major case. I figure failures should be pretty obvious from usage and other getAll() tests.