FluentDOM\Query\Data::decodeValue PHP Method

decodeValue() private method

Decode the attribute value into a php variable/array/object
private decodeValue ( string $value ) : mixed
$value string
return mixed
    private function decodeValue($value)
    {
        switch (TRUE) {
            case $value === 'true':
                return TRUE;
            case $value === 'false':
                return FALSE;
            case in_array(substr($value, 0, 1), array('{', '[')):
                if ($json = json_decode($value)) {
                    return $json;
                } else {
                    return NULL;
                }
            default:
                return $value;
        }
    }