Code Duplication    Length = 13-13 lines in 2 locations

core/functions/helper.php 1 location

@@ 140-152 (lines=13) @@
137
    }
138
}
139
140
if (! function_exists('data_is_json')) {
141
    /**
142
     * @param $string
143
     * @param bool $returnData
144
     * @return bool|mixed
145
     */
146
    function data_is_json($string, $returnData = false)
147
    {
148
        $data = is_scalar($string) ? json_decode($string, true) : false;
149
150
        return (json_last_error() == JSON_ERROR_NONE) ? ($returnData ? $data : true) : false;
151
    }
152
}
153
154
if (! function_exists('is_ajax')) {
155
    /**

install/src/functions.php 1 location

@@ 668-680 (lines=13) @@
665
    }
666
}
667
668
if (!function_exists('isJson')) {
669
    /**
670
     * @param string $string
671
     * @param bool $returnData
672
     * @return bool|mixed
673
     */
674
    function isJson($string, $returnData = false)
675
    {
676
        $data = json_decode($string, true);
677
678
        return (json_last_error() == JSON_ERROR_NONE) ? ($returnData ? $data : true) : false;
679
    }
680
}
681
682
if (!function_exists('getCreateDbCategory')) {
683
    /**