@@ -243,7 +243,7 @@ discard block |
||
243 | 243 | public static function add_bom_to_string(string $str): string |
244 | 244 | { |
245 | 245 | if (self::string_has_bom($str) === false) { |
246 | - $str = self::bom() . $str; |
|
246 | + $str = self::bom().$str; |
|
247 | 247 | } |
248 | 248 | |
249 | 249 | return $str; |
@@ -399,10 +399,10 @@ discard block |
||
399 | 399 | && |
400 | 400 | self::$SUPPORT['mbstring'] === false |
401 | 401 | ) { |
402 | - \trigger_error('UTF8::chr() without mbstring cannot handle "' . $encoding . '" encoding', E_USER_WARNING); |
|
402 | + \trigger_error('UTF8::chr() without mbstring cannot handle "'.$encoding.'" encoding', E_USER_WARNING); |
|
403 | 403 | } |
404 | 404 | |
405 | - $cacheKey = $code_point . $encoding; |
|
405 | + $cacheKey = $code_point.$encoding; |
|
406 | 406 | if (isset($CHAR_CACHE[$cacheKey]) === true) { |
407 | 407 | return $CHAR_CACHE[$cacheKey]; |
408 | 408 | } |
@@ -439,16 +439,16 @@ discard block |
||
439 | 439 | if ($code_point <= 0x7F) { |
440 | 440 | $chr = self::$CHR[$code_point]; |
441 | 441 | } elseif ($code_point <= 0x7FF) { |
442 | - $chr = self::$CHR[($code_point >> 6) + 0xC0] . |
|
442 | + $chr = self::$CHR[($code_point >> 6) + 0xC0]. |
|
443 | 443 | self::$CHR[($code_point & 0x3F) + 0x80]; |
444 | 444 | } elseif ($code_point <= 0xFFFF) { |
445 | - $chr = self::$CHR[($code_point >> 12) + 0xE0] . |
|
446 | - self::$CHR[(($code_point >> 6) & 0x3F) + 0x80] . |
|
445 | + $chr = self::$CHR[($code_point >> 12) + 0xE0]. |
|
446 | + self::$CHR[(($code_point >> 6) & 0x3F) + 0x80]. |
|
447 | 447 | self::$CHR[($code_point & 0x3F) + 0x80]; |
448 | 448 | } else { |
449 | - $chr = self::$CHR[($code_point >> 18) + 0xF0] . |
|
450 | - self::$CHR[(($code_point >> 12) & 0x3F) + 0x80] . |
|
451 | - self::$CHR[(($code_point >> 6) & 0x3F) + 0x80] . |
|
449 | + $chr = self::$CHR[($code_point >> 18) + 0xF0]. |
|
450 | + self::$CHR[(($code_point >> 12) & 0x3F) + 0x80]. |
|
451 | + self::$CHR[(($code_point >> 6) & 0x3F) + 0x80]. |
|
452 | 452 | self::$CHR[($code_point & 0x3F) + 0x80]; |
453 | 453 | } |
454 | 454 | |
@@ -496,7 +496,7 @@ discard block |
||
496 | 496 | |
497 | 497 | if (self::$SUPPORT['mbstring_func_overload'] === true) { |
498 | 498 | return \array_map( |
499 | - function ($data) { |
|
499 | + function($data) { |
|
500 | 500 | return UTF8::strlen($data, 'CP850'); // 8-BIT |
501 | 501 | }, |
502 | 502 | $strSplit |
@@ -504,7 +504,7 @@ discard block |
||
504 | 504 | } |
505 | 505 | |
506 | 506 | return \array_map( |
507 | - function ($data) { |
|
507 | + function($data) { |
|
508 | 508 | return \strlen($data); |
509 | 509 | }, |
510 | 510 | $strSplit |
@@ -755,7 +755,7 @@ discard block |
||
755 | 755 | */ |
756 | 756 | public static function decimal_to_chr($int): string |
757 | 757 | { |
758 | - return self::html_entity_decode('&#' . $int . ';', ENT_QUOTES | ENT_HTML5); |
|
758 | + return self::html_entity_decode('&#'.$int.';', ENT_QUOTES | ENT_HTML5); |
|
759 | 759 | } |
760 | 760 | |
761 | 761 | /** |
@@ -828,7 +828,7 @@ discard block |
||
828 | 828 | && |
829 | 829 | self::$SUPPORT['mbstring'] === false |
830 | 830 | ) { |
831 | - \trigger_error('UTF8::encode() without mbstring cannot handle "' . $encoding . '" encoding', E_USER_WARNING); |
|
831 | + \trigger_error('UTF8::encode() without mbstring cannot handle "'.$encoding.'" encoding', E_USER_WARNING); |
|
832 | 832 | } |
833 | 833 | |
834 | 834 | $strEncoded = \mb_convert_encoding( |
@@ -998,7 +998,7 @@ discard block |
||
998 | 998 | ) { |
999 | 999 | // Prevent leading combining chars |
1000 | 1000 | // for NFC-safe concatenations. |
1001 | - $var = $leading_combining . $var; |
|
1001 | + $var = $leading_combining.$var; |
|
1002 | 1002 | } |
1003 | 1003 | } |
1004 | 1004 | |
@@ -1420,7 +1420,7 @@ discard block |
||
1420 | 1420 | */ |
1421 | 1421 | private static function getData(string $file) |
1422 | 1422 | { |
1423 | - $file = __DIR__ . '/data/' . $file . '.php'; |
|
1423 | + $file = __DIR__.'/data/'.$file.'.php'; |
|
1424 | 1424 | if (\file_exists($file)) { |
1425 | 1425 | /** @noinspection PhpIncludeInspection */ |
1426 | 1426 | return require $file; |
@@ -1560,7 +1560,7 @@ discard block |
||
1560 | 1560 | return \implode( |
1561 | 1561 | '', |
1562 | 1562 | \array_map( |
1563 | - function ($data) use ($keepAsciiChars, $encoding) { |
|
1563 | + function($data) use ($keepAsciiChars, $encoding) { |
|
1564 | 1564 | return UTF8::single_chr_html_encode($data, $keepAsciiChars, $encoding); |
1565 | 1565 | }, |
1566 | 1566 | self::split($str) |
@@ -1676,7 +1676,7 @@ discard block |
||
1676 | 1676 | && |
1677 | 1677 | self::$SUPPORT['mbstring'] === false |
1678 | 1678 | ) { |
1679 | - \trigger_error('UTF8::html_entity_decode() without mbstring cannot handle "' . $encoding . '" encoding', E_USER_WARNING); |
|
1679 | + \trigger_error('UTF8::html_entity_decode() without mbstring cannot handle "'.$encoding.'" encoding', E_USER_WARNING); |
|
1680 | 1680 | } |
1681 | 1681 | |
1682 | 1682 | do { |
@@ -1684,7 +1684,7 @@ discard block |
||
1684 | 1684 | |
1685 | 1685 | $str = (string)\preg_replace_callback( |
1686 | 1686 | "/&#\d{2,6};/", |
1687 | - function ($matches) use ($encoding) { |
|
1687 | + function($matches) use ($encoding) { |
|
1688 | 1688 | $returnTmp = \mb_convert_encoding($matches[0], $encoding, 'HTML-ENTITIES'); |
1689 | 1689 | |
1690 | 1690 | if ($returnTmp !== '"' && $returnTmp !== "'") { |
@@ -1988,9 +1988,9 @@ discard block |
||
1988 | 1988 | { |
1989 | 1989 | $hex = \dechex($int); |
1990 | 1990 | |
1991 | - $hex = (\strlen($hex) < 4 ? \substr('0000' . $hex, -4) : $hex); |
|
1991 | + $hex = (\strlen($hex) < 4 ? \substr('0000'.$hex, -4) : $hex); |
|
1992 | 1992 | |
1993 | - return $pfix . $hex; |
|
1993 | + return $pfix.$hex; |
|
1994 | 1994 | } |
1995 | 1995 | |
1996 | 1996 | /** |
@@ -2734,7 +2734,7 @@ discard block |
||
2734 | 2734 | $cleanUtf8 |
2735 | 2735 | ); |
2736 | 2736 | |
2737 | - return $strPartOne . $strPartTwo; |
|
2737 | + return $strPartOne.$strPartTwo; |
|
2738 | 2738 | } |
2739 | 2739 | |
2740 | 2740 | /** |
@@ -2822,7 +2822,7 @@ discard block |
||
2822 | 2822 | return \preg_replace('/^[\pZ\pC]+/u', '', $str); |
2823 | 2823 | } |
2824 | 2824 | |
2825 | - return \preg_replace('/^' . self::rxClass($chars) . '+/u', '', $str); |
|
2825 | + return \preg_replace('/^'.self::rxClass($chars).'+/u', '', $str); |
|
2826 | 2826 | } |
2827 | 2827 | |
2828 | 2828 | /** |
@@ -3136,7 +3136,7 @@ discard block |
||
3136 | 3136 | } |
3137 | 3137 | } |
3138 | 3138 | |
3139 | - $cacheKey = $chr_orig . $encoding; |
|
3139 | + $cacheKey = $chr_orig.$encoding; |
|
3140 | 3140 | if (isset($CHAR_CACHE[$cacheKey]) === true) { |
3141 | 3141 | return $CHAR_CACHE[$cacheKey]; |
3142 | 3142 | } |
@@ -3363,7 +3363,7 @@ discard block |
||
3363 | 3363 | if (\is_array($what) === true) { |
3364 | 3364 | /** @noinspection ForeachSourceInspection */ |
3365 | 3365 | foreach ($what as $item) { |
3366 | - $str = (string)\preg_replace('/(' . \preg_quote($item, '/') . ')+/', $item, $str); |
|
3366 | + $str = (string)\preg_replace('/('.\preg_quote($item, '/').')+/', $item, $str); |
|
3367 | 3367 | } |
3368 | 3368 | } |
3369 | 3369 | |
@@ -3473,7 +3473,7 @@ discard block |
||
3473 | 3473 | return \preg_replace('/[\pZ\pC]+$/u', '', $str); |
3474 | 3474 | } |
3475 | 3475 | |
3476 | - return \preg_replace('/' . self::rxClass($chars) . '+$/u', '', $str); |
|
3476 | + return \preg_replace('/'.self::rxClass($chars).'+$/u', '', $str); |
|
3477 | 3477 | } |
3478 | 3478 | |
3479 | 3479 | /** |
@@ -3488,7 +3488,7 @@ discard block |
||
3488 | 3488 | { |
3489 | 3489 | static $RX_CLASSS_CACHE = []; |
3490 | 3490 | |
3491 | - $cacheKey = $s . $class; |
|
3491 | + $cacheKey = $s.$class; |
|
3492 | 3492 | |
3493 | 3493 | if (isset($RX_CLASSS_CACHE[$cacheKey])) { |
3494 | 3494 | return $RX_CLASSS_CACHE[$cacheKey]; |
@@ -3500,7 +3500,7 @@ discard block |
||
3500 | 3500 | /** @noinspection SuspiciousLoopInspection */ |
3501 | 3501 | foreach (self::str_split($s) as $s) { |
3502 | 3502 | if ('-' === $s) { |
3503 | - $class[0] = '-' . $class[0]; |
|
3503 | + $class[0] = '-'.$class[0]; |
|
3504 | 3504 | } elseif (!isset($s[2])) { |
3505 | 3505 | $class[0] .= \preg_quote($s, '/'); |
3506 | 3506 | } elseif (1 === self::strlen($s)) { |
@@ -3511,13 +3511,13 @@ discard block |
||
3511 | 3511 | } |
3512 | 3512 | |
3513 | 3513 | if ($class[0]) { |
3514 | - $class[0] = '[' . $class[0] . ']'; |
|
3514 | + $class[0] = '['.$class[0].']'; |
|
3515 | 3515 | } |
3516 | 3516 | |
3517 | 3517 | if (1 === \count($class)) { |
3518 | 3518 | $return = $class[0]; |
3519 | 3519 | } else { |
3520 | - $return = '(?:' . \implode('|', $class) . ')'; |
|
3520 | + $return = '(?:'.\implode('|', $class).')'; |
|
3521 | 3521 | } |
3522 | 3522 | |
3523 | 3523 | $RX_CLASSS_CACHE[$cacheKey] = $return; |
@@ -3536,7 +3536,7 @@ discard block |
||
3536 | 3536 | |
3537 | 3537 | echo '<pre>'; |
3538 | 3538 | foreach (self::$SUPPORT as $key => $value) { |
3539 | - echo $key . ' - ' . \print_r($value, true) . "\n<br>"; |
|
3539 | + echo $key.' - '.\print_r($value, true)."\n<br>"; |
|
3540 | 3540 | } |
3541 | 3541 | echo '</pre>'; |
3542 | 3542 | } |
@@ -3568,7 +3568,7 @@ discard block |
||
3568 | 3568 | $encoding = self::normalize_encoding($encoding, 'UTF-8'); |
3569 | 3569 | } |
3570 | 3570 | |
3571 | - return '&#' . self::ord($char, $encoding) . ';'; |
|
3571 | + return '&#'.self::ord($char, $encoding).';'; |
|
3572 | 3572 | } |
3573 | 3573 | |
3574 | 3574 | /** |
@@ -3629,7 +3629,7 @@ discard block |
||
3629 | 3629 | ) { |
3630 | 3630 | |
3631 | 3631 | if (($str[$i + 1] & "\xC0") === "\x80") { |
3632 | - $ret[] = $str[$i] . $str[$i + 1]; |
|
3632 | + $ret[] = $str[$i].$str[$i + 1]; |
|
3633 | 3633 | |
3634 | 3634 | $i++; |
3635 | 3635 | } |
@@ -3645,7 +3645,7 @@ discard block |
||
3645 | 3645 | && |
3646 | 3646 | ($str[$i + 2] & "\xC0") === "\x80" |
3647 | 3647 | ) { |
3648 | - $ret[] = $str[$i] . $str[$i + 1] . $str[$i + 2]; |
|
3648 | + $ret[] = $str[$i].$str[$i + 1].$str[$i + 2]; |
|
3649 | 3649 | |
3650 | 3650 | $i += 2; |
3651 | 3651 | } |
@@ -3663,7 +3663,7 @@ discard block |
||
3663 | 3663 | && |
3664 | 3664 | ($str[$i + 3] & "\xC0") === "\x80" |
3665 | 3665 | ) { |
3666 | - $ret[] = $str[$i] . $str[$i + 1] . $str[$i + 2] . $str[$i + 3]; |
|
3666 | + $ret[] = $str[$i].$str[$i + 1].$str[$i + 2].$str[$i + 3]; |
|
3667 | 3667 | |
3668 | 3668 | $i += 3; |
3669 | 3669 | } |
@@ -3676,7 +3676,7 @@ discard block |
||
3676 | 3676 | $ret = \array_chunk($ret, $length); |
3677 | 3677 | |
3678 | 3678 | return \array_map( |
3679 | - function ($item) { |
|
3679 | + function($item) { |
|
3680 | 3680 | return \implode('', $item); |
3681 | 3681 | }, $ret |
3682 | 3682 | ); |
@@ -3800,7 +3800,7 @@ discard block |
||
3800 | 3800 | foreach (self::$ENCODINGS as $encodingTmp) { |
3801 | 3801 | # INFO: //IGNORE and //TRANSLIT still throw notice |
3802 | 3802 | /** @noinspection PhpUsageOfSilenceOperatorInspection */ |
3803 | - if (\md5(@\iconv($encodingTmp, $encodingTmp . '//IGNORE', $str)) === $md5) { |
|
3803 | + if (\md5(@\iconv($encodingTmp, $encodingTmp.'//IGNORE', $str)) === $md5) { |
|
3804 | 3804 | return $encodingTmp; |
3805 | 3805 | } |
3806 | 3806 | } |
@@ -3884,7 +3884,7 @@ discard block |
||
3884 | 3884 | if ('' === $s .= '') { |
3885 | 3885 | $s = '/^(?<=.)$/'; |
3886 | 3886 | } else { |
3887 | - $s = '/' . \preg_quote($s, '/') . '/ui'; |
|
3887 | + $s = '/'.\preg_quote($s, '/').'/ui'; |
|
3888 | 3888 | } |
3889 | 3889 | } |
3890 | 3890 | |
@@ -3935,7 +3935,7 @@ discard block |
||
3935 | 3935 | } |
3936 | 3936 | |
3937 | 3937 | if (self::substr($str, $length - 1, 1) === ' ') { |
3938 | - return (string)self::substr($str, 0, $length - 1) . $strAddOn; |
|
3938 | + return (string)self::substr($str, 0, $length - 1).$strAddOn; |
|
3939 | 3939 | } |
3940 | 3940 | |
3941 | 3941 | $str = (string)self::substr($str, 0, $length); |
@@ -3944,9 +3944,9 @@ discard block |
||
3944 | 3944 | $new_str = \implode(' ', $array); |
3945 | 3945 | |
3946 | 3946 | if ($new_str === '') { |
3947 | - $str = (string)self::substr($str, 0, $length - 1) . $strAddOn; |
|
3947 | + $str = (string)self::substr($str, 0, $length - 1).$strAddOn; |
|
3948 | 3948 | } else { |
3949 | - $str = $new_str . $strAddOn; |
|
3949 | + $str = $new_str.$strAddOn; |
|
3950 | 3950 | } |
3951 | 3951 | |
3952 | 3952 | return $str; |
@@ -4001,7 +4001,7 @@ discard block |
||
4001 | 4001 | $pre = ''; |
4002 | 4002 | } |
4003 | 4003 | |
4004 | - return $pre . $str . $post; |
|
4004 | + return $pre.$str.$post; |
|
4005 | 4005 | } |
4006 | 4006 | |
4007 | 4007 | return $str; |
@@ -4155,7 +4155,7 @@ discard block |
||
4155 | 4155 | } |
4156 | 4156 | |
4157 | 4157 | /** @noinspection PhpInternalEntityUsedInspection */ |
4158 | - \preg_match_all('/' . self::GRAPHEME_CLUSTER_RX . '/u', $str, $a); |
|
4158 | + \preg_match_all('/'.self::GRAPHEME_CLUSTER_RX.'/u', $str, $a); |
|
4159 | 4159 | $a = $a[0]; |
4160 | 4160 | |
4161 | 4161 | if ($len === 1) { |
@@ -4380,7 +4380,7 @@ discard block |
||
4380 | 4380 | public static function strcmp(string $str1, string $str2): int |
4381 | 4381 | { |
4382 | 4382 | /** @noinspection PhpUndefinedClassInspection */ |
4383 | - return $str1 . '' === $str2 . '' ? 0 : \strcmp( |
|
4383 | + return $str1.'' === $str2.'' ? 0 : \strcmp( |
|
4384 | 4384 | \Normalizer::normalize($str1, \Normalizer::NFD), |
4385 | 4385 | \Normalizer::normalize($str2, \Normalizer::NFD) |
4386 | 4386 | ); |
@@ -4414,7 +4414,7 @@ discard block |
||
4414 | 4414 | return null; |
4415 | 4415 | } |
4416 | 4416 | |
4417 | - if (\preg_match('/^(.*?)' . self::rxClass($charList) . '/us', $str, $length)) { |
|
4417 | + if (\preg_match('/^(.*?)'.self::rxClass($charList).'/us', $str, $length)) { |
|
4418 | 4418 | return self::strlen($length[1]); |
4419 | 4419 | } |
4420 | 4420 | |
@@ -4624,7 +4624,7 @@ discard block |
||
4624 | 4624 | && |
4625 | 4625 | self::$SUPPORT['mbstring'] === false |
4626 | 4626 | ) { |
4627 | - \trigger_error('UTF8::stristr() without mbstring cannot handle "' . $encoding . '" encoding', E_USER_WARNING); |
|
4627 | + \trigger_error('UTF8::stristr() without mbstring cannot handle "'.$encoding.'" encoding', E_USER_WARNING); |
|
4628 | 4628 | } |
4629 | 4629 | |
4630 | 4630 | if (self::$SUPPORT['mbstring'] === true) { |
@@ -4643,7 +4643,7 @@ discard block |
||
4643 | 4643 | return \stristr($haystack, $needle, $before_needle); |
4644 | 4644 | } |
4645 | 4645 | |
4646 | - \preg_match('/^(.*?)' . \preg_quote($needle, '/') . '/usi', $haystack, $match); |
|
4646 | + \preg_match('/^(.*?)'.\preg_quote($needle, '/').'/usi', $haystack, $match); |
|
4647 | 4647 | |
4648 | 4648 | if (!isset($match[1])) { |
4649 | 4649 | return false; |
@@ -4709,7 +4709,7 @@ discard block |
||
4709 | 4709 | && |
4710 | 4710 | self::$SUPPORT['iconv'] === false |
4711 | 4711 | ) { |
4712 | - \trigger_error('UTF8::strlen() without mbstring / iconv cannot handle "' . $encoding . '" encoding', E_USER_WARNING); |
|
4712 | + \trigger_error('UTF8::strlen() without mbstring / iconv cannot handle "'.$encoding.'" encoding', E_USER_WARNING); |
|
4713 | 4713 | } |
4714 | 4714 | |
4715 | 4715 | if ( |
@@ -4813,7 +4813,7 @@ discard block |
||
4813 | 4813 | */ |
4814 | 4814 | public static function strnatcmp(string $str1, string $str2): int |
4815 | 4815 | { |
4816 | - return $str1 . '' === $str2 . '' ? 0 : \strnatcmp(self::strtonatfold($str1), self::strtonatfold($str2)); |
|
4816 | + return $str1.'' === $str2.'' ? 0 : \strnatcmp(self::strtonatfold($str1), self::strtonatfold($str2)); |
|
4817 | 4817 | } |
4818 | 4818 | |
4819 | 4819 | /** |
@@ -4871,7 +4871,7 @@ discard block |
||
4871 | 4871 | return false; |
4872 | 4872 | } |
4873 | 4873 | |
4874 | - if (\preg_match('/' . self::rxClass($char_list) . '/us', $haystack, $m)) { |
|
4874 | + if (\preg_match('/'.self::rxClass($char_list).'/us', $haystack, $m)) { |
|
4875 | 4875 | return \substr($haystack, \strpos($haystack, $m[0])); |
4876 | 4876 | } |
4877 | 4877 | |
@@ -4935,7 +4935,7 @@ discard block |
||
4935 | 4935 | && |
4936 | 4936 | self::$SUPPORT['mbstring'] === false |
4937 | 4937 | ) { |
4938 | - \trigger_error('UTF8::strpos() without mbstring / iconv cannot handle "' . $encoding . '" encoding', E_USER_WARNING); |
|
4938 | + \trigger_error('UTF8::strpos() without mbstring / iconv cannot handle "'.$encoding.'" encoding', E_USER_WARNING); |
|
4939 | 4939 | } |
4940 | 4940 | |
4941 | 4941 | if ( |
@@ -5156,7 +5156,7 @@ discard block |
||
5156 | 5156 | && |
5157 | 5157 | self::$SUPPORT['mbstring'] === false |
5158 | 5158 | ) { |
5159 | - \trigger_error('UTF8::strripos() without mbstring cannot handle "' . $encoding . '" encoding', E_USER_WARNING); |
|
5159 | + \trigger_error('UTF8::strripos() without mbstring cannot handle "'.$encoding.'" encoding', E_USER_WARNING); |
|
5160 | 5160 | } |
5161 | 5161 | |
5162 | 5162 | if (self::$SUPPORT['mbstring'] === true) { |
@@ -5227,7 +5227,7 @@ discard block |
||
5227 | 5227 | && |
5228 | 5228 | self::$SUPPORT['mbstring'] === false |
5229 | 5229 | ) { |
5230 | - \trigger_error('UTF8::strrpos() without mbstring cannot handle "' . $encoding . '" encoding', E_USER_WARNING); |
|
5230 | + \trigger_error('UTF8::strrpos() without mbstring cannot handle "'.$encoding.'" encoding', E_USER_WARNING); |
|
5231 | 5231 | } |
5232 | 5232 | |
5233 | 5233 | if (self::$SUPPORT['mbstring'] === true) { |
@@ -5292,7 +5292,7 @@ discard block |
||
5292 | 5292 | return 0; |
5293 | 5293 | } |
5294 | 5294 | |
5295 | - return \preg_match('/^' . self::rxClass($mask) . '+/u', $str, $str) ? self::strlen($str[0]) : 0; |
|
5295 | + return \preg_match('/^'.self::rxClass($mask).'+/u', $str, $str) ? self::strlen($str[0]) : 0; |
|
5296 | 5296 | } |
5297 | 5297 | |
5298 | 5298 | /** |
@@ -5335,7 +5335,7 @@ discard block |
||
5335 | 5335 | && |
5336 | 5336 | self::$SUPPORT['mbstring'] === false |
5337 | 5337 | ) { |
5338 | - \trigger_error('UTF8::strstr() without mbstring cannot handle "' . $encoding . '" encoding', E_USER_WARNING); |
|
5338 | + \trigger_error('UTF8::strstr() without mbstring cannot handle "'.$encoding.'" encoding', E_USER_WARNING); |
|
5339 | 5339 | } |
5340 | 5340 | |
5341 | 5341 | if (self::$SUPPORT['mbstring'] === true) { |
@@ -5350,7 +5350,7 @@ discard block |
||
5350 | 5350 | return \grapheme_strstr($haystack, $needle, $before_needle); |
5351 | 5351 | } |
5352 | 5352 | |
5353 | - \preg_match('/^(.*?)' . \preg_quote($needle, '/') . '/us', $haystack, $match); |
|
5353 | + \preg_match('/^(.*?)'.\preg_quote($needle, '/').'/us', $haystack, $match); |
|
5354 | 5354 | |
5355 | 5355 | if (!isset($match[1])) { |
5356 | 5356 | return false; |
@@ -5447,9 +5447,9 @@ discard block |
||
5447 | 5447 | |
5448 | 5448 | if (self::$SUPPORT['intl'] === true) { |
5449 | 5449 | |
5450 | - $langCode = $lang . '-Lower'; |
|
5450 | + $langCode = $lang.'-Lower'; |
|
5451 | 5451 | if (!\in_array($langCode, self::$SUPPORT['intl__transliterator_list_ids'], true)) { |
5452 | - \trigger_error('UTF8::strtolower() without intl for special language: ' . $lang, E_USER_WARNING); |
|
5452 | + \trigger_error('UTF8::strtolower() without intl for special language: '.$lang, E_USER_WARNING); |
|
5453 | 5453 | |
5454 | 5454 | $langCode = 'Any-Lower'; |
5455 | 5455 | } |
@@ -5457,7 +5457,7 @@ discard block |
||
5457 | 5457 | return transliterator_transliterate($langCode, $str); |
5458 | 5458 | } |
5459 | 5459 | |
5460 | - \trigger_error('UTF8::strtolower() without intl + PHP >= 5.4 cannot handle the "lang"-parameter: ' . $lang, E_USER_WARNING); |
|
5460 | + \trigger_error('UTF8::strtolower() without intl + PHP >= 5.4 cannot handle the "lang"-parameter: '.$lang, E_USER_WARNING); |
|
5461 | 5461 | } |
5462 | 5462 | |
5463 | 5463 | return \mb_strtolower($str, $encoding); |
@@ -5512,9 +5512,9 @@ discard block |
||
5512 | 5512 | |
5513 | 5513 | if (self::$SUPPORT['intl'] === true) { |
5514 | 5514 | |
5515 | - $langCode = $lang . '-Upper'; |
|
5515 | + $langCode = $lang.'-Upper'; |
|
5516 | 5516 | if (!\in_array($langCode, self::$SUPPORT['intl__transliterator_list_ids'], true)) { |
5517 | - \trigger_error('UTF8::strtoupper() without intl for special language: ' . $lang, E_USER_WARNING); |
|
5517 | + \trigger_error('UTF8::strtoupper() without intl for special language: '.$lang, E_USER_WARNING); |
|
5518 | 5518 | |
5519 | 5519 | $langCode = 'Any-Upper'; |
5520 | 5520 | } |
@@ -5522,7 +5522,7 @@ discard block |
||
5522 | 5522 | return transliterator_transliterate($langCode, $str); |
5523 | 5523 | } |
5524 | 5524 | |
5525 | - \trigger_error('UTF8::strtolower() without intl + PHP >= 5.4 cannot handle the "lang"-parameter: ' . $lang, E_USER_WARNING); |
|
5525 | + \trigger_error('UTF8::strtolower() without intl + PHP >= 5.4 cannot handle the "lang"-parameter: '.$lang, E_USER_WARNING); |
|
5526 | 5526 | } |
5527 | 5527 | |
5528 | 5528 | return \mb_strtoupper($str, $encoding); |
@@ -5678,7 +5678,7 @@ discard block |
||
5678 | 5678 | && |
5679 | 5679 | self::$SUPPORT['mbstring'] === false |
5680 | 5680 | ) { |
5681 | - \trigger_error('UTF8::substr() without mbstring cannot handle "' . $encoding . '" encoding', E_USER_WARNING); |
|
5681 | + \trigger_error('UTF8::substr() without mbstring cannot handle "'.$encoding.'" encoding', E_USER_WARNING); |
|
5682 | 5682 | } |
5683 | 5683 | |
5684 | 5684 | if (self::$SUPPORT['mbstring'] === true) { |
@@ -5706,8 +5706,7 @@ discard block |
||
5706 | 5706 | |
5707 | 5707 | if (self::is_ascii($str)) { |
5708 | 5708 | return ($length === null) ? |
5709 | - \substr($str, $offset) : |
|
5710 | - \substr($str, $offset, $length); |
|
5709 | + \substr($str, $offset) : \substr($str, $offset, $length); |
|
5711 | 5710 | } |
5712 | 5711 | |
5713 | 5712 | // fallback via vanilla php |
@@ -5835,14 +5834,14 @@ discard block |
||
5835 | 5834 | && |
5836 | 5835 | self::$SUPPORT['mbstring'] === false |
5837 | 5836 | ) { |
5838 | - \trigger_error('UTF8::substr_count() without mbstring cannot handle "' . $encoding . '" encoding', E_USER_WARNING); |
|
5837 | + \trigger_error('UTF8::substr_count() without mbstring cannot handle "'.$encoding.'" encoding', E_USER_WARNING); |
|
5839 | 5838 | } |
5840 | 5839 | |
5841 | 5840 | if (self::$SUPPORT['mbstring'] === true) { |
5842 | 5841 | return \mb_substr_count($haystack, $needle, $encoding); |
5843 | 5842 | } |
5844 | 5843 | |
5845 | - \preg_match_all('/' . \preg_quote($needle, '/') . '/us', $haystack, $matches, PREG_SET_ORDER); |
|
5844 | + \preg_match_all('/'.\preg_quote($needle, '/').'/us', $haystack, $matches, PREG_SET_ORDER); |
|
5846 | 5845 | |
5847 | 5846 | return \count($matches); |
5848 | 5847 | } |
@@ -6020,8 +6019,7 @@ discard block |
||
6020 | 6019 | |
6021 | 6020 | if (self::is_ascii($str)) { |
6022 | 6021 | return ($length === null) ? |
6023 | - \substr_replace($str, $replacement, $offset) : |
|
6024 | - \substr_replace($str, $replacement, $offset, $length); |
|
6022 | + \substr_replace($str, $replacement, $offset) : \substr_replace($str, $replacement, $offset, $length); |
|
6025 | 6023 | } |
6026 | 6024 | |
6027 | 6025 | \preg_match_all('/./us', $str, $smatches); |
@@ -6092,7 +6090,7 @@ discard block |
||
6092 | 6090 | |
6093 | 6091 | $strSwappedCase = \preg_replace_callback( |
6094 | 6092 | '/[\S]/u', |
6095 | - function ($match) use ($encoding) { |
|
6093 | + function($match) use ($encoding) { |
|
6096 | 6094 | $marchToUpper = UTF8::strtoupper($match[0], $encoding); |
6097 | 6095 | |
6098 | 6096 | if ($match[0] === $marchToUpper) { |
@@ -6428,7 +6426,7 @@ discard block |
||
6428 | 6426 | $c2 = $i + 1 >= $max ? "\x00" : $str[$i + 1]; |
6429 | 6427 | |
6430 | 6428 | if ($c2 >= "\x80" && $c2 <= "\xBF") { // yeah, almost sure it's UTF8 already |
6431 | - $buf .= $c1 . $c2; |
|
6429 | + $buf .= $c1.$c2; |
|
6432 | 6430 | $i++; |
6433 | 6431 | } else { // not valid UTF8 - convert it |
6434 | 6432 | $buf .= self::to_utf8_convert($c1); |
@@ -6440,7 +6438,7 @@ discard block |
||
6440 | 6438 | $c3 = $i + 2 >= $max ? "\x00" : $str[$i + 2]; |
6441 | 6439 | |
6442 | 6440 | if ($c2 >= "\x80" && $c2 <= "\xBF" && $c3 >= "\x80" && $c3 <= "\xBF") { // yeah, almost sure it's UTF8 already |
6443 | - $buf .= $c1 . $c2 . $c3; |
|
6441 | + $buf .= $c1.$c2.$c3; |
|
6444 | 6442 | $i += 2; |
6445 | 6443 | } else { // not valid UTF8 - convert it |
6446 | 6444 | $buf .= self::to_utf8_convert($c1); |
@@ -6453,7 +6451,7 @@ discard block |
||
6453 | 6451 | $c4 = $i + 3 >= $max ? "\x00" : $str[$i + 3]; |
6454 | 6452 | |
6455 | 6453 | if ($c2 >= "\x80" && $c2 <= "\xBF" && $c3 >= "\x80" && $c3 <= "\xBF" && $c4 >= "\x80" && $c4 <= "\xBF") { // yeah, almost sure it's UTF8 already |
6456 | - $buf .= $c1 . $c2 . $c3 . $c4; |
|
6454 | + $buf .= $c1.$c2.$c3.$c4; |
|
6457 | 6455 | $i += 3; |
6458 | 6456 | } else { // not valid UTF8 - convert it |
6459 | 6457 | $buf .= self::to_utf8_convert($c1); |
@@ -6475,7 +6473,7 @@ discard block |
||
6475 | 6473 | // decode unicode escape sequences |
6476 | 6474 | $buf = \preg_replace_callback( |
6477 | 6475 | '/\\\\u([0-9a-f]{4})/i', |
6478 | - function ($match) { |
|
6476 | + function($match) { |
|
6479 | 6477 | return \mb_convert_encoding(pack('H*', $match[1]), 'UTF-8', 'UCS-2BE'); |
6480 | 6478 | }, |
6481 | 6479 | $buf |
@@ -6517,7 +6515,7 @@ discard block |
||
6517 | 6515 | } else { |
6518 | 6516 | $cc1 = self::$CHR[$ordC1 / 64] | "\xC0"; |
6519 | 6517 | $cc2 = ($int & "\x3F") | "\x80"; |
6520 | - $buf .= $cc1 . $cc2; |
|
6518 | + $buf .= $cc1.$cc2; |
|
6521 | 6519 | } |
6522 | 6520 | |
6523 | 6521 | return $buf; |
@@ -6578,7 +6576,7 @@ discard block |
||
6578 | 6576 | $cleanUtf8 |
6579 | 6577 | ); |
6580 | 6578 | |
6581 | - return $strPartOne . $strPartTwo; |
|
6579 | + return $strPartOne.$strPartTwo; |
|
6582 | 6580 | } |
6583 | 6581 | |
6584 | 6582 | /** |
@@ -6623,7 +6621,7 @@ discard block |
||
6623 | 6621 | $str = self::clean($str); |
6624 | 6622 | } |
6625 | 6623 | |
6626 | - $usePhpDefaultFunctions = !(bool)($charlist . \implode('', $exceptions)); |
|
6624 | + $usePhpDefaultFunctions = !(bool)($charlist.\implode('', $exceptions)); |
|
6627 | 6625 | |
6628 | 6626 | if ( |
6629 | 6627 | $usePhpDefaultFunctions === true |
@@ -7125,7 +7123,7 @@ discard block |
||
7125 | 7123 | return ''; |
7126 | 7124 | } |
7127 | 7125 | |
7128 | - \preg_match('/^\s*+(?:\S++\s*+){1,' . $limit . '}/u', $str, $matches); |
|
7126 | + \preg_match('/^\s*+(?:\S++\s*+){1,'.$limit.'}/u', $str, $matches); |
|
7129 | 7127 | |
7130 | 7128 | if ( |
7131 | 7129 | !isset($matches[0]) |
@@ -7135,7 +7133,7 @@ discard block |
||
7135 | 7133 | return $str; |
7136 | 7134 | } |
7137 | 7135 | |
7138 | - return self::rtrim($matches[0]) . $strAddOn; |
|
7136 | + return self::rtrim($matches[0]).$strAddOn; |
|
7139 | 7137 | } |
7140 | 7138 | |
7141 | 7139 | /** |
@@ -7200,7 +7198,7 @@ discard block |
||
7200 | 7198 | $strReturn .= $break; |
7201 | 7199 | } |
7202 | 7200 | |
7203 | - return $strReturn . \implode('', $chars); |
|
7201 | + return $strReturn.\implode('', $chars); |
|
7204 | 7202 | } |
7205 | 7203 | |
7206 | 7204 | /** |