Hi.
case self::JSON_ARRAY:
$value = is_string($value) ? json_decode($value) : $value;
if (!is_array($value)) {
$value = null;
}
break;
By default json_decode alway return an Object if the second parameter not special. So in this case I think the code should be:
case self::JSON_ARRAY:
$value = is_string($value) ? json_decode($value, true) : $value;
if (!is_array($value)) {
$value = null;
}
break;
case self::JSON_ARRAY:
$value = is_string($value) ? json_decode($value) : $value;
if (!is_array($value)) {
$value = null;
}
break;
By default json_decode alway return an Object if the second parameter not special. So in this case I think the code should be:
case self::JSON_ARRAY:
$value = is_string($value) ? json_decode($value, true) : $value;
if (!is_array($value)) {
$value = null;
}
break;
Comment