]> _ Git - cubist_util.git/commitdiff
#2878
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Thu, 11 Jul 2019 12:24:01 +0000 (14:24 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Thu, 11 Jul 2019 12:24:01 +0000 (14:24 +0200)
src/Cubist/Util/Json.php

index bd11aebca3959ceebe09608445a27b1bd89b3474..79d738a1d5dc98a21bab9d795bf94a192a3cb1d7 100644 (file)
@@ -50,14 +50,18 @@ class Json
     public static function decodeRecursive($encodedValue, $objectDecodeType = self::TYPE_OBJECT)
     {
         $v = $encodedValue;
-
         if (is_string($encodedValue)) {
             $v = json_decode($encodedValue);
+
             if (!$v) {
                 return $encodedValue;
             }
         }
 
+        if(is_scalar($v)){
+            return $v;
+        }
+
         $v = ArrayUtil::asArray($v);
 
         array_walk_recursive($v, function (&$v, $k) {