@@ -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 | */ |
@@ -933,16 +933,16 @@ |
||
| 933 | 933 | $str = chr($code_point); |
| 934 | 934 | } elseif (0x800 > $code_point) { |
| 935 | 935 | $str = chr(0xC0 | $code_point >> 6) . |
| 936 | - chr(0x80 | $code_point & 0x3F); |
|
| 936 | + chr(0x80 | $code_point & 0x3F); |
|
| 937 | 937 | } elseif (0x10000 > $code_point) { |
| 938 | 938 | $str = chr(0xE0 | $code_point >> 12) . |
| 939 | - chr(0x80 | $code_point >> 6 & 0x3F) . |
|
| 940 | - chr(0x80 | $code_point & 0x3F); |
|
| 939 | + chr(0x80 | $code_point >> 6 & 0x3F) . |
|
| 940 | + chr(0x80 | $code_point & 0x3F); |
|
| 941 | 941 | } else { |
| 942 | 942 | $str = chr(0xF0 | $code_point >> 18) . |
| 943 | - chr(0x80 | $code_point >> 12 & 0x3F) . |
|
| 944 | - chr(0x80 | $code_point >> 6 & 0x3F) . |
|
| 945 | - chr(0x80 | $code_point & 0x3F); |
|
| 943 | + chr(0x80 | $code_point >> 12 & 0x3F) . |
|
| 944 | + chr(0x80 | $code_point >> 6 & 0x3F) . |
|
| 945 | + chr(0x80 | $code_point & 0x3F); |
|
| 946 | 946 | } |
| 947 | 947 | |
| 948 | 948 | if ($encoding !== 'UTF-8') { |
@@ -839,7 +839,7 @@ discard block |
||
| 839 | 839 | public static function add_bom_to_string($str) |
| 840 | 840 | { |
| 841 | 841 | if (self::string_has_bom($str) === false) { |
| 842 | - $str = self::bom() . $str; |
|
| 842 | + $str = self::bom().$str; |
|
| 843 | 843 | } |
| 844 | 844 | |
| 845 | 845 | return $str; |
@@ -938,7 +938,7 @@ discard block |
||
| 938 | 938 | |
| 939 | 939 | // use static cache, if there is no support for "IntlChar" |
| 940 | 940 | static $cache = array(); |
| 941 | - $cacheKey = $code_point . $encoding; |
|
| 941 | + $cacheKey = $code_point.$encoding; |
|
| 942 | 942 | if (isset($cache[$cacheKey]) === true) { |
| 943 | 943 | return $cache[$cacheKey]; |
| 944 | 944 | } |
@@ -946,16 +946,16 @@ discard block |
||
| 946 | 946 | if (0x80 > $code_point %= 0x200000) { |
| 947 | 947 | $str = chr($code_point); |
| 948 | 948 | } elseif (0x800 > $code_point) { |
| 949 | - $str = chr(0xC0 | $code_point >> 6) . |
|
| 949 | + $str = chr(0xC0 | $code_point >> 6). |
|
| 950 | 950 | chr(0x80 | $code_point & 0x3F); |
| 951 | 951 | } elseif (0x10000 > $code_point) { |
| 952 | - $str = chr(0xE0 | $code_point >> 12) . |
|
| 953 | - chr(0x80 | $code_point >> 6 & 0x3F) . |
|
| 952 | + $str = chr(0xE0 | $code_point >> 12). |
|
| 953 | + chr(0x80 | $code_point >> 6 & 0x3F). |
|
| 954 | 954 | chr(0x80 | $code_point & 0x3F); |
| 955 | 955 | } else { |
| 956 | - $str = chr(0xF0 | $code_point >> 18) . |
|
| 957 | - chr(0x80 | $code_point >> 12 & 0x3F) . |
|
| 958 | - chr(0x80 | $code_point >> 6 & 0x3F) . |
|
| 956 | + $str = chr(0xF0 | $code_point >> 18). |
|
| 957 | + chr(0x80 | $code_point >> 12 & 0x3F). |
|
| 958 | + chr(0x80 | $code_point >> 6 & 0x3F). |
|
| 959 | 959 | chr(0x80 | $code_point & 0x3F); |
| 960 | 960 | } |
| 961 | 961 | |
@@ -1211,7 +1211,7 @@ discard block |
||
| 1211 | 1211 | public static function decimal_to_chr($code) |
| 1212 | 1212 | { |
| 1213 | 1213 | return \mb_convert_encoding( |
| 1214 | - '&#x' . dechex($code) . ';', |
|
| 1214 | + '&#x'.dechex($code).';', |
|
| 1215 | 1215 | 'UTF-8', |
| 1216 | 1216 | 'HTML-ENTITIES' |
| 1217 | 1217 | ); |
@@ -1477,7 +1477,7 @@ discard block |
||
| 1477 | 1477 | ) { |
| 1478 | 1478 | // Prevent leading combining chars |
| 1479 | 1479 | // for NFC-safe concatenations. |
| 1480 | - $var = $leading_combining . $var; |
|
| 1480 | + $var = $leading_combining.$var; |
|
| 1481 | 1481 | } |
| 1482 | 1482 | } |
| 1483 | 1483 | break; |
@@ -1895,7 +1895,7 @@ discard block |
||
| 1895 | 1895 | */ |
| 1896 | 1896 | private static function getData($file) |
| 1897 | 1897 | { |
| 1898 | - $file = __DIR__ . '/data/' . $file . '.php'; |
|
| 1898 | + $file = __DIR__.'/data/'.$file.'.php'; |
|
| 1899 | 1899 | if (file_exists($file)) { |
| 1900 | 1900 | /** @noinspection PhpIncludeInspection */ |
| 1901 | 1901 | return require $file; |
@@ -1998,7 +1998,7 @@ discard block |
||
| 1998 | 1998 | return implode( |
| 1999 | 1999 | '', |
| 2000 | 2000 | array_map( |
| 2001 | - function ($data) use ($keepAsciiChars, $encoding) { |
|
| 2001 | + function($data) use ($keepAsciiChars, $encoding) { |
|
| 2002 | 2002 | return UTF8::single_chr_html_encode($data, $keepAsciiChars, $encoding); |
| 2003 | 2003 | }, |
| 2004 | 2004 | self::split($str) |
@@ -2117,7 +2117,7 @@ discard block |
||
| 2117 | 2117 | |
| 2118 | 2118 | $str = preg_replace_callback( |
| 2119 | 2119 | "/&#\d{2,6};/", |
| 2120 | - function ($matches) use ($encoding) { |
|
| 2120 | + function($matches) use ($encoding) { |
|
| 2121 | 2121 | $returnTmp = \mb_convert_encoding($matches[0], $encoding, 'HTML-ENTITIES'); |
| 2122 | 2122 | |
| 2123 | 2123 | if ($returnTmp !== '"' && $returnTmp !== "'") { |
@@ -2426,9 +2426,9 @@ discard block |
||
| 2426 | 2426 | if (ctype_digit((string)$int)) { |
| 2427 | 2427 | $hex = dechex((int)$int); |
| 2428 | 2428 | |
| 2429 | - $hex = (strlen($hex) < 4 ? substr('0000' . $hex, -4) : $hex); |
|
| 2429 | + $hex = (strlen($hex) < 4 ? substr('0000'.$hex, -4) : $hex); |
|
| 2430 | 2430 | |
| 2431 | - return $pfix . $hex; |
|
| 2431 | + return $pfix.$hex; |
|
| 2432 | 2432 | } |
| 2433 | 2433 | |
| 2434 | 2434 | return ''; |
@@ -3114,7 +3114,7 @@ discard block |
||
| 3114 | 3114 | */ |
| 3115 | 3115 | public static function lcfirst($str) |
| 3116 | 3116 | { |
| 3117 | - return self::strtolower(self::substr($str, 0, 1)) . self::substr($str, 1); |
|
| 3117 | + return self::strtolower(self::substr($str, 0, 1)).self::substr($str, 1); |
|
| 3118 | 3118 | } |
| 3119 | 3119 | |
| 3120 | 3120 | /** |
@@ -3138,7 +3138,7 @@ discard block |
||
| 3138 | 3138 | return preg_replace('/^[\pZ\pC]+/u', '', $str); |
| 3139 | 3139 | } |
| 3140 | 3140 | |
| 3141 | - return preg_replace("/^" . self::rxClass($chars) . "+/u", '', $str); |
|
| 3141 | + return preg_replace("/^".self::rxClass($chars)."+/u", '', $str); |
|
| 3142 | 3142 | } |
| 3143 | 3143 | |
| 3144 | 3144 | /** |
@@ -3584,7 +3584,7 @@ discard block |
||
| 3584 | 3584 | if (is_array($what)) { |
| 3585 | 3585 | /** @noinspection ForeachSourceInspection */ |
| 3586 | 3586 | foreach ($what as $item) { |
| 3587 | - $str = preg_replace('/(' . preg_quote($item, '/') . ')+/', $item, $str); |
|
| 3587 | + $str = preg_replace('/('.preg_quote($item, '/').')+/', $item, $str); |
|
| 3588 | 3588 | } |
| 3589 | 3589 | } |
| 3590 | 3590 | |
@@ -3669,7 +3669,7 @@ discard block |
||
| 3669 | 3669 | return preg_replace('/[\pZ\pC]+$/u', '', $str); |
| 3670 | 3670 | } |
| 3671 | 3671 | |
| 3672 | - return preg_replace("/" . self::rxClass($chars) . "+$/u", '', $str); |
|
| 3672 | + return preg_replace("/".self::rxClass($chars)."+$/u", '', $str); |
|
| 3673 | 3673 | } |
| 3674 | 3674 | |
| 3675 | 3675 | /** |
@@ -3684,7 +3684,7 @@ discard block |
||
| 3684 | 3684 | { |
| 3685 | 3685 | static $rxClassCache = array(); |
| 3686 | 3686 | |
| 3687 | - $cacheKey = $s . $class; |
|
| 3687 | + $cacheKey = $s.$class; |
|
| 3688 | 3688 | |
| 3689 | 3689 | if (isset($rxClassCache[$cacheKey])) { |
| 3690 | 3690 | return $rxClassCache[$cacheKey]; |
@@ -3696,7 +3696,7 @@ discard block |
||
| 3696 | 3696 | /** @noinspection SuspiciousLoopInspection */ |
| 3697 | 3697 | foreach (self::str_split($s) as $s) { |
| 3698 | 3698 | if ('-' === $s) { |
| 3699 | - $class[0] = '-' . $class[0]; |
|
| 3699 | + $class[0] = '-'.$class[0]; |
|
| 3700 | 3700 | } elseif (!isset($s[2])) { |
| 3701 | 3701 | $class[0] .= preg_quote($s, '/'); |
| 3702 | 3702 | } elseif (1 === self::strlen($s)) { |
@@ -3707,13 +3707,13 @@ discard block |
||
| 3707 | 3707 | } |
| 3708 | 3708 | |
| 3709 | 3709 | if ($class[0]) { |
| 3710 | - $class[0] = '[' . $class[0] . ']'; |
|
| 3710 | + $class[0] = '['.$class[0].']'; |
|
| 3711 | 3711 | } |
| 3712 | 3712 | |
| 3713 | 3713 | if (1 === count($class)) { |
| 3714 | 3714 | $return = $class[0]; |
| 3715 | 3715 | } else { |
| 3716 | - $return = '(?:' . implode('|', $class) . ')'; |
|
| 3716 | + $return = '(?:'.implode('|', $class).')'; |
|
| 3717 | 3717 | } |
| 3718 | 3718 | |
| 3719 | 3719 | $rxClassCache[$cacheKey] = $return; |
@@ -3727,7 +3727,7 @@ discard block |
||
| 3727 | 3727 | public static function showSupport() |
| 3728 | 3728 | { |
| 3729 | 3729 | foreach (self::$support as $utf8Support) { |
| 3730 | - echo $utf8Support . "\n<br>"; |
|
| 3730 | + echo $utf8Support."\n<br>"; |
|
| 3731 | 3731 | } |
| 3732 | 3732 | } |
| 3733 | 3733 | |
@@ -3761,7 +3761,7 @@ discard block |
||
| 3761 | 3761 | $encoding = self::normalize_encoding($encoding); |
| 3762 | 3762 | } |
| 3763 | 3763 | |
| 3764 | - return '&#' . self::ord($char, $encoding) . ';'; |
|
| 3764 | + return '&#'.self::ord($char, $encoding).';'; |
|
| 3765 | 3765 | } |
| 3766 | 3766 | |
| 3767 | 3767 | /** |
@@ -3813,19 +3813,19 @@ discard block |
||
| 3813 | 3813 | $ret[] = $str[$i]; |
| 3814 | 3814 | } elseif ((($str[$i] & "\xE0") === "\xC0") && isset($str[$i + 1])) { |
| 3815 | 3815 | if (($str[$i + 1] & "\xC0") === "\x80") { |
| 3816 | - $ret[] = $str[$i] . $str[$i + 1]; |
|
| 3816 | + $ret[] = $str[$i].$str[$i + 1]; |
|
| 3817 | 3817 | |
| 3818 | 3818 | $i++; |
| 3819 | 3819 | } |
| 3820 | 3820 | } elseif ((($str[$i] & "\xF0") === "\xE0") && isset($str[$i + 2])) { |
| 3821 | 3821 | if ((($str[$i + 1] & "\xC0") === "\x80") && (($str[$i + 2] & "\xC0") === "\x80")) { |
| 3822 | - $ret[] = $str[$i] . $str[$i + 1] . $str[$i + 2]; |
|
| 3822 | + $ret[] = $str[$i].$str[$i + 1].$str[$i + 2]; |
|
| 3823 | 3823 | |
| 3824 | 3824 | $i += 2; |
| 3825 | 3825 | } |
| 3826 | 3826 | } elseif ((($str[$i] & "\xF8") === "\xF0") && isset($str[$i + 3])) { |
| 3827 | 3827 | if ((($str[$i + 1] & "\xC0") === "\x80") && (($str[$i + 2] & "\xC0") === "\x80") && (($str[$i + 3] & "\xC0") === "\x80")) { |
| 3828 | - $ret[] = $str[$i] . $str[$i + 1] . $str[$i + 2] . $str[$i + 3]; |
|
| 3828 | + $ret[] = $str[$i].$str[$i + 1].$str[$i + 2].$str[$i + 3]; |
|
| 3829 | 3829 | |
| 3830 | 3830 | $i += 3; |
| 3831 | 3831 | } |
@@ -4024,7 +4024,7 @@ discard block |
||
| 4024 | 4024 | if ('' === $s .= '') { |
| 4025 | 4025 | $s = '/^(?<=.)$/'; |
| 4026 | 4026 | } else { |
| 4027 | - $s = '/' . preg_quote($s, '/') . '/ui'; |
|
| 4027 | + $s = '/'.preg_quote($s, '/').'/ui'; |
|
| 4028 | 4028 | } |
| 4029 | 4029 | } |
| 4030 | 4030 | |
@@ -4082,7 +4082,7 @@ discard block |
||
| 4082 | 4082 | } |
| 4083 | 4083 | |
| 4084 | 4084 | if (self::substr($str, $length - 1, 1) === ' ') { |
| 4085 | - return self::substr($str, 0, $length - 1) . $strAddOn; |
|
| 4085 | + return self::substr($str, 0, $length - 1).$strAddOn; |
|
| 4086 | 4086 | } |
| 4087 | 4087 | |
| 4088 | 4088 | $str = self::substr($str, 0, $length); |
@@ -4091,9 +4091,9 @@ discard block |
||
| 4091 | 4091 | $new_str = implode(' ', $array); |
| 4092 | 4092 | |
| 4093 | 4093 | if ($new_str === '') { |
| 4094 | - $str = self::substr($str, 0, $length - 1) . $strAddOn; |
|
| 4094 | + $str = self::substr($str, 0, $length - 1).$strAddOn; |
|
| 4095 | 4095 | } else { |
| 4096 | - $str = $new_str . $strAddOn; |
|
| 4096 | + $str = $new_str.$strAddOn; |
|
| 4097 | 4097 | } |
| 4098 | 4098 | |
| 4099 | 4099 | return $str; |
@@ -4148,7 +4148,7 @@ discard block |
||
| 4148 | 4148 | $pre = ''; |
| 4149 | 4149 | } |
| 4150 | 4150 | |
| 4151 | - return $pre . $str . $post; |
|
| 4151 | + return $pre.$str.$post; |
|
| 4152 | 4152 | } |
| 4153 | 4153 | |
| 4154 | 4154 | return $str; |
@@ -4278,7 +4278,7 @@ discard block |
||
| 4278 | 4278 | } |
| 4279 | 4279 | |
| 4280 | 4280 | /** @noinspection PhpInternalEntityUsedInspection */ |
| 4281 | - preg_match_all('/' . Grapheme::GRAPHEME_CLUSTER_RX . '/u', $str, $a); |
|
| 4281 | + preg_match_all('/'.Grapheme::GRAPHEME_CLUSTER_RX.'/u', $str, $a); |
|
| 4282 | 4282 | $a = $a[0]; |
| 4283 | 4283 | |
| 4284 | 4284 | if ($len === 1) { |
@@ -4453,7 +4453,7 @@ discard block |
||
| 4453 | 4453 | public static function strcmp($str1, $str2) |
| 4454 | 4454 | { |
| 4455 | 4455 | /** @noinspection PhpUndefinedClassInspection */ |
| 4456 | - return $str1 . '' === $str2 . '' ? 0 : strcmp( |
|
| 4456 | + return $str1.'' === $str2.'' ? 0 : strcmp( |
|
| 4457 | 4457 | \Normalizer::normalize($str1, \Normalizer::NFD), |
| 4458 | 4458 | \Normalizer::normalize($str2, \Normalizer::NFD) |
| 4459 | 4459 | ); |
@@ -4484,7 +4484,7 @@ discard block |
||
| 4484 | 4484 | return null; |
| 4485 | 4485 | } |
| 4486 | 4486 | |
| 4487 | - if (preg_match('/^(.*?)' . self::rxClass($charList) . '/us', $str, $length)) { |
|
| 4487 | + if (preg_match('/^(.*?)'.self::rxClass($charList).'/us', $str, $length)) { |
|
| 4488 | 4488 | /** @noinspection OffsetOperationsInspection */ |
| 4489 | 4489 | return self::strlen($length[1]); |
| 4490 | 4490 | } |
@@ -4683,7 +4683,7 @@ discard block |
||
| 4683 | 4683 | return \grapheme_stristr($haystack, $needle, $before_needle); |
| 4684 | 4684 | } |
| 4685 | 4685 | |
| 4686 | - preg_match('/^(.*?)' . preg_quote($needle, '/') . '/usi', $haystack, $match); |
|
| 4686 | + preg_match('/^(.*?)'.preg_quote($needle, '/').'/usi', $haystack, $match); |
|
| 4687 | 4687 | |
| 4688 | 4688 | if (!isset($match[1])) { |
| 4689 | 4689 | return false; |
@@ -4801,7 +4801,7 @@ discard block |
||
| 4801 | 4801 | */ |
| 4802 | 4802 | public static function strnatcmp($str1, $str2) |
| 4803 | 4803 | { |
| 4804 | - return $str1 . '' === $str2 . '' ? 0 : strnatcmp(self::strtonatfold($str1), self::strtonatfold($str2)); |
|
| 4804 | + return $str1.'' === $str2.'' ? 0 : strnatcmp(self::strtonatfold($str1), self::strtonatfold($str2)); |
|
| 4805 | 4805 | } |
| 4806 | 4806 | |
| 4807 | 4807 | /** |
@@ -4862,7 +4862,7 @@ discard block |
||
| 4862 | 4862 | return false; |
| 4863 | 4863 | } |
| 4864 | 4864 | |
| 4865 | - if (preg_match('/' . self::rxClass($char_list) . '/us', $haystack, $m)) { |
|
| 4865 | + if (preg_match('/'.self::rxClass($char_list).'/us', $haystack, $m)) { |
|
| 4866 | 4866 | return substr($haystack, strpos($haystack, $m[0])); |
| 4867 | 4867 | } else { |
| 4868 | 4868 | return false; |
@@ -4939,7 +4939,7 @@ discard block |
||
| 4939 | 4939 | } |
| 4940 | 4940 | |
| 4941 | 4941 | if (self::$support['intl'] === true) { |
| 4942 | - $returnTmp = \grapheme_strpos($haystack, $needle, $offset); |
|
| 4942 | + $returnTmp = \grapheme_strpos($haystack, $needle, $offset); |
|
| 4943 | 4943 | if ($returnTmp !== false) { |
| 4944 | 4944 | return $returnTmp; |
| 4945 | 4945 | } |
@@ -5120,8 +5120,8 @@ discard block |
||
| 5120 | 5120 | } |
| 5121 | 5121 | |
| 5122 | 5122 | if (self::$support['intl'] === true) { |
| 5123 | - $returnTmp = \grapheme_strripos($haystack, $needle, $offset); |
|
| 5124 | - if ($returnTmp !== false ) { |
|
| 5123 | + $returnTmp = \grapheme_strripos($haystack, $needle, $offset); |
|
| 5124 | + if ($returnTmp !== false) { |
|
| 5125 | 5125 | return $returnTmp; |
| 5126 | 5126 | } |
| 5127 | 5127 | } |
@@ -5196,7 +5196,7 @@ discard block |
||
| 5196 | 5196 | |
| 5197 | 5197 | if (self::$support['intl'] === true) { |
| 5198 | 5198 | $returnTmp = \grapheme_strrpos($haystack, $needle, $offset); |
| 5199 | - if ($returnTmp !== false ) { |
|
| 5199 | + if ($returnTmp !== false) { |
|
| 5200 | 5200 | return $returnTmp; |
| 5201 | 5201 | } |
| 5202 | 5202 | } |
@@ -5244,7 +5244,7 @@ discard block |
||
| 5244 | 5244 | return 0; |
| 5245 | 5245 | } |
| 5246 | 5246 | |
| 5247 | - return preg_match('/^' . self::rxClass($mask) . '+/u', $str, $str) ? self::strlen($str[0]) : 0; |
|
| 5247 | + return preg_match('/^'.self::rxClass($mask).'+/u', $str, $str) ? self::strlen($str[0]) : 0; |
|
| 5248 | 5248 | } |
| 5249 | 5249 | |
| 5250 | 5250 | /** |
@@ -5297,7 +5297,7 @@ discard block |
||
| 5297 | 5297 | return \grapheme_strstr($haystack, $needle, $before_needle); |
| 5298 | 5298 | } |
| 5299 | 5299 | |
| 5300 | - preg_match('/^(.*?)' . preg_quote($needle, '/') . '/us', $haystack, $match); |
|
| 5300 | + preg_match('/^(.*?)'.preg_quote($needle, '/').'/us', $haystack, $match); |
|
| 5301 | 5301 | |
| 5302 | 5302 | if (!isset($match[1])) { |
| 5303 | 5303 | return false; |
@@ -5666,7 +5666,7 @@ discard block |
||
| 5666 | 5666 | return \mb_substr_count($haystack, $needle, $encoding); |
| 5667 | 5667 | } |
| 5668 | 5668 | |
| 5669 | - preg_match_all('/' . preg_quote($needle, '/') . '/us', $haystack, $matches, PREG_SET_ORDER); |
|
| 5669 | + preg_match_all('/'.preg_quote($needle, '/').'/us', $haystack, $matches, PREG_SET_ORDER); |
|
| 5670 | 5670 | return count($matches); |
| 5671 | 5671 | } |
| 5672 | 5672 | |
@@ -5887,7 +5887,7 @@ discard block |
||
| 5887 | 5887 | |
| 5888 | 5888 | $strSwappedCase = preg_replace_callback( |
| 5889 | 5889 | '/[\S]/u', |
| 5890 | - function ($match) use ($encoding) { |
|
| 5890 | + function($match) use ($encoding) { |
|
| 5891 | 5891 | $marchToUpper = UTF8::strtoupper($match[0], $encoding); |
| 5892 | 5892 | |
| 5893 | 5893 | if ($match[0] === $marchToUpper) { |
@@ -6069,7 +6069,7 @@ discard block |
||
| 6069 | 6069 | |
| 6070 | 6070 | $bank = $ord >> 8; |
| 6071 | 6071 | if (!array_key_exists($bank, (array)$UTF8_TO_ASCII)) { |
| 6072 | - $bankfile = __DIR__ . '/data/' . sprintf('x%02x', $bank) . '.php'; |
|
| 6072 | + $bankfile = __DIR__.'/data/'.sprintf('x%02x', $bank).'.php'; |
|
| 6073 | 6073 | if (file_exists($bankfile)) { |
| 6074 | 6074 | /** @noinspection PhpIncludeInspection */ |
| 6075 | 6075 | require $bankfile; |
@@ -6190,40 +6190,40 @@ discard block |
||
| 6190 | 6190 | if ($c1 >= "\xc0" & $c1 <= "\xdf") { // looks like 2 bytes UTF8 |
| 6191 | 6191 | |
| 6192 | 6192 | if ($c2 >= "\x80" && $c2 <= "\xbf") { // yeah, almost sure it's UTF8 already |
| 6193 | - $buf .= $c1 . $c2; |
|
| 6193 | + $buf .= $c1.$c2; |
|
| 6194 | 6194 | $i++; |
| 6195 | 6195 | } else { // not valid UTF8 - convert it |
| 6196 | 6196 | $cc1 = (chr(ord($c1) / 64) | "\xc0"); |
| 6197 | 6197 | $cc2 = ($c1 & "\x3f") | "\x80"; |
| 6198 | - $buf .= $cc1 . $cc2; |
|
| 6198 | + $buf .= $cc1.$cc2; |
|
| 6199 | 6199 | } |
| 6200 | 6200 | |
| 6201 | 6201 | } elseif ($c1 >= "\xe0" & $c1 <= "\xef") { // looks like 3 bytes UTF8 |
| 6202 | 6202 | |
| 6203 | 6203 | if ($c2 >= "\x80" && $c2 <= "\xbf" && $c3 >= "\x80" && $c3 <= "\xbf") { // yeah, almost sure it's UTF8 already |
| 6204 | - $buf .= $c1 . $c2 . $c3; |
|
| 6204 | + $buf .= $c1.$c2.$c3; |
|
| 6205 | 6205 | $i += 2; |
| 6206 | 6206 | } else { // not valid UTF8 - convert it |
| 6207 | 6207 | $cc1 = (chr(ord($c1) / 64) | "\xc0"); |
| 6208 | 6208 | $cc2 = ($c1 & "\x3f") | "\x80"; |
| 6209 | - $buf .= $cc1 . $cc2; |
|
| 6209 | + $buf .= $cc1.$cc2; |
|
| 6210 | 6210 | } |
| 6211 | 6211 | |
| 6212 | 6212 | } elseif ($c1 >= "\xf0" & $c1 <= "\xf7") { // looks like 4 bytes UTF8 |
| 6213 | 6213 | |
| 6214 | 6214 | if ($c2 >= "\x80" && $c2 <= "\xbf" && $c3 >= "\x80" && $c3 <= "\xbf" && $c4 >= "\x80" && $c4 <= "\xbf") { // yeah, almost sure it's UTF8 already |
| 6215 | - $buf .= $c1 . $c2 . $c3 . $c4; |
|
| 6215 | + $buf .= $c1.$c2.$c3.$c4; |
|
| 6216 | 6216 | $i += 3; |
| 6217 | 6217 | } else { // not valid UTF8 - convert it |
| 6218 | 6218 | $cc1 = (chr(ord($c1) / 64) | "\xc0"); |
| 6219 | 6219 | $cc2 = ($c1 & "\x3f") | "\x80"; |
| 6220 | - $buf .= $cc1 . $cc2; |
|
| 6220 | + $buf .= $cc1.$cc2; |
|
| 6221 | 6221 | } |
| 6222 | 6222 | |
| 6223 | 6223 | } else { // doesn't look like UTF8, but should be converted |
| 6224 | 6224 | $cc1 = (chr(ord($c1) / 64) | "\xc0"); |
| 6225 | 6225 | $cc2 = (($c1 & "\x3f") | "\x80"); |
| 6226 | - $buf .= $cc1 . $cc2; |
|
| 6226 | + $buf .= $cc1.$cc2; |
|
| 6227 | 6227 | } |
| 6228 | 6228 | |
| 6229 | 6229 | } elseif (($c1 & "\xc0") === "\x80") { // needs conversion |
@@ -6234,7 +6234,7 @@ discard block |
||
| 6234 | 6234 | } else { |
| 6235 | 6235 | $cc1 = (chr($ordC1 / 64) | "\xc0"); |
| 6236 | 6236 | $cc2 = (($c1 & "\x3f") | "\x80"); |
| 6237 | - $buf .= $cc1 . $cc2; |
|
| 6237 | + $buf .= $cc1.$cc2; |
|
| 6238 | 6238 | } |
| 6239 | 6239 | |
| 6240 | 6240 | } else { // it doesn't need conversion |
@@ -6245,7 +6245,7 @@ discard block |
||
| 6245 | 6245 | // decode unicode escape sequences |
| 6246 | 6246 | $buf = preg_replace_callback( |
| 6247 | 6247 | '/\\\\u([0-9a-f]{4})/i', |
| 6248 | - function ($match) { |
|
| 6248 | + function($match) { |
|
| 6249 | 6249 | return \mb_convert_encoding(pack('H*', $match[1]), 'UTF-8', 'UCS-2BE'); |
| 6250 | 6250 | }, |
| 6251 | 6251 | $buf |
@@ -6254,7 +6254,7 @@ discard block |
||
| 6254 | 6254 | // decode UTF-8 codepoints |
| 6255 | 6255 | $buf = preg_replace_callback( |
| 6256 | 6256 | '/&#\d{2,6};/', |
| 6257 | - function ($match) { |
|
| 6257 | + function($match) { |
|
| 6258 | 6258 | return \mb_convert_encoding($match[0], 'UTF-8', 'HTML-ENTITIES'); |
| 6259 | 6259 | }, |
| 6260 | 6260 | $buf |
@@ -6303,7 +6303,7 @@ discard block |
||
| 6303 | 6303 | */ |
| 6304 | 6304 | public static function ucfirst($str, $encoding = 'UTF-8', $cleanUtf8 = false) |
| 6305 | 6305 | { |
| 6306 | - return self::strtoupper(self::substr($str, 0, 1, $encoding, $cleanUtf8), $encoding, $cleanUtf8) . self::substr($str, 1, null, $encoding, $cleanUtf8); |
|
| 6306 | + return self::strtoupper(self::substr($str, 0, 1, $encoding, $cleanUtf8), $encoding, $cleanUtf8).self::substr($str, 1, null, $encoding, $cleanUtf8); |
|
| 6307 | 6307 | } |
| 6308 | 6308 | |
| 6309 | 6309 | /** |
@@ -6832,7 +6832,7 @@ discard block |
||
| 6832 | 6832 | return ''; |
| 6833 | 6833 | } |
| 6834 | 6834 | |
| 6835 | - preg_match('/^\s*+(?:\S++\s*+){1,' . $words . '}/u', $str, $matches); |
|
| 6835 | + preg_match('/^\s*+(?:\S++\s*+){1,'.$words.'}/u', $str, $matches); |
|
| 6836 | 6836 | |
| 6837 | 6837 | if ( |
| 6838 | 6838 | !isset($matches[0]) |
@@ -6842,7 +6842,7 @@ discard block |
||
| 6842 | 6842 | return $str; |
| 6843 | 6843 | } |
| 6844 | 6844 | |
| 6845 | - return self::rtrim($matches[0]) . $strAddOn; |
|
| 6845 | + return self::rtrim($matches[0]).$strAddOn; |
|
| 6846 | 6846 | } |
| 6847 | 6847 | |
| 6848 | 6848 | /** |
@@ -6910,7 +6910,7 @@ discard block |
||
| 6910 | 6910 | $strReturn .= $break; |
| 6911 | 6911 | } |
| 6912 | 6912 | |
| 6913 | - return $strReturn . implode('', $chars); |
|
| 6913 | + return $strReturn.implode('', $chars); |
|
| 6914 | 6914 | } |
| 6915 | 6915 | |
| 6916 | 6916 | /** |