Completed
Push — master ( b28874...276160 )
by Colin
01:36
created

JsonException

Complexity

Total Complexity 0

Size/Duplication

Total Lines 1
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 0
lcom 0
cbo 0
dl 0
loc 1
ccs 0
cts 0
cp 0
c 0
b 0
f 0
1
<?php
2
3
if (!function_exists('json5_decode')) {
4
    /**
5
     * Takes a JSON encoded string and converts it into a PHP variable.
6
     *
7
     * The parameters exactly match PHP's json_decode() function - see
8
     * http://php.net/manual/en/function.json-decode.php for more information.
9
     *
10
     * @param string $source      The JSON string being decoded.
11
     * @param bool   $associative When TRUE, returned objects will be converted into associative arrays.
12
     * @param int    $depth       User specified recursion depth.
13
     * @param int    $options     Bitmask of JSON decode options.
14
     *
15
     * @return mixed
16
     */
17
    function json5_decode($source, $associative = false, $depth = 512, $options = 0)
18
    {
19 9
        return \ColinODell\Json5\Json5Decoder::decode($source, $associative, $depth, $options);
20
    }
21
}
22
23
// PHP 7.3 polyfills
24
if (!defined('JSON_THROW_ON_ERROR')) {
25
    define('JSON_THROW_ON_ERROR', 1 << 22);
26
}
27
28
if (!class_exists('JsonException')) {
29
    class JsonException extends Exception {}
30
}
31