HomePhabricator

Add phutil_json_decode(), for convenience

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

Provenance
epriestleyAuthored on
epriestleyPushed on Feb 27 2014, 10:12 PM
Reviewer
btrahan
Differential Revision
D8363: Add phutil_json_decode(), for convenience
Parents
rPHU48c7a9adfe39: Made the `AphrontWriteGuardExitEventListener` class final.
Branches
Unknown
Tags
Unknown

Event Timeline