Homec4science

Add phutil_json_decode(), for convenience

Authored by epriestley <git@epriestley.com> on Feb 27 2014, 23:12.

Description

Add phutil_json_decode(), for convenience

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.

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

Differential Revision: https://secure.phabricator.com/D8363

Details

Committed
epriestley <git@epriestley.com>Feb 27 2014, 23:12
Pushed
aubortMar 17 2017, 12:03
Parents
rPHU48c7a9adfe39: Made the `AphrontWriteGuardExitEventListener` class final.
Branches
Unknown
Tags
Unknown

Event Timeline

epriestley <git@epriestley.com> committed rPHUd79b8c385643: Add phutil_json_decode(), for convenience (authored by epriestley <git@epriestley.com>).Feb 27 2014, 23:12