File: src/voku/helper/UTF8.php

Recommend this page to a friend!
  Classes of Lars Moelleken  >  Portable UTF-8  >  src/voku/helper/UTF8.php  
File: src/voku/helper/UTF8.php
Role: Class source
Content type: text/plain
Description: Class source
Class: Portable UTF-8
Manipulate UTF-8 text strings in pure PHP
Author: By
Last change: [+]: fix tests for PHP 7.0 + fix typos
[+]: enable nearly all phpstorm inspections

- do not use "=== false" | "=== true" for "bool" types
- "GRAPHEME_CLUSTER_RX" -> is not used anymore and is now deprecated
- fix "UTF8::decode_mimeheader" fallback -> now we always use the symfony polyfill (mb_decode_mimeheader has different results) + tests
- fix "UTF8::get_unique_string()" -> use "mt_rand" as fallback
- fix "UTF8::strtr()" -> now it works also with arrays + tests
- fix phpdoc for "UTF8::normalize_line_ending()"
- fix phpdoc for "UTF8::split()" & "UTF8::str_split()"
- add "UTF8::str_split_array()"
- add "UTF8::stripos_in_byte()"
- use more type checks for parameters
- optimize "UTF8::filter()"
- optimize "UTF8::is_url()" + fix deprecated php (>= 7.3) constants
- optimize "UTF8::str_limit_after_word()"
- optimize "UTF8::substr()"
- optimize "UTF8::str_capitalize_name_helper()" -> performance -> use break
- add many new tests
Merge remote-tracking branch 'origin/master'

* origin/master:
Update .styleci.yml
[+]: fix nesting function error from "UTF8::substr()"
[+]: add "is_punctuation()" && "is_printable()"
[+]: add "to_int()" && "to_string()" v2
[+]: add "to_int()" && "to_string()"
[*]: use "@psalm-pure"
[*]: code-style changes only

thanks to phpstorm :)
[*]: use "@psalm-immutable"
[+]: fix for "str_contains_all()"
[*]: try to ignore phpstan false-positive errors v2
[+]: "str_contains_all" -> fix the loop

-> thanks @ phpstan (v0.12) :)
[+]: add "has_whitespace"

-> https://github.com/voku/Stringy/issues/23
[*]: auto fix the code-style v2
[*]: auto fix the code-style
[+]: fix errors reported by phpstan
[+]: "UTF8::string()" -> optimize performance

-> fix use "mb_str_split" with PHP >= 7.4
-> fix / ignore errors reported by psalm
[+]: use "mb_str_split" with PHP >= 7.4

-> performance++
Merge branch 'master' of ssh://github.com/voku/portable-utf8

* 'master' of ssh://github.com/voku/portable-utf8:
Apply fixes from StyleCI
Update SECURITY.md
Create SECURITY.md
Date: 8 months ago
Size: 449,233 bytes

You need to be a registered user and login to get this file.

1,566,066 PHP developers registered to the PHP Classes site.
Be One of Us!

Login Immediately with your account on:

FacebookGmailHotmailStackOverflowGitHubYahoo

For more information send a message to info at phpclasses dot org.