From: Chad Horohoe Date: Tue, 20 Dec 2011 20:15:42 +0000 (+0000) Subject: Simplify $assoc check X-Git-Tag: 1.31.0-rc.0~25859 X-Git-Url: http://git.cyclocoop.org/data/%24self?a=commitdiff_plain;h=9ee17e43f624c8e0f06021ebad2e247f2bc083f4;p=lhc%2Fweb%2Fwiklou.git Simplify $assoc check --- diff --git a/includes/json/FormatJson.php b/includes/json/FormatJson.php index 0f5f7d53c6..f7373e450a 100644 --- a/includes/json/FormatJson.php +++ b/includes/json/FormatJson.php @@ -54,10 +54,8 @@ class FormatJson { */ public static function decode( $value, $assoc = false ) { if ( !function_exists( 'json_decode' ) ) { - if( $assoc ) - $json = new Services_JSON( SERVICES_JSON_LOOSE_TYPE ); - else - $json = new Services_JSON(); + $json = $assoc ? new Services_JSON( SERVICES_JSON_LOOSE_TYPE ) : + new Services_JSON(); $jsonDec = $json->decode( $value ); return $jsonDec; } else {