@@ -187,7 +187,7 @@ discard block |
||
| 187 | 187 | } |
| 188 | 188 | |
| 189 | 189 | /** |
| 190 | - * @param $file |
|
| 190 | + * @param string $file |
|
| 191 | 191 | * @return mixed |
| 192 | 192 | */ |
| 193 | 193 | private function getData($file) |
@@ -197,9 +197,9 @@ discard block |
||
| 197 | 197 | |
| 198 | 198 | /** |
| 199 | 199 | * @param $str |
| 200 | - * @param null $flags |
|
| 200 | + * @param integer $flags |
|
| 201 | 201 | * @param string $encoding |
| 202 | - * @return bool|false|string|string[]|null |
|
| 202 | + * @return string |
|
| 203 | 203 | */ |
| 204 | 204 | private function htmlEntityDecode($str, $flags = null, $encoding = 'UTF-8') |
| 205 | 205 | { |
@@ -511,6 +511,9 @@ discard block |
||
| 511 | 511 | return $buf; |
| 512 | 512 | } |
| 513 | 513 | |
| 514 | + /** |
|
| 515 | + * @param string $input |
|
| 516 | + */ |
|
| 514 | 517 | private function toUtf8ConvertHelper($input) |
| 515 | 518 | { |
| 516 | 519 | // init |
@@ -540,6 +543,9 @@ discard block |
||
| 540 | 543 | return $buf; |
| 541 | 544 | } |
| 542 | 545 | |
| 546 | + /** |
|
| 547 | + * @param integer $code_point |
|
| 548 | + */ |
|
| 543 | 549 | private function chr($code_point, $encoding = 'UTF-8') |
| 544 | 550 | { |
| 545 | 551 | // init |
@@ -635,6 +641,9 @@ discard block |
||
| 635 | 641 | return $CHAR_CACHE[$cacheKey] = $chr; |
| 636 | 642 | } |
| 637 | 643 | |
| 644 | + /** |
|
| 645 | + * @return string |
|
| 646 | + */ |
|
| 638 | 647 | private function encode($toEncoding, $str) |
| 639 | 648 | { |
| 640 | 649 | if ($str === '' || $toEncoding === '') { |
@@ -802,6 +811,9 @@ discard block |
||
| 802 | 811 | return $var; |
| 803 | 812 | } |
| 804 | 813 | |
| 814 | + /** |
|
| 815 | + * @param string $str |
|
| 816 | + */ |
|
| 805 | 817 | private function normalizeLineEnding($str) |
| 806 | 818 | { |
| 807 | 819 | return str_replace(["\r\n", "\r"], "\n", $str); |
@@ -858,6 +870,9 @@ discard block |
||
| 858 | 870 | ); |
| 859 | 871 | } |
| 860 | 872 | |
| 873 | + /** |
|
| 874 | + * @param string $char |
|
| 875 | + */ |
|
| 861 | 876 | private function singleChrHtmlEncode($char, $keepAsciiChars = false, $encoding = 'UTF-8') |
| 862 | 877 | { |
| 863 | 878 | if ($char === '') { |
@@ -1049,11 +1064,17 @@ discard block |
||
| 1049 | 1064 | return $ret; |
| 1050 | 1065 | } |
| 1051 | 1066 | |
| 1067 | + /** |
|
| 1068 | + * @param integer $int |
|
| 1069 | + */ |
|
| 1052 | 1070 | private function decimalToChr($int) |
| 1053 | 1071 | { |
| 1054 | 1072 | return $this->htmlEntityDecode('&#' . $int . ';', \ENT_QUOTES | \ENT_HTML5); |
| 1055 | 1073 | } |
| 1056 | 1074 | |
| 1075 | + /** |
|
| 1076 | + * @return string |
|
| 1077 | + */ |
|
| 1057 | 1078 | private function clean($str, $remove_bom = false, $normalize_whitespace = false, $normalize_msword = false, $keep_non_breaking_space = false, $replace_diamond_question_mark = false, $remove_invisible_characters = true) |
| 1058 | 1079 | { |
| 1059 | 1080 | // http://stackoverflow.com/questions/1401317/remove-non-utf8-characters-from-string |