public static function validate($value)
    {
        if (is_string($value) || is_int($value) || is_float($value) || is_bool($value) || null === $value) {
            // type is allowed
            return;
        }

        if (is_array($value)) {
            // must check all elements contained
            foreach ($value as $subValue) {
                self::validate($subValue);
            }

            return;
        }

        // type is invalid
        throw new ClientException('Invalid bind parameter value');
    }