@@ -236,12 +236,20 @@ discard block |
||
| 236 | 236 | return str_replace($BROKEN_UTF8_TO_UTF8_KEYS_CACHE, $BROKEN_UTF8_TO_UTF8_VALUES_CACHE, $str); |
| 237 | 237 | } |
| 238 | 238 | |
| 239 | + /** |
|
| 240 | + * @param string $file |
|
| 241 | + */ |
|
| 239 | 242 | private function getData($file) |
| 240 | 243 | { |
| 241 | 244 | |
| 242 | 245 | return include __DIR__ . '/../Data/' . $file . '.php'; |
| 243 | 246 | } |
| 244 | 247 | |
| 248 | + /** |
|
| 249 | + * @param integer $flags |
|
| 250 | + * |
|
| 251 | + * @return string |
|
| 252 | + */ |
|
| 245 | 253 | private function htmlEntityDecode($str, $flags = null, $encoding = 'UTF-8') |
| 246 | 254 | { |
| 247 | 255 | if ( |
@@ -547,6 +555,9 @@ discard block |
||
| 547 | 555 | return $buf; |
| 548 | 556 | } |
| 549 | 557 | |
| 558 | + /** |
|
| 559 | + * @param string $input |
|
| 560 | + */ |
|
| 550 | 561 | private function toUtf8ConvertHelper($input) |
| 551 | 562 | { |
| 552 | 563 | // init |
@@ -576,6 +587,9 @@ discard block |
||
| 576 | 587 | return $buf; |
| 577 | 588 | } |
| 578 | 589 | |
| 590 | + /** |
|
| 591 | + * @param integer $code_point |
|
| 592 | + */ |
|
| 579 | 593 | private function chr($code_point, $encoding = 'UTF-8') |
| 580 | 594 | { |
| 581 | 595 | // init |
@@ -671,6 +685,9 @@ discard block |
||
| 671 | 685 | return $CHAR_CACHE[$cacheKey] = $chr; |
| 672 | 686 | } |
| 673 | 687 | |
| 688 | + /** |
|
| 689 | + * @return string |
|
| 690 | + */ |
|
| 674 | 691 | private function encode($toEncoding, $str) |
| 675 | 692 | { |
| 676 | 693 | if ($str === '' || $toEncoding === '') { |
@@ -838,6 +855,9 @@ discard block |
||
| 838 | 855 | return $var; |
| 839 | 856 | } |
| 840 | 857 | |
| 858 | + /** |
|
| 859 | + * @param string $str |
|
| 860 | + */ |
|
| 841 | 861 | private function normalizeLineEnding($str) |
| 842 | 862 | { |
| 843 | 863 | return str_replace(["\r\n", "\r"], "\n", $str); |
@@ -894,6 +914,9 @@ discard block |
||
| 894 | 914 | ); |
| 895 | 915 | } |
| 896 | 916 | |
| 917 | + /** |
|
| 918 | + * @param string $char |
|
| 919 | + */ |
|
| 897 | 920 | private function singleChrHtmlEncode($char, $keepAsciiChars = false, $encoding = 'UTF-8') |
| 898 | 921 | { |
| 899 | 922 | if ($char === '') { |
@@ -1400,6 +1423,9 @@ discard block |
||
| 1400 | 1423 | // return false; |
| 1401 | 1424 | // } |
| 1402 | 1425 | |
| 1426 | + /** |
|
| 1427 | + * @param integer $int |
|
| 1428 | + */ |
|
| 1403 | 1429 | private function decimalToChr($int) |
| 1404 | 1430 | { |
| 1405 | 1431 | return $this->htmlEntityDecode('&#' . $int . ';', \ENT_QUOTES | \ENT_HTML5); |
@@ -1553,6 +1579,9 @@ discard block |
||
| 1553 | 1579 | return false; |
| 1554 | 1580 | } |
| 1555 | 1581 | |
| 1582 | + /** |
|
| 1583 | + * @param string $input |
|
| 1584 | + */ |
|
| 1556 | 1585 | private function is_binary($input, $strict = false) |
| 1557 | 1586 | { |
| 1558 | 1587 | $input = (string)$input; |
@@ -1590,6 +1619,9 @@ discard block |
||
| 1590 | 1619 | return false; |
| 1591 | 1620 | } |
| 1592 | 1621 | |
| 1622 | + /** |
|
| 1623 | + * @param string $str |
|
| 1624 | + */ |
|
| 1593 | 1625 | private function get_file_type( |
| 1594 | 1626 | $str, |
| 1595 | 1627 | $fallback = [ |
@@ -1709,7 +1741,6 @@ discard block |
||
| 1709 | 1741 | * @see http://hsivonen.iki.fi/php-utf8/ |
| 1710 | 1742 | * |
| 1711 | 1743 | * @param string|string[] $str <p>The string to be checked.</p> |
| 1712 | - * @param bool $strict <p>Check also if the string is not UTF-16 or UTF-32.</p> |
|
| 1713 | 1744 | * |
| 1714 | 1745 | * @return bool |
| 1715 | 1746 | */ |
@@ -1918,9 +1949,7 @@ discard block |
||
| 1918 | 1949 | } |
| 1919 | 1950 | |
| 1920 | 1951 | /** |
| 1921 | - * @param $str |
|
| 1922 | - * @param string $encoding |
|
| 1923 | - * @param bool $cleanUtf8 |
|
| 1952 | + * @param string $str |
|
| 1924 | 1953 | * @return bool|int |
| 1925 | 1954 | */ |
| 1926 | 1955 | private function stringLength($str) |