@@ -217,6 +217,6 @@ |
||
| 217 | 217 | ), |
| 218 | 218 | ); |
| 219 | 219 | |
| 220 | -$result =& $data; |
|
| 220 | +$result = & $data; |
|
| 221 | 221 | unset($data); |
| 222 | 222 | return $result; |
@@ -89,7 +89,7 @@ discard block |
||
| 89 | 89 | if (!preg_match('//u', urldecode($uri))) { |
| 90 | 90 | $uri = preg_replace_callback( |
| 91 | 91 | '/[\x80-\xFF]+/', |
| 92 | - function ($m) { |
|
| 92 | + function($m) { |
|
| 93 | 93 | return urlencode($m[0]); |
| 94 | 94 | }, |
| 95 | 95 | $uri |
@@ -97,7 +97,7 @@ discard block |
||
| 97 | 97 | |
| 98 | 98 | $uri = preg_replace_callback( |
| 99 | 99 | '/(?:%[89A-F][0-9A-F])+/i', |
| 100 | - function ($m) { |
|
| 100 | + function($m) { |
|
| 101 | 101 | return urlencode(UTF8::encode('UTF-8', urldecode($m[0]))); |
| 102 | 102 | }, |
| 103 | 103 | $uri |
@@ -107,8 +107,8 @@ discard block |
||
| 107 | 107 | // Use ob_start() to buffer content and avoid problem of headers already sent... |
| 108 | 108 | if (headers_sent() === false) { |
| 109 | 109 | $severProtocol = (isset($_SERVER['SERVER_PROTOCOL']) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.1'); |
| 110 | - header($severProtocol . ' 301 Moved Permanently'); |
|
| 111 | - header('Location: ' . $uri); |
|
| 110 | + header($severProtocol.' 301 Moved Permanently'); |
|
| 111 | + header('Location: '.$uri); |
|
| 112 | 112 | exit(); |
| 113 | 113 | } |
| 114 | 114 | } |
@@ -2397,7 +2397,7 @@ discard block |
||
| 2397 | 2397 | /** |
| 2398 | 2398 | * Check if the input is binary... (is look like a hack). |
| 2399 | 2399 | * |
| 2400 | - * @param mixed $input |
|
| 2400 | + * @param string $input |
|
| 2401 | 2401 | * |
| 2402 | 2402 | * @return bool |
| 2403 | 2403 | */ |
@@ -4409,7 +4409,7 @@ discard block |
||
| 4409 | 4409 | * @param string $encoding [optional] <p>Set the charset for e.g. "\mb_" function.</p> |
| 4410 | 4410 | * @param boolean $cleanUtf8 [optional] <p>Clean non UTF-8 chars from the string.</p> |
| 4411 | 4411 | * |
| 4412 | - * @return int|false <p> |
|
| 4412 | + * @return string <p> |
|
| 4413 | 4413 | * The numeric position of the first occurrence of needle in the haystack string.<br /> |
| 4414 | 4414 | * If needle is not found it returns false. |
| 4415 | 4415 | * </p> |
@@ -4618,7 +4618,7 @@ discard block |
||
| 4618 | 4618 | * @link http://php.net/manual/en/function.mb-strrpos.php |
| 4619 | 4619 | * |
| 4620 | 4620 | * @param string $haystack <p>The string being checked, for the last occurrence of needle</p> |
| 4621 | - * @param string|int $needle <p>The string to find in haystack.<br />Or a code point as int.</p> |
|
| 4621 | + * @param string $needle <p>The string to find in haystack.<br />Or a code point as int.</p> |
|
| 4622 | 4622 | * @param int $offset [optional] <p>May be specified to begin searching an arbitrary number of characters |
| 4623 | 4623 | * into the string. Negative values will stop searching at an arbitrary point prior to |
| 4624 | 4624 | * the end of the string. |
@@ -5360,7 +5360,7 @@ discard block |
||
| 5360 | 5360 | * 2) when any of these: àáâãäåæçèéêëìíîï are followed by TWO chars from group B, |
| 5361 | 5361 | * 3) when any of these: ðñòó are followed by THREE chars from group B. |
| 5362 | 5362 | * |
| 5363 | - * @param string|string[] $str <p>Any string or array.</p> |
|
| 5363 | + * @param string $str <p>Any string or array.</p> |
|
| 5364 | 5364 | * |
| 5365 | 5365 | * @return string|string[] <p>The UTF-8 encoded string.</p> |
| 5366 | 5366 | */ |
@@ -932,20 +932,20 @@ |
||
| 932 | 932 | |
| 933 | 933 | if ($code_point <= 0x7ff) { |
| 934 | 934 | return $cache[$code_point] = chr(0xc0 | ($code_point >> 6)) . |
| 935 | - chr(0x80 | ($code_point & 0x3f)); |
|
| 935 | + chr(0x80 | ($code_point & 0x3f)); |
|
| 936 | 936 | } |
| 937 | 937 | |
| 938 | 938 | if ($code_point <= 0xffff) { |
| 939 | 939 | return $cache[$code_point] = chr(0xe0 | ($code_point >> 12)) . |
| 940 | - chr(0x80 | (($code_point >> 6) & 0x3f)) . |
|
| 941 | - chr(0x80 | ($code_point & 0x3f)); |
|
| 940 | + chr(0x80 | (($code_point >> 6) & 0x3f)) . |
|
| 941 | + chr(0x80 | ($code_point & 0x3f)); |
|
| 942 | 942 | } |
| 943 | 943 | |
| 944 | 944 | if ($code_point <= 0x10ffff) { |
| 945 | 945 | return $cache[$code_point] = chr(0xf0 | ($code_point >> 18)) . |
| 946 | - chr(0x80 | (($code_point >> 12) & 0x3f)) . |
|
| 947 | - chr(0x80 | (($code_point >> 6) & 0x3f)) . |
|
| 948 | - chr(0x80 | ($code_point & 0x3f)); |
|
| 946 | + chr(0x80 | (($code_point >> 12) & 0x3f)) . |
|
| 947 | + chr(0x80 | (($code_point >> 6) & 0x3f)) . |
|
| 948 | + chr(0x80 | ($code_point & 0x3f)); |
|
| 949 | 949 | } |
| 950 | 950 | |
| 951 | 951 | # U+FFFD REPLACEMENT CHARACTER |
@@ -834,7 +834,7 @@ discard block |
||
| 834 | 834 | public static function add_bom_to_string($str) |
| 835 | 835 | { |
| 836 | 836 | if (self::string_has_bom($str) === false) { |
| 837 | - $str = self::bom() . $str; |
|
| 837 | + $str = self::bom().$str; |
|
| 838 | 838 | } |
| 839 | 839 | |
| 840 | 840 | return $str; |
@@ -931,20 +931,20 @@ discard block |
||
| 931 | 931 | } |
| 932 | 932 | |
| 933 | 933 | if ($code_point <= 0x7ff) { |
| 934 | - return $cache[$code_point] = chr(0xc0 | ($code_point >> 6)) . |
|
| 934 | + return $cache[$code_point] = chr(0xc0 | ($code_point >> 6)). |
|
| 935 | 935 | chr(0x80 | ($code_point & 0x3f)); |
| 936 | 936 | } |
| 937 | 937 | |
| 938 | 938 | if ($code_point <= 0xffff) { |
| 939 | - return $cache[$code_point] = chr(0xe0 | ($code_point >> 12)) . |
|
| 940 | - chr(0x80 | (($code_point >> 6) & 0x3f)) . |
|
| 939 | + return $cache[$code_point] = chr(0xe0 | ($code_point >> 12)). |
|
| 940 | + chr(0x80 | (($code_point >> 6) & 0x3f)). |
|
| 941 | 941 | chr(0x80 | ($code_point & 0x3f)); |
| 942 | 942 | } |
| 943 | 943 | |
| 944 | 944 | if ($code_point <= 0x10ffff) { |
| 945 | - return $cache[$code_point] = chr(0xf0 | ($code_point >> 18)) . |
|
| 946 | - chr(0x80 | (($code_point >> 12) & 0x3f)) . |
|
| 947 | - chr(0x80 | (($code_point >> 6) & 0x3f)) . |
|
| 945 | + return $cache[$code_point] = chr(0xf0 | ($code_point >> 18)). |
|
| 946 | + chr(0x80 | (($code_point >> 12) & 0x3f)). |
|
| 947 | + chr(0x80 | (($code_point >> 6) & 0x3f)). |
|
| 948 | 948 | chr(0x80 | ($code_point & 0x3f)); |
| 949 | 949 | } |
| 950 | 950 | |
@@ -1194,7 +1194,7 @@ discard block |
||
| 1194 | 1194 | public static function decimal_to_chr($code) |
| 1195 | 1195 | { |
| 1196 | 1196 | return \mb_convert_encoding( |
| 1197 | - '&#x' . dechex($code) . ';', |
|
| 1197 | + '&#x'.dechex($code).';', |
|
| 1198 | 1198 | 'UTF-8', |
| 1199 | 1199 | 'HTML-ENTITIES' |
| 1200 | 1200 | ); |
@@ -1458,7 +1458,7 @@ discard block |
||
| 1458 | 1458 | ) { |
| 1459 | 1459 | // Prevent leading combining chars |
| 1460 | 1460 | // for NFC-safe concatenations. |
| 1461 | - $var = $leading_combining . $var; |
|
| 1461 | + $var = $leading_combining.$var; |
|
| 1462 | 1462 | } |
| 1463 | 1463 | } |
| 1464 | 1464 | break; |
@@ -1751,7 +1751,7 @@ discard block |
||
| 1751 | 1751 | */ |
| 1752 | 1752 | private static function getData($file) |
| 1753 | 1753 | { |
| 1754 | - $file = __DIR__ . '/data/' . $file . '.php'; |
|
| 1754 | + $file = __DIR__.'/data/'.$file.'.php'; |
|
| 1755 | 1755 | if (file_exists($file)) { |
| 1756 | 1756 | /** @noinspection PhpIncludeInspection */ |
| 1757 | 1757 | return require $file; |
@@ -1846,7 +1846,7 @@ discard block |
||
| 1846 | 1846 | |
| 1847 | 1847 | return implode( |
| 1848 | 1848 | array_map( |
| 1849 | - function ($data) use ($keepAsciiChars) { |
|
| 1849 | + function($data) use ($keepAsciiChars) { |
|
| 1850 | 1850 | return UTF8::single_chr_html_encode($data, $keepAsciiChars); |
| 1851 | 1851 | }, |
| 1852 | 1852 | self::split($str) |
@@ -1964,7 +1964,7 @@ discard block |
||
| 1964 | 1964 | |
| 1965 | 1965 | $str = preg_replace_callback( |
| 1966 | 1966 | "/&#\d{2,5};/", |
| 1967 | - function ($matches) use ($encoding) { |
|
| 1967 | + function($matches) use ($encoding) { |
|
| 1968 | 1968 | $returnTmp = \mb_convert_encoding($matches[0], $encoding, 'HTML-ENTITIES'); |
| 1969 | 1969 | |
| 1970 | 1970 | if ($returnTmp !== '"' && $returnTmp !== "'") { |
@@ -2263,9 +2263,9 @@ discard block |
||
| 2263 | 2263 | if (ctype_digit((string)$int)) { |
| 2264 | 2264 | $hex = dechex((int)$int); |
| 2265 | 2265 | |
| 2266 | - $hex = (strlen($hex) < 4 ? substr('0000' . $hex, -4) : $hex); |
|
| 2266 | + $hex = (strlen($hex) < 4 ? substr('0000'.$hex, -4) : $hex); |
|
| 2267 | 2267 | |
| 2268 | - return $pfix . $hex; |
|
| 2268 | + return $pfix.$hex; |
|
| 2269 | 2269 | } |
| 2270 | 2270 | |
| 2271 | 2271 | return ''; |
@@ -2951,7 +2951,7 @@ discard block |
||
| 2951 | 2951 | */ |
| 2952 | 2952 | public static function lcfirst($str) |
| 2953 | 2953 | { |
| 2954 | - return self::strtolower(self::substr($str, 0, 1)) . self::substr($str, 1); |
|
| 2954 | + return self::strtolower(self::substr($str, 0, 1)).self::substr($str, 1); |
|
| 2955 | 2955 | } |
| 2956 | 2956 | |
| 2957 | 2957 | /** |
@@ -3401,7 +3401,7 @@ discard block |
||
| 3401 | 3401 | |
| 3402 | 3402 | if (is_array($what)) { |
| 3403 | 3403 | foreach ($what as $item) { |
| 3404 | - $str = preg_replace('/(' . preg_quote($item, '/') . ')+/', $item, $str); |
|
| 3404 | + $str = preg_replace('/('.preg_quote($item, '/').')+/', $item, $str); |
|
| 3405 | 3405 | } |
| 3406 | 3406 | } |
| 3407 | 3407 | |
@@ -3503,7 +3503,7 @@ discard block |
||
| 3503 | 3503 | { |
| 3504 | 3504 | static $rxClassCache = array(); |
| 3505 | 3505 | |
| 3506 | - $cacheKey = $s . $class; |
|
| 3506 | + $cacheKey = $s.$class; |
|
| 3507 | 3507 | |
| 3508 | 3508 | if (isset($rxClassCache[$cacheKey])) { |
| 3509 | 3509 | return $rxClassCache[$cacheKey]; |
@@ -3514,7 +3514,7 @@ discard block |
||
| 3514 | 3514 | /** @noinspection SuspiciousLoopInspection */ |
| 3515 | 3515 | foreach (self::str_split($s) as $s) { |
| 3516 | 3516 | if ('-' === $s) { |
| 3517 | - $class[0] = '-' . $class[0]; |
|
| 3517 | + $class[0] = '-'.$class[0]; |
|
| 3518 | 3518 | } elseif (!isset($s[2])) { |
| 3519 | 3519 | $class[0] .= preg_quote($s, '/'); |
| 3520 | 3520 | } elseif (1 === self::strlen($s)) { |
@@ -3525,13 +3525,13 @@ discard block |
||
| 3525 | 3525 | } |
| 3526 | 3526 | |
| 3527 | 3527 | if ($class[0]) { |
| 3528 | - $class[0] = '[' . $class[0] . ']'; |
|
| 3528 | + $class[0] = '['.$class[0].']'; |
|
| 3529 | 3529 | } |
| 3530 | 3530 | |
| 3531 | 3531 | if (1 === count($class)) { |
| 3532 | 3532 | $return = $class[0]; |
| 3533 | 3533 | } else { |
| 3534 | - $return = '(?:' . implode('|', $class) . ')'; |
|
| 3534 | + $return = '(?:'.implode('|', $class).')'; |
|
| 3535 | 3535 | } |
| 3536 | 3536 | |
| 3537 | 3537 | $rxClassCache[$cacheKey] = $return; |
@@ -3545,7 +3545,7 @@ discard block |
||
| 3545 | 3545 | public static function showSupport() |
| 3546 | 3546 | { |
| 3547 | 3547 | foreach (self::$support as $utf8Support) { |
| 3548 | - echo $utf8Support . "\n<br>"; |
|
| 3548 | + echo $utf8Support."\n<br>"; |
|
| 3549 | 3549 | } |
| 3550 | 3550 | } |
| 3551 | 3551 | |
@@ -3571,7 +3571,7 @@ discard block |
||
| 3571 | 3571 | return $char; |
| 3572 | 3572 | } |
| 3573 | 3573 | |
| 3574 | - return '&#' . self::ord($char) . ';'; |
|
| 3574 | + return '&#'.self::ord($char).';'; |
|
| 3575 | 3575 | } |
| 3576 | 3576 | |
| 3577 | 3577 | /** |
@@ -3623,19 +3623,19 @@ discard block |
||
| 3623 | 3623 | $ret[] = $str[$i]; |
| 3624 | 3624 | } elseif ((($str[$i] & "\xE0") === "\xC0") && isset($str[$i + 1])) { |
| 3625 | 3625 | if (($str[$i + 1] & "\xC0") === "\x80") { |
| 3626 | - $ret[] = $str[$i] . $str[$i + 1]; |
|
| 3626 | + $ret[] = $str[$i].$str[$i + 1]; |
|
| 3627 | 3627 | |
| 3628 | 3628 | $i++; |
| 3629 | 3629 | } |
| 3630 | 3630 | } elseif ((($str[$i] & "\xF0") === "\xE0") && isset($str[$i + 2])) { |
| 3631 | 3631 | if ((($str[$i + 1] & "\xC0") === "\x80") && (($str[$i + 2] & "\xC0") === "\x80")) { |
| 3632 | - $ret[] = $str[$i] . $str[$i + 1] . $str[$i + 2]; |
|
| 3632 | + $ret[] = $str[$i].$str[$i + 1].$str[$i + 2]; |
|
| 3633 | 3633 | |
| 3634 | 3634 | $i += 2; |
| 3635 | 3635 | } |
| 3636 | 3636 | } elseif ((($str[$i] & "\xF8") === "\xF0") && isset($str[$i + 3])) { |
| 3637 | 3637 | if ((($str[$i + 1] & "\xC0") === "\x80") && (($str[$i + 2] & "\xC0") === "\x80") && (($str[$i + 3] & "\xC0") === "\x80")) { |
| 3638 | - $ret[] = $str[$i] . $str[$i + 1] . $str[$i + 2] . $str[$i + 3]; |
|
| 3638 | + $ret[] = $str[$i].$str[$i + 1].$str[$i + 2].$str[$i + 3]; |
|
| 3639 | 3639 | |
| 3640 | 3640 | $i += 3; |
| 3641 | 3641 | } |
@@ -3784,7 +3784,7 @@ discard block |
||
| 3784 | 3784 | if ('' === $s .= '') { |
| 3785 | 3785 | $s = '/^(?<=.)$/'; |
| 3786 | 3786 | } else { |
| 3787 | - $s = '/' . preg_quote($s, '/') . '/ui'; |
|
| 3787 | + $s = '/'.preg_quote($s, '/').'/ui'; |
|
| 3788 | 3788 | } |
| 3789 | 3789 | } |
| 3790 | 3790 | |
@@ -3818,7 +3818,7 @@ discard block |
||
| 3818 | 3818 | } |
| 3819 | 3819 | |
| 3820 | 3820 | if (self::substr($str, $length - 1, 1) === ' ') { |
| 3821 | - return self::substr($str, 0, $length - 1) . $strAddOn; |
|
| 3821 | + return self::substr($str, 0, $length - 1).$strAddOn; |
|
| 3822 | 3822 | } |
| 3823 | 3823 | |
| 3824 | 3824 | $str = self::substr($str, 0, $length); |
@@ -3827,9 +3827,9 @@ discard block |
||
| 3827 | 3827 | $new_str = implode(' ', $array); |
| 3828 | 3828 | |
| 3829 | 3829 | if ($new_str === '') { |
| 3830 | - $str = self::substr($str, 0, $length - 1) . $strAddOn; |
|
| 3830 | + $str = self::substr($str, 0, $length - 1).$strAddOn; |
|
| 3831 | 3831 | } else { |
| 3832 | - $str = $new_str . $strAddOn; |
|
| 3832 | + $str = $new_str.$strAddOn; |
|
| 3833 | 3833 | } |
| 3834 | 3834 | |
| 3835 | 3835 | return $str; |
@@ -3884,7 +3884,7 @@ discard block |
||
| 3884 | 3884 | $pre = ''; |
| 3885 | 3885 | } |
| 3886 | 3886 | |
| 3887 | - return $pre . $str . $post; |
|
| 3887 | + return $pre.$str.$post; |
|
| 3888 | 3888 | } |
| 3889 | 3889 | |
| 3890 | 3890 | return $str; |
@@ -4013,7 +4013,7 @@ discard block |
||
| 4013 | 4013 | return str_split($str, $len); |
| 4014 | 4014 | } |
| 4015 | 4015 | |
| 4016 | - preg_match_all('/' . Grapheme::GRAPHEME_CLUSTER_RX . '/u', $str, $a); |
|
| 4016 | + preg_match_all('/'.Grapheme::GRAPHEME_CLUSTER_RX.'/u', $str, $a); |
|
| 4017 | 4017 | $a = $a[0]; |
| 4018 | 4018 | |
| 4019 | 4019 | if ($len === 1) { |
@@ -4163,7 +4163,7 @@ discard block |
||
| 4163 | 4163 | */ |
| 4164 | 4164 | public static function strcmp($str1, $str2) |
| 4165 | 4165 | { |
| 4166 | - return $str1 . '' === $str2 . '' ? 0 : strcmp( |
|
| 4166 | + return $str1.'' === $str2.'' ? 0 : strcmp( |
|
| 4167 | 4167 | \Normalizer::normalize($str1, \Normalizer::NFD), |
| 4168 | 4168 | \Normalizer::normalize($str2, \Normalizer::NFD) |
| 4169 | 4169 | ); |
@@ -4194,7 +4194,7 @@ discard block |
||
| 4194 | 4194 | return null; |
| 4195 | 4195 | } |
| 4196 | 4196 | |
| 4197 | - if (preg_match('/^(.*?)' . self::rxClass($charList) . '/us', $str, $length)) { |
|
| 4197 | + if (preg_match('/^(.*?)'.self::rxClass($charList).'/us', $str, $length)) { |
|
| 4198 | 4198 | /** @noinspection OffsetOperationsInspection */ |
| 4199 | 4199 | return self::strlen($length[1]); |
| 4200 | 4200 | } |
@@ -4448,7 +4448,7 @@ discard block |
||
| 4448 | 4448 | */ |
| 4449 | 4449 | public static function strnatcmp($str1, $str2) |
| 4450 | 4450 | { |
| 4451 | - return $str1 . '' === $str2 . '' ? 0 : strnatcmp(self::strtonatfold($str1), self::strtonatfold($str2)); |
|
| 4451 | + return $str1.'' === $str2.'' ? 0 : strnatcmp(self::strtonatfold($str1), self::strtonatfold($str2)); |
|
| 4452 | 4452 | } |
| 4453 | 4453 | |
| 4454 | 4454 | /** |
@@ -4509,7 +4509,7 @@ discard block |
||
| 4509 | 4509 | return false; |
| 4510 | 4510 | } |
| 4511 | 4511 | |
| 4512 | - if (preg_match('/' . self::rxClass($char_list) . '/us', $haystack, $m)) { |
|
| 4512 | + if (preg_match('/'.self::rxClass($char_list).'/us', $haystack, $m)) { |
|
| 4513 | 4513 | return substr($haystack, strpos($haystack, $m[0])); |
| 4514 | 4514 | } else { |
| 4515 | 4515 | return false; |
@@ -4821,7 +4821,7 @@ discard block |
||
| 4821 | 4821 | return 0; |
| 4822 | 4822 | } |
| 4823 | 4823 | |
| 4824 | - return preg_match('/^' . self::rxClass($mask) . '+/u', $str, $str) ? self::strlen($str[0]) : 0; |
|
| 4824 | + return preg_match('/^'.self::rxClass($mask).'+/u', $str, $str) ? self::strlen($str[0]) : 0; |
|
| 4825 | 4825 | } |
| 4826 | 4826 | |
| 4827 | 4827 | /** |
@@ -5293,7 +5293,7 @@ discard block |
||
| 5293 | 5293 | |
| 5294 | 5294 | $strSwappedCase = preg_replace_callback( |
| 5295 | 5295 | '/[\S]/u', |
| 5296 | - function ($match) use ($encoding) { |
|
| 5296 | + function($match) use ($encoding) { |
|
| 5297 | 5297 | $marchToUpper = UTF8::strtoupper($match[0], $encoding); |
| 5298 | 5298 | |
| 5299 | 5299 | if ($match[0] === $marchToUpper) { |
@@ -5475,7 +5475,7 @@ discard block |
||
| 5475 | 5475 | |
| 5476 | 5476 | $bank = $ord >> 8; |
| 5477 | 5477 | if (!array_key_exists($bank, (array)$UTF8_TO_ASCII)) { |
| 5478 | - $bankfile = __DIR__ . '/data/' . sprintf('x%02x', $bank) . '.php'; |
|
| 5478 | + $bankfile = __DIR__.'/data/'.sprintf('x%02x', $bank).'.php'; |
|
| 5479 | 5479 | if (file_exists($bankfile)) { |
| 5480 | 5480 | /** @noinspection PhpIncludeInspection */ |
| 5481 | 5481 | require $bankfile; |
@@ -5594,40 +5594,40 @@ discard block |
||
| 5594 | 5594 | if ($c1 >= "\xc0" & $c1 <= "\xdf") { // looks like 2 bytes UTF8 |
| 5595 | 5595 | |
| 5596 | 5596 | if ($c2 >= "\x80" && $c2 <= "\xbf") { // yeah, almost sure it's UTF8 already |
| 5597 | - $buf .= $c1 . $c2; |
|
| 5597 | + $buf .= $c1.$c2; |
|
| 5598 | 5598 | $i++; |
| 5599 | 5599 | } else { // not valid UTF8 - convert it |
| 5600 | 5600 | $cc1 = (chr(ord($c1) / 64) | "\xc0"); |
| 5601 | 5601 | $cc2 = ($c1 & "\x3f") | "\x80"; |
| 5602 | - $buf .= $cc1 . $cc2; |
|
| 5602 | + $buf .= $cc1.$cc2; |
|
| 5603 | 5603 | } |
| 5604 | 5604 | |
| 5605 | 5605 | } elseif ($c1 >= "\xe0" & $c1 <= "\xef") { // looks like 3 bytes UTF8 |
| 5606 | 5606 | |
| 5607 | 5607 | if ($c2 >= "\x80" && $c2 <= "\xbf" && $c3 >= "\x80" && $c3 <= "\xbf") { // yeah, almost sure it's UTF8 already |
| 5608 | - $buf .= $c1 . $c2 . $c3; |
|
| 5608 | + $buf .= $c1.$c2.$c3; |
|
| 5609 | 5609 | $i += 2; |
| 5610 | 5610 | } else { // not valid UTF8 - convert it |
| 5611 | 5611 | $cc1 = (chr(ord($c1) / 64) | "\xc0"); |
| 5612 | 5612 | $cc2 = ($c1 & "\x3f") | "\x80"; |
| 5613 | - $buf .= $cc1 . $cc2; |
|
| 5613 | + $buf .= $cc1.$cc2; |
|
| 5614 | 5614 | } |
| 5615 | 5615 | |
| 5616 | 5616 | } elseif ($c1 >= "\xf0" & $c1 <= "\xf7") { // looks like 4 bytes UTF8 |
| 5617 | 5617 | |
| 5618 | 5618 | if ($c2 >= "\x80" && $c2 <= "\xbf" && $c3 >= "\x80" && $c3 <= "\xbf" && $c4 >= "\x80" && $c4 <= "\xbf") { // yeah, almost sure it's UTF8 already |
| 5619 | - $buf .= $c1 . $c2 . $c3 . $c4; |
|
| 5619 | + $buf .= $c1.$c2.$c3.$c4; |
|
| 5620 | 5620 | $i += 3; |
| 5621 | 5621 | } else { // not valid UTF8 - convert it |
| 5622 | 5622 | $cc1 = (chr(ord($c1) / 64) | "\xc0"); |
| 5623 | 5623 | $cc2 = ($c1 & "\x3f") | "\x80"; |
| 5624 | - $buf .= $cc1 . $cc2; |
|
| 5624 | + $buf .= $cc1.$cc2; |
|
| 5625 | 5625 | } |
| 5626 | 5626 | |
| 5627 | 5627 | } else { // doesn't look like UTF8, but should be converted |
| 5628 | 5628 | $cc1 = (chr(ord($c1) / 64) | "\xc0"); |
| 5629 | 5629 | $cc2 = (($c1 & "\x3f") | "\x80"); |
| 5630 | - $buf .= $cc1 . $cc2; |
|
| 5630 | + $buf .= $cc1.$cc2; |
|
| 5631 | 5631 | } |
| 5632 | 5632 | |
| 5633 | 5633 | } elseif (($c1 & "\xc0") === "\x80") { // needs conversion |
@@ -5638,7 +5638,7 @@ discard block |
||
| 5638 | 5638 | } else { |
| 5639 | 5639 | $cc1 = (chr($ordC1 / 64) | "\xc0"); |
| 5640 | 5640 | $cc2 = (($c1 & "\x3f") | "\x80"); |
| 5641 | - $buf .= $cc1 . $cc2; |
|
| 5641 | + $buf .= $cc1.$cc2; |
|
| 5642 | 5642 | } |
| 5643 | 5643 | |
| 5644 | 5644 | } else { // it doesn't need conversion |
@@ -5649,7 +5649,7 @@ discard block |
||
| 5649 | 5649 | // decode unicode escape sequences |
| 5650 | 5650 | $buf = preg_replace_callback( |
| 5651 | 5651 | '/\\\\u([0-9a-f]{4})/i', |
| 5652 | - function ($match) { |
|
| 5652 | + function($match) { |
|
| 5653 | 5653 | return \mb_convert_encoding(pack('H*', $match[1]), 'UTF-8', 'UCS-2BE'); |
| 5654 | 5654 | }, |
| 5655 | 5655 | $buf |
@@ -5658,7 +5658,7 @@ discard block |
||
| 5658 | 5658 | // decode UTF-8 codepoints |
| 5659 | 5659 | $buf = preg_replace_callback( |
| 5660 | 5660 | '/&#\d{2,4};/', |
| 5661 | - function ($match) { |
|
| 5661 | + function($match) { |
|
| 5662 | 5662 | return \mb_convert_encoding($match[0], 'UTF-8', 'HTML-ENTITIES'); |
| 5663 | 5663 | }, |
| 5664 | 5664 | $buf |
@@ -5707,7 +5707,7 @@ discard block |
||
| 5707 | 5707 | */ |
| 5708 | 5708 | public static function ucfirst($str, $encoding = 'UTF-8', $cleanUtf8 = false) |
| 5709 | 5709 | { |
| 5710 | - return self::strtoupper(self::substr($str, 0, 1, $encoding, $cleanUtf8), $encoding, $cleanUtf8) . self::substr($str, 1, null, $encoding, $cleanUtf8); |
|
| 5710 | + return self::strtoupper(self::substr($str, 0, 1, $encoding, $cleanUtf8), $encoding, $cleanUtf8).self::substr($str, 1, null, $encoding, $cleanUtf8); |
|
| 5711 | 5711 | } |
| 5712 | 5712 | |
| 5713 | 5713 | /** |
@@ -6165,7 +6165,7 @@ discard block |
||
| 6165 | 6165 | return ''; |
| 6166 | 6166 | } |
| 6167 | 6167 | |
| 6168 | - preg_match('/^\s*+(?:\S++\s*+){1,' . $words . '}/u', $str, $matches); |
|
| 6168 | + preg_match('/^\s*+(?:\S++\s*+){1,'.$words.'}/u', $str, $matches); |
|
| 6169 | 6169 | |
| 6170 | 6170 | if ( |
| 6171 | 6171 | !isset($matches[0]) |
@@ -6175,7 +6175,7 @@ discard block |
||
| 6175 | 6175 | return $str; |
| 6176 | 6176 | } |
| 6177 | 6177 | |
| 6178 | - return self::rtrim($matches[0]) . $strAddOn; |
|
| 6178 | + return self::rtrim($matches[0]).$strAddOn; |
|
| 6179 | 6179 | } |
| 6180 | 6180 | |
| 6181 | 6181 | /** |
@@ -6243,7 +6243,7 @@ discard block |
||
| 6243 | 6243 | $strReturn .= $break; |
| 6244 | 6244 | } |
| 6245 | 6245 | |
| 6246 | - return $strReturn . implode('', $chars); |
|
| 6246 | + return $strReturn.implode('', $chars); |
|
| 6247 | 6247 | } |
| 6248 | 6248 | |
| 6249 | 6249 | /** |