Page MenuHomePhabricator

Add "assert_same_keys()" to "libphutil/"

Authored by epriestley on Mar 11 2019, 4:44 AM.



This makes an implementation a little cleaner in an upcoming workboards diff.

This is like array_keys($x) === array_keys($y), but we get a slightly more useful error message, and we don't care about order.

Test Plan

Added and ran unit tests.

Diff Detail

rPHU libphutil
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

epriestley created this revision.Mar 11 2019, 4:44 AM
epriestley requested review of this revision.Mar 11 2019, 4:45 AM
amckinley accepted this revision.Mar 12 2019, 7:21 PM
amckinley added inline comments.

At some point, you just gotta throw in the towel and patch PHP to have list() and dictionary() to get some sanity back.

This revision is now accepted and ready to land.Mar 12 2019, 7:21 PM
This revision was automatically updated to reflect the committed changes.