@@ -185,12 +185,20 @@ discard block |
||
| 185 | 185 | return str_replace($BROKEN_UTF8_TO_UTF8_KEYS_CACHE, $BROKEN_UTF8_TO_UTF8_VALUES_CACHE, $str); |
| 186 | 186 | } |
| 187 | 187 | |
| 188 | + /** |
|
| 189 | + * @param string $file |
|
| 190 | + */ |
|
| 188 | 191 | private function getData($file) |
| 189 | 192 | { |
| 190 | 193 | |
| 191 | 194 | return include __DIR__ . '/../Data/' . $file . '.php'; |
| 192 | 195 | } |
| 193 | 196 | |
| 197 | + /** |
|
| 198 | + * @param integer $flags |
|
| 199 | + * |
|
| 200 | + * @return string |
|
| 201 | + */ |
|
| 194 | 202 | private function htmlEntityDecode($str, $flags = null, $encoding = 'UTF-8') |
| 195 | 203 | { |
| 196 | 204 | if ( |
@@ -496,6 +504,9 @@ discard block |
||
| 496 | 504 | return $buf; |
| 497 | 505 | } |
| 498 | 506 | |
| 507 | + /** |
|
| 508 | + * @param string $input |
|
| 509 | + */ |
|
| 499 | 510 | private function toUtf8ConvertHelper($input) |
| 500 | 511 | { |
| 501 | 512 | // init |
@@ -525,6 +536,9 @@ discard block |
||
| 525 | 536 | return $buf; |
| 526 | 537 | } |
| 527 | 538 | |
| 539 | + /** |
|
| 540 | + * @param integer $code_point |
|
| 541 | + */ |
|
| 528 | 542 | private function chr($code_point, $encoding = 'UTF-8') |
| 529 | 543 | { |
| 530 | 544 | // init |
@@ -620,6 +634,9 @@ discard block |
||
| 620 | 634 | return $CHAR_CACHE[$cacheKey] = $chr; |
| 621 | 635 | } |
| 622 | 636 | |
| 637 | + /** |
|
| 638 | + * @return string |
|
| 639 | + */ |
|
| 623 | 640 | private function encode($toEncoding, $str) |
| 624 | 641 | { |
| 625 | 642 | if ($str === '' || $toEncoding === '') { |
@@ -787,6 +804,9 @@ discard block |
||
| 787 | 804 | return $var; |
| 788 | 805 | } |
| 789 | 806 | |
| 807 | + /** |
|
| 808 | + * @param string $str |
|
| 809 | + */ |
|
| 790 | 810 | private function normalizeLineEnding($str) |
| 791 | 811 | { |
| 792 | 812 | return str_replace(["\r\n", "\r"], "\n", $str); |
@@ -843,6 +863,9 @@ discard block |
||
| 843 | 863 | ); |
| 844 | 864 | } |
| 845 | 865 | |
| 866 | + /** |
|
| 867 | + * @param string $char |
|
| 868 | + */ |
|
| 846 | 869 | private function singleChrHtmlEncode($char, $keepAsciiChars = false, $encoding = 'UTF-8') |
| 847 | 870 | { |
| 848 | 871 | if ($char === '') { |
@@ -1349,6 +1372,9 @@ discard block |
||
| 1349 | 1372 | // return false; |
| 1350 | 1373 | // } |
| 1351 | 1374 | |
| 1375 | + /** |
|
| 1376 | + * @param integer $int |
|
| 1377 | + */ |
|
| 1352 | 1378 | private function decimalToChr($int) |
| 1353 | 1379 | { |
| 1354 | 1380 | return $this->htmlEntityDecode('&#' . $int . ';', \ENT_QUOTES | \ENT_HTML5); |
@@ -1502,6 +1528,9 @@ discard block |
||
| 1502 | 1528 | return false; |
| 1503 | 1529 | } |
| 1504 | 1530 | |
| 1531 | + /** |
|
| 1532 | + * @param string $input |
|
| 1533 | + */ |
|
| 1505 | 1534 | private function is_binary($input, $strict = false) |
| 1506 | 1535 | { |
| 1507 | 1536 | $input = (string)$input; |
@@ -1539,6 +1568,9 @@ discard block |
||
| 1539 | 1568 | return false; |
| 1540 | 1569 | } |
| 1541 | 1570 | |
| 1571 | + /** |
|
| 1572 | + * @param string $str |
|
| 1573 | + */ |
|
| 1542 | 1574 | private function get_file_type( |
| 1543 | 1575 | $str, |
| 1544 | 1576 | $fallback = [ |