original_string: 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');
      }
code: 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');
      }
code_tokens: 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' ) ; }
docstring: Counts characters. Strips HTML tags. Treats multiple spaces as one.
  
  @param string $text
  @param bool   $includeSpaces
  @return int
docstring_tokens: Counts characters . Strips HTML tags . Treats multiple spaces as one .