public static function compress(string $value = null, bool $replaceVerticalWhitespace = false)
    {
        if ($value === null) {
            return null;
        }

        $pattern = $replaceVerticalWhitespace ? '\s+' : '\h+';

        return trim(preg_replace("/{$pattern}/", ' ', $value));
    }