public static function maybeEncode($value)
    {
        if (is_array($value) || is_object($value)) {
            $value = json_encode($value);
        }

        return $value;
    }
public static function maybeEncode($value)
    {
        if (is_array($value) || is_object($value)) {
            $value = json_encode($value);
        }

        return $value;
    }
public static function maybeEncode ( $ value ) { if ( is_array ( $ value ) || is_object ( $ value ) ) { $ value = json_encode ( $ value ) ; } return $ value ; }
Checks if a value needs to get json encoded

@param $value
@return mixed
Checks if a value needs to get json encoded