Page MenuHomePhabricator

Add phutil_json_decode(), for convenience
ClosedPublic

Authored by epriestley on Feb 27 2014, 8:30 PM.
Tags
None
Referenced Files
F13164934: D8363.diff
Tue, May 7, 4:59 AM
Unknown Object (File)
Fri, May 3, 2:24 AM
Unknown Object (File)
Mon, Apr 29, 1:47 PM
Unknown Object (File)
Sun, Apr 28, 5:27 AM
Unknown Object (File)
Sun, Apr 28, 4:23 AM
Unknown Object (File)
Wed, Apr 24, 9:50 PM
Unknown Object (File)
Sun, Apr 21, 1:45 PM
Unknown Object (File)
Wed, Apr 17, 2:56 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