From 9ee17e43f624c8e0f06021ebad2e247f2bc083f4 Mon Sep 17 00:00:00 2001 From: Chad Horohoe Date: Tue, 20 Dec 2011 20:15:42 +0000 Subject: [PATCH] Simplify $assoc check --- includes/json/FormatJson.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) 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 { -- 2.20.1