Page MenuHomePhabricator

Add phutil_json_decode(), for convenience
ClosedPublic

Authored by epriestley on Feb 27 2014, 8:30 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Nov 30, 7:02 AM
Unknown Object (File)
Wed, Nov 27, 12:21 AM
Unknown Object (File)
Wed, Nov 27, 12:21 AM
Unknown Object (File)
Thu, Nov 21, 12:48 AM
Unknown Object (File)
Fri, Nov 15, 5:02 PM
Unknown Object (File)
Tue, Nov 12, 7:52 AM
Unknown Object (File)
Tue, Nov 12, 6:24 AM
Unknown Object (File)
Mon, Nov 11, 1:48 PM
Subscribers

Details

Summary

This is just a convenience method for decoding possibly-sketchy strings. We have a lot of cases where we may try to decode some uninitialized value (like null) and then check if we got something sensible out or not.

Particularly, almost all of these can likely be simplified:

$ git grep -A1 -i 'json_decode' . | grep is_array | wc -l
33
Test Plan

Added and executed unit tests.

Diff Detail

Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

btrahan edited edge metadata.
This revision is now accepted and ready to land.Feb 27 2014, 10:08 PM