protected function determineType($value)
    {
        if ($value instanceof Expression || $value instanceof ValueGenerator) {
            return self::TYPE_EXPRESSION;
        }

        switch (gettype($value)) {
            case 'boolean':
                return self::TYPE_BOOLEAN;
            case 'integer':
                return self::TYPE_INTEGER;
            case 'string':
                return self::TYPE_STRING;
            case 'double':
            case 'float':
                return self::TYPE_NUMBER;
            case 'array':
                return self::TYPE_ARRAY;
            case 'NULL':
                return self::TYPE_NULL;
            case 'object':
                return self::TYPE_OBJECT;
            default:
                return self::TYPE_OTHER;
        }
    }