From: Chad Horohoe Date: Wed, 11 Aug 2010 12:42:40 +0000 (+0000) Subject: Boolean parameters suck, but we can make them suck less by adding constants you can... X-Git-Tag: 1.31.0-rc.0~35552 X-Git-Url: https://git.cyclocoop.org/%28%28?a=commitdiff_plain;h=fe72845c8284804f3df2546017a9426b94e537cd;p=lhc%2Fweb%2Fwiklou.git Boolean parameters suck, but we can make them suck less by adding constants you can use. Also doc, spacing, etc --- diff --git a/includes/json/FormatJson.php b/includes/json/FormatJson.php index cacf6680fc..f33bc6235b 100644 --- a/includes/json/FormatJson.php +++ b/includes/json/FormatJson.php @@ -1,12 +1,24 @@ + */ public static function encode( $value, $isHtml = false ) { // Some versions of PHP have a broken json_encode, see PHP bug // 46944. Test encoding an affected character (U+20000) to @@ -19,6 +31,12 @@ class FormatJson { } } + /** + * Decode some JSON into an array or object + * @param $value String of Json + * @param $assoc bool One of AS_OBJECT or AS_ARRAY to specify return type + * @return Array or Object + */ public static function decode( $value, $assoc = false ) { if ( !function_exists( 'json_decode' ) ) { $json = new Services_JSON();