public static function count(string $text = '', bool $includeSpaces = false): int
    {
        if (\trim($text) === '') {
            return 0;
        }
        $text = StripTags::strip($text);
        $text = \htmlspecialchars_decode((string)$text, ENT_COMPAT | ENT_HTML5);
        $text = \preg_replace('/\s+/', $includeSpaces ? ' ' : '', $text);
        $text = \trim($text);

        return \mb_strlen($text, 'UTF-8');
    }