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)
Oct 2 2024, 10:24 AM
Unknown Object (File)
Sep 9 2024, 1:40 AM
Unknown Object (File)
Aug 27 2024, 8:37 PM
Unknown Object (File)
Aug 26 2024, 6:20 PM
Unknown Object (File)
Aug 25 2024, 12:41 PM
Unknown Object (File)
Aug 25 2024, 8:15 AM
Unknown Object (File)
Aug 24 2024, 5:04 PM
Unknown Object (File)
Aug 22 2024, 10:24 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