Page MenuHomePhabricator

Add "assert_same_keys()" to "libphutil/"
ClosedPublic

Authored by epriestley on Mar 11 2019, 4:44 AM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Feb 17, 5:09 PM
Unknown Object (File)
Sun, Feb 16, 1:58 PM
Unknown Object (File)
Feb 13 2025, 2:45 AM
Unknown Object (File)
Feb 7 2025, 3:19 AM
Unknown Object (File)
Feb 2 2025, 10:54 AM
Unknown Object (File)
Jan 27 2025, 5:28 PM
Unknown Object (File)
Jan 27 2025, 1:52 PM
Unknown Object (File)
Jan 25 2025, 4:19 PM
Subscribers
None

Details

Summary

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

Repository
rPHU libphutil
Branch
same1
Lint
Lint Passed
Unit
Tests Passed
Build Status
Buildable 22246
Build 30417: Run Core Tests
Build 30416: arc lint + arc unit

Event Timeline

amckinley added inline comments.
src/utils/utils.php
639

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.