@@ -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 ( |
@@ -551,6 +559,9 @@ discard block |
||
551 | 559 | return $buf; |
552 | 560 | } |
553 | 561 | |
562 | + /** |
|
563 | + * @param string $input |
|
564 | + */ |
|
554 | 565 | private function toUtf8ConvertHelper($input) |
555 | 566 | { |
556 | 567 | // init |
@@ -580,6 +591,9 @@ discard block |
||
580 | 591 | return $buf; |
581 | 592 | } |
582 | 593 | |
594 | + /** |
|
595 | + * @param integer $code_point |
|
596 | + */ |
|
583 | 597 | private function chr($code_point, $encoding = 'UTF-8') |
584 | 598 | { |
585 | 599 | // init |
@@ -675,6 +689,9 @@ discard block |
||
675 | 689 | return $CHAR_CACHE[$cacheKey] = $chr; |
676 | 690 | } |
677 | 691 | |
692 | + /** |
|
693 | + * @return string |
|
694 | + */ |
|
678 | 695 | private function encode($toEncoding, $str) |
679 | 696 | { |
680 | 697 | if ($str === '' || $toEncoding === '') { |
@@ -842,6 +859,9 @@ discard block |
||
842 | 859 | return $var; |
843 | 860 | } |
844 | 861 | |
862 | + /** |
|
863 | + * @param string $str |
|
864 | + */ |
|
845 | 865 | private function normalize_line_ending($str) |
846 | 866 | { |
847 | 867 | return str_replace(["\r\n", "\r"], "\n", $str); |
@@ -898,6 +918,9 @@ discard block |
||
898 | 918 | ); |
899 | 919 | } |
900 | 920 | |
921 | + /** |
|
922 | + * @param string $char |
|
923 | + */ |
|
901 | 924 | private function singleChrHtmlEncode($char, $keepAsciiChars = false, $encoding = 'UTF-8') |
902 | 925 | { |
903 | 926 | if ($char === '') { |
@@ -1404,6 +1427,9 @@ discard block |
||
1404 | 1427 | return false; |
1405 | 1428 | } |
1406 | 1429 | |
1430 | + /** |
|
1431 | + * @param string $input |
|
1432 | + */ |
|
1407 | 1433 | private function is_binary($input, $strict = false) |
1408 | 1434 | { |
1409 | 1435 | $input = (string)$input; |
@@ -1441,6 +1467,9 @@ discard block |
||
1441 | 1467 | return false; |
1442 | 1468 | } |
1443 | 1469 | |
1470 | + /** |
|
1471 | + * @param string $str |
|
1472 | + */ |
|
1444 | 1473 | private function get_file_type( |
1445 | 1474 | $str, |
1446 | 1475 | $fallback = [ |
@@ -1533,6 +1562,9 @@ discard block |
||
1533 | 1562 | ]; |
1534 | 1563 | } |
1535 | 1564 | |
1565 | + /** |
|
1566 | + * @param string $str |
|
1567 | + */ |
|
1536 | 1568 | private function is_utf16($str, $checkIfStringIsBinary = true) |
1537 | 1569 | { |
1538 | 1570 | |
@@ -1615,7 +1647,7 @@ discard block |
||
1615 | 1647 | /** |
1616 | 1648 | * Check if the string is UTF-32. |
1617 | 1649 | * |
1618 | - * @param mixed $str <p>The input string.</p> |
|
1650 | + * @param string $str <p>The input string.</p> |
|
1619 | 1651 | * @param bool $checkIfStringIsBinary |
1620 | 1652 | * |
1621 | 1653 | * @return false|int |
@@ -1693,8 +1725,7 @@ discard block |
||
1693 | 1725 | * |
1694 | 1726 | * @see http://hsivonen.iki.fi/php-utf8/ |
1695 | 1727 | * |
1696 | - * @param string|string[] $str <p>The string to be checked.</p> |
|
1697 | - * @param bool $strict <p>Check also if the string is not UTF-16 or UTF-32.</p> |
|
1728 | + * @param string $str <p>The string to be checked.</p> |
|
1698 | 1729 | * |
1699 | 1730 | * @return bool |
1700 | 1731 | */ |
@@ -1922,9 +1953,7 @@ discard block |
||
1922 | 1953 | } |
1923 | 1954 | |
1924 | 1955 | /** |
1925 | - * @param $str |
|
1926 | - * @param string $encoding |
|
1927 | - * @param bool $cleanUtf8 |
|
1956 | + * @param string $str |
|
1928 | 1957 | * @return bool|int |
1929 | 1958 | */ |
1930 | 1959 | private function stringLength($str) |
@@ -1971,6 +2000,9 @@ discard block |
||
1971 | 2000 | return $returnTmp; |
1972 | 2001 | } |
1973 | 2002 | |
2003 | + /** |
|
2004 | + * @param integer $int |
|
2005 | + */ |
|
1974 | 2006 | private function decimalToChr($int) |
1975 | 2007 | { |
1976 | 2008 | return $this->htmlEntityDecode('&#' . $int . ';', \ENT_QUOTES | \ENT_HTML5); |