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)
Fri, Dec 27, 5:06 AM
Unknown Object (File)
Thu, Dec 19, 5:45 AM
Unknown Object (File)
Sun, Dec 8, 3:27 PM
Unknown Object (File)
Sun, Dec 8, 9:28 AM
Unknown Object (File)
Dec 5 2024, 10:13 PM
Unknown Object (File)
Dec 4 2024, 7:46 PM
Unknown Object (File)
Nov 30 2024, 7:02 AM
Unknown Object (File)
Nov 27 2024, 12:21 AM
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