@@ -217,6 +217,6 @@ |
||
217 | 217 | ), |
218 | 218 | ); |
219 | 219 | |
220 | -$result =& $data; |
|
220 | +$result = & $data; |
|
221 | 221 | unset($data); |
222 | 222 | return $result; |
@@ -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') { |
@@ -2668,7 +2668,7 @@ discard block |
||
2668 | 2668 | /** |
2669 | 2669 | * Check if the input is binary... (is look like a hack). |
2670 | 2670 | * |
2671 | - * @param mixed $input |
|
2671 | + * @param string $input |
|
2672 | 2672 | * |
2673 | 2673 | * @return bool |
2674 | 2674 | */ |
@@ -5027,7 +5027,7 @@ discard block |
||
5027 | 5027 | * @param string $encoding [optional] <p>Set the charset for e.g. "\mb_" function.</p> |
5028 | 5028 | * @param boolean $cleanUtf8 [optional] <p>Clean non UTF-8 chars from the string.</p> |
5029 | 5029 | * |
5030 | - * @return int|false <p> |
|
5030 | + * @return string <p> |
|
5031 | 5031 | * The numeric position of the first occurrence of needle in the haystack string.<br /> |
5032 | 5032 | * If needle is not found it returns false. |
5033 | 5033 | * </p> |
@@ -5303,7 +5303,7 @@ discard block |
||
5303 | 5303 | * @link http://php.net/manual/en/function.mb-strrpos.php |
5304 | 5304 | * |
5305 | 5305 | * @param string $haystack <p>The string being checked, for the last occurrence of needle</p> |
5306 | - * @param string|int $needle <p>The string to find in haystack.<br />Or a code point as int.</p> |
|
5306 | + * @param string $needle <p>The string to find in haystack.<br />Or a code point as int.</p> |
|
5307 | 5307 | * @param int $offset [optional] <p>May be specified to begin searching an arbitrary number of characters |
5308 | 5308 | * into the string. Negative values will stop searching at an arbitrary point prior to |
5309 | 5309 | * the end of the string. |
@@ -6388,7 +6388,7 @@ discard block |
||
6388 | 6388 | * 2) when any of these: àáâãäåæçèéêëìíîï are followed by TWO chars from group B, |
6389 | 6389 | * 3) when any of these: ðñòó are followed by THREE chars from group B. |
6390 | 6390 | * |
6391 | - * @param string|string[] $str <p>Any string or array.</p> |
|
6391 | + * @param string $str <p>Any string or array.</p> |
|
6392 | 6392 | * @param bool $decodeHtmlEntityToUtf8 <p>Set to true, if you need to decode html-entities.</p> |
6393 | 6393 | * |
6394 | 6394 | * @return string|string[] <p>The UTF-8 encoded string.</p> |
@@ -850,7 +850,7 @@ discard block |
||
850 | 850 | public static function add_bom_to_string($str) |
851 | 851 | { |
852 | 852 | if (self::string_has_bom($str) === false) { |
853 | - $str = self::bom() . $str; |
|
853 | + $str = self::bom().$str; |
|
854 | 854 | } |
855 | 855 | |
856 | 856 | return $str; |
@@ -956,7 +956,7 @@ discard block |
||
956 | 956 | |
957 | 957 | // use static cache, if there is no support for "IntlChar" |
958 | 958 | static $cache = array(); |
959 | - $cacheKey = $code_point . $encoding; |
|
959 | + $cacheKey = $code_point.$encoding; |
|
960 | 960 | if (isset($cache[$cacheKey]) === true) { |
961 | 961 | return $cache[$cacheKey]; |
962 | 962 | } |
@@ -964,16 +964,16 @@ discard block |
||
964 | 964 | if (0x80 > $code_point %= 0x200000) { |
965 | 965 | $str = chr($code_point); |
966 | 966 | } elseif (0x800 > $code_point) { |
967 | - $str = chr(0xC0 | $code_point >> 6) . |
|
967 | + $str = chr(0xC0 | $code_point >> 6). |
|
968 | 968 | chr(0x80 | $code_point & 0x3F); |
969 | 969 | } elseif (0x10000 > $code_point) { |
970 | - $str = chr(0xE0 | $code_point >> 12) . |
|
971 | - chr(0x80 | $code_point >> 6 & 0x3F) . |
|
970 | + $str = chr(0xE0 | $code_point >> 12). |
|
971 | + chr(0x80 | $code_point >> 6 & 0x3F). |
|
972 | 972 | chr(0x80 | $code_point & 0x3F); |
973 | 973 | } else { |
974 | - $str = chr(0xF0 | $code_point >> 18) . |
|
975 | - chr(0x80 | $code_point >> 12 & 0x3F) . |
|
976 | - chr(0x80 | $code_point >> 6 & 0x3F) . |
|
974 | + $str = chr(0xF0 | $code_point >> 18). |
|
975 | + chr(0x80 | $code_point >> 12 & 0x3F). |
|
976 | + chr(0x80 | $code_point >> 6 & 0x3F). |
|
977 | 977 | chr(0x80 | $code_point & 0x3F); |
978 | 978 | } |
979 | 979 | |
@@ -1248,7 +1248,7 @@ discard block |
||
1248 | 1248 | */ |
1249 | 1249 | public static function decimal_to_chr($int) |
1250 | 1250 | { |
1251 | - return self::html_decode('&#' . $int . ';'); |
|
1251 | + return self::html_decode('&#'.$int.';'); |
|
1252 | 1252 | } |
1253 | 1253 | |
1254 | 1254 | /** |
@@ -1325,7 +1325,7 @@ discard block |
||
1325 | 1325 | && |
1326 | 1326 | self::$support['mbstring'] === false |
1327 | 1327 | ) { |
1328 | - trigger_error('UTF8::encode() without mbstring cannot handle "' . $encoding . '" encoding', E_USER_WARNING); |
|
1328 | + trigger_error('UTF8::encode() without mbstring cannot handle "'.$encoding.'" encoding', E_USER_WARNING); |
|
1329 | 1329 | } |
1330 | 1330 | |
1331 | 1331 | $strEncoded = \mb_convert_encoding( |
@@ -1524,7 +1524,7 @@ discard block |
||
1524 | 1524 | ) { |
1525 | 1525 | // Prevent leading combining chars |
1526 | 1526 | // for NFC-safe concatenations. |
1527 | - $var = $leading_combining . $var; |
|
1527 | + $var = $leading_combining.$var; |
|
1528 | 1528 | } |
1529 | 1529 | } |
1530 | 1530 | |
@@ -1945,7 +1945,7 @@ discard block |
||
1945 | 1945 | */ |
1946 | 1946 | private static function getData($file) |
1947 | 1947 | { |
1948 | - $file = __DIR__ . '/data/' . $file . '.php'; |
|
1948 | + $file = __DIR__.'/data/'.$file.'.php'; |
|
1949 | 1949 | if (file_exists($file)) { |
1950 | 1950 | /** @noinspection PhpIncludeInspection */ |
1951 | 1951 | return require $file; |
@@ -2062,7 +2062,7 @@ discard block |
||
2062 | 2062 | return implode( |
2063 | 2063 | '', |
2064 | 2064 | array_map( |
2065 | - function ($data) use ($keepAsciiChars, $encoding) { |
|
2065 | + function($data) use ($keepAsciiChars, $encoding) { |
|
2066 | 2066 | return UTF8::single_chr_html_encode($data, $keepAsciiChars, $encoding); |
2067 | 2067 | }, |
2068 | 2068 | self::split($str) |
@@ -2181,7 +2181,7 @@ discard block |
||
2181 | 2181 | |
2182 | 2182 | $str = preg_replace_callback( |
2183 | 2183 | "/&#\d{2,6};/", |
2184 | - function ($matches) use ($encoding) { |
|
2184 | + function($matches) use ($encoding) { |
|
2185 | 2185 | $returnTmp = \mb_convert_encoding($matches[0], $encoding, 'HTML-ENTITIES'); |
2186 | 2186 | |
2187 | 2187 | if ($returnTmp !== '"' && $returnTmp !== "'") { |
@@ -2505,9 +2505,9 @@ discard block |
||
2505 | 2505 | if (ctype_digit((string)$int)) { |
2506 | 2506 | $hex = dechex((int)$int); |
2507 | 2507 | |
2508 | - $hex = (strlen($hex) < 4 ? substr('0000' . $hex, -4) : $hex); |
|
2508 | + $hex = (strlen($hex) < 4 ? substr('0000'.$hex, -4) : $hex); |
|
2509 | 2509 | |
2510 | - return $pfix . $hex; |
|
2510 | + return $pfix.$hex; |
|
2511 | 2511 | } |
2512 | 2512 | |
2513 | 2513 | return ''; |
@@ -3211,7 +3211,7 @@ discard block |
||
3211 | 3211 | */ |
3212 | 3212 | public static function lcfirst($str) |
3213 | 3213 | { |
3214 | - return self::strtolower(self::substr($str, 0, 1)) . self::substr($str, 1); |
|
3214 | + return self::strtolower(self::substr($str, 0, 1)).self::substr($str, 1); |
|
3215 | 3215 | } |
3216 | 3216 | |
3217 | 3217 | /** |
@@ -3235,7 +3235,7 @@ discard block |
||
3235 | 3235 | return preg_replace('/^[\pZ\pC]+/u', '', $str); |
3236 | 3236 | } |
3237 | 3237 | |
3238 | - return preg_replace('/^' . self::rxClass($chars) . '+/u', '', $str); |
|
3238 | + return preg_replace('/^'.self::rxClass($chars).'+/u', '', $str); |
|
3239 | 3239 | } |
3240 | 3240 | |
3241 | 3241 | /** |
@@ -3738,7 +3738,7 @@ discard block |
||
3738 | 3738 | if (is_array($what)) { |
3739 | 3739 | /** @noinspection ForeachSourceInspection */ |
3740 | 3740 | foreach ($what as $item) { |
3741 | - $str = preg_replace('/(' . preg_quote($item, '/') . ')+/', $item, $str); |
|
3741 | + $str = preg_replace('/('.preg_quote($item, '/').')+/', $item, $str); |
|
3742 | 3742 | } |
3743 | 3743 | } |
3744 | 3744 | |
@@ -3840,7 +3840,7 @@ discard block |
||
3840 | 3840 | return preg_replace('/[\pZ\pC]+$/u', '', $str); |
3841 | 3841 | } |
3842 | 3842 | |
3843 | - return preg_replace('/' . self::rxClass($chars) . '+$/u', '', $str); |
|
3843 | + return preg_replace('/'.self::rxClass($chars).'+$/u', '', $str); |
|
3844 | 3844 | } |
3845 | 3845 | |
3846 | 3846 | /** |
@@ -3855,7 +3855,7 @@ discard block |
||
3855 | 3855 | { |
3856 | 3856 | static $rxClassCache = array(); |
3857 | 3857 | |
3858 | - $cacheKey = $s . $class; |
|
3858 | + $cacheKey = $s.$class; |
|
3859 | 3859 | |
3860 | 3860 | if (isset($rxClassCache[$cacheKey])) { |
3861 | 3861 | return $rxClassCache[$cacheKey]; |
@@ -3867,7 +3867,7 @@ discard block |
||
3867 | 3867 | /** @noinspection SuspiciousLoopInspection */ |
3868 | 3868 | foreach (self::str_split($s) as $s) { |
3869 | 3869 | if ('-' === $s) { |
3870 | - $class[0] = '-' . $class[0]; |
|
3870 | + $class[0] = '-'.$class[0]; |
|
3871 | 3871 | } elseif (!isset($s[2])) { |
3872 | 3872 | $class[0] .= preg_quote($s, '/'); |
3873 | 3873 | } elseif (1 === self::strlen($s)) { |
@@ -3878,13 +3878,13 @@ discard block |
||
3878 | 3878 | } |
3879 | 3879 | |
3880 | 3880 | if ($class[0]) { |
3881 | - $class[0] = '[' . $class[0] . ']'; |
|
3881 | + $class[0] = '['.$class[0].']'; |
|
3882 | 3882 | } |
3883 | 3883 | |
3884 | 3884 | if (1 === count($class)) { |
3885 | 3885 | $return = $class[0]; |
3886 | 3886 | } else { |
3887 | - $return = '(?:' . implode('|', $class) . ')'; |
|
3887 | + $return = '(?:'.implode('|', $class).')'; |
|
3888 | 3888 | } |
3889 | 3889 | |
3890 | 3890 | $rxClassCache[$cacheKey] = $return; |
@@ -3902,7 +3902,7 @@ discard block |
||
3902 | 3902 | } |
3903 | 3903 | |
3904 | 3904 | foreach (self::$support as $utf8Support) { |
3905 | - echo $utf8Support . "\n<br>"; |
|
3905 | + echo $utf8Support."\n<br>"; |
|
3906 | 3906 | } |
3907 | 3907 | } |
3908 | 3908 | |
@@ -3936,7 +3936,7 @@ discard block |
||
3936 | 3936 | $encoding = self::normalize_encoding($encoding); |
3937 | 3937 | } |
3938 | 3938 | |
3939 | - return '&#' . self::ord($char, $encoding) . ';'; |
|
3939 | + return '&#'.self::ord($char, $encoding).';'; |
|
3940 | 3940 | } |
3941 | 3941 | |
3942 | 3942 | /** |
@@ -3988,19 +3988,19 @@ discard block |
||
3988 | 3988 | $ret[] = $str[$i]; |
3989 | 3989 | } elseif ((($str[$i] & "\xE0") === "\xC0") && isset($str[$i + 1])) { |
3990 | 3990 | if (($str[$i + 1] & "\xC0") === "\x80") { |
3991 | - $ret[] = $str[$i] . $str[$i + 1]; |
|
3991 | + $ret[] = $str[$i].$str[$i + 1]; |
|
3992 | 3992 | |
3993 | 3993 | $i++; |
3994 | 3994 | } |
3995 | 3995 | } elseif ((($str[$i] & "\xF0") === "\xE0") && isset($str[$i + 2])) { |
3996 | 3996 | if ((($str[$i + 1] & "\xC0") === "\x80") && (($str[$i + 2] & "\xC0") === "\x80")) { |
3997 | - $ret[] = $str[$i] . $str[$i + 1] . $str[$i + 2]; |
|
3997 | + $ret[] = $str[$i].$str[$i + 1].$str[$i + 2]; |
|
3998 | 3998 | |
3999 | 3999 | $i += 2; |
4000 | 4000 | } |
4001 | 4001 | } elseif ((($str[$i] & "\xF8") === "\xF0") && isset($str[$i + 3])) { |
4002 | 4002 | if ((($str[$i + 1] & "\xC0") === "\x80") && (($str[$i + 2] & "\xC0") === "\x80") && (($str[$i + 3] & "\xC0") === "\x80")) { |
4003 | - $ret[] = $str[$i] . $str[$i + 1] . $str[$i + 2] . $str[$i + 3]; |
|
4003 | + $ret[] = $str[$i].$str[$i + 1].$str[$i + 2].$str[$i + 3]; |
|
4004 | 4004 | |
4005 | 4005 | $i += 3; |
4006 | 4006 | } |
@@ -4012,7 +4012,7 @@ discard block |
||
4012 | 4012 | $ret = array_chunk($ret, $length); |
4013 | 4013 | |
4014 | 4014 | return array_map( |
4015 | - function ($item) { |
|
4015 | + function($item) { |
|
4016 | 4016 | return implode('', $item); |
4017 | 4017 | }, $ret |
4018 | 4018 | ); |
@@ -4111,7 +4111,7 @@ discard block |
||
4111 | 4111 | foreach (self::$iconvEncoding as $encodingTmp) { |
4112 | 4112 | # INFO: //IGNORE and //TRANSLIT still throw notice |
4113 | 4113 | /** @noinspection PhpUsageOfSilenceOperatorInspection */ |
4114 | - if (md5(@\iconv($encodingTmp, $encodingTmp . '//IGNORE', $str)) === $md5) { |
|
4114 | + if (md5(@\iconv($encodingTmp, $encodingTmp.'//IGNORE', $str)) === $md5) { |
|
4115 | 4115 | return $encodingTmp; |
4116 | 4116 | } |
4117 | 4117 | } |
@@ -4201,7 +4201,7 @@ discard block |
||
4201 | 4201 | if ('' === $s .= '') { |
4202 | 4202 | $s = '/^(?<=.)$/'; |
4203 | 4203 | } else { |
4204 | - $s = '/' . preg_quote($s, '/') . '/ui'; |
|
4204 | + $s = '/'.preg_quote($s, '/').'/ui'; |
|
4205 | 4205 | } |
4206 | 4206 | } |
4207 | 4207 | |
@@ -4259,7 +4259,7 @@ discard block |
||
4259 | 4259 | } |
4260 | 4260 | |
4261 | 4261 | if (self::substr($str, $length - 1, 1) === ' ') { |
4262 | - return self::substr($str, 0, $length - 1) . $strAddOn; |
|
4262 | + return self::substr($str, 0, $length - 1).$strAddOn; |
|
4263 | 4263 | } |
4264 | 4264 | |
4265 | 4265 | $str = self::substr($str, 0, $length); |
@@ -4268,9 +4268,9 @@ discard block |
||
4268 | 4268 | $new_str = implode(' ', $array); |
4269 | 4269 | |
4270 | 4270 | if ($new_str === '') { |
4271 | - $str = self::substr($str, 0, $length - 1) . $strAddOn; |
|
4271 | + $str = self::substr($str, 0, $length - 1).$strAddOn; |
|
4272 | 4272 | } else { |
4273 | - $str = $new_str . $strAddOn; |
|
4273 | + $str = $new_str.$strAddOn; |
|
4274 | 4274 | } |
4275 | 4275 | |
4276 | 4276 | return $str; |
@@ -4325,7 +4325,7 @@ discard block |
||
4325 | 4325 | $pre = ''; |
4326 | 4326 | } |
4327 | 4327 | |
4328 | - return $pre . $str . $post; |
|
4328 | + return $pre.$str.$post; |
|
4329 | 4329 | } |
4330 | 4330 | |
4331 | 4331 | return $str; |
@@ -4455,7 +4455,7 @@ discard block |
||
4455 | 4455 | } |
4456 | 4456 | |
4457 | 4457 | /** @noinspection PhpInternalEntityUsedInspection */ |
4458 | - preg_match_all('/' . Grapheme::GRAPHEME_CLUSTER_RX . '/u', $str, $a); |
|
4458 | + preg_match_all('/'.Grapheme::GRAPHEME_CLUSTER_RX.'/u', $str, $a); |
|
4459 | 4459 | $a = $a[0]; |
4460 | 4460 | |
4461 | 4461 | if ($len === 1) { |
@@ -4650,7 +4650,7 @@ discard block |
||
4650 | 4650 | public static function strcmp($str1, $str2) |
4651 | 4651 | { |
4652 | 4652 | /** @noinspection PhpUndefinedClassInspection */ |
4653 | - return $str1 . '' === $str2 . '' ? 0 : strcmp( |
|
4653 | + return $str1.'' === $str2.'' ? 0 : strcmp( |
|
4654 | 4654 | \Normalizer::normalize($str1, \Normalizer::NFD), |
4655 | 4655 | \Normalizer::normalize($str2, \Normalizer::NFD) |
4656 | 4656 | ); |
@@ -4681,7 +4681,7 @@ discard block |
||
4681 | 4681 | return null; |
4682 | 4682 | } |
4683 | 4683 | |
4684 | - if (preg_match('/^(.*?)' . self::rxClass($charList) . '/us', $str, $length)) { |
|
4684 | + if (preg_match('/^(.*?)'.self::rxClass($charList).'/us', $str, $length)) { |
|
4685 | 4685 | /** @noinspection OffsetOperationsInspection */ |
4686 | 4686 | return self::strlen($length[1]); |
4687 | 4687 | } |
@@ -4888,7 +4888,7 @@ discard block |
||
4888 | 4888 | && |
4889 | 4889 | self::$support['mbstring'] === false |
4890 | 4890 | ) { |
4891 | - trigger_error('UTF8::stristr() without mbstring cannot handle "' . $encoding . '" encoding', E_USER_WARNING); |
|
4891 | + trigger_error('UTF8::stristr() without mbstring cannot handle "'.$encoding.'" encoding', E_USER_WARNING); |
|
4892 | 4892 | } |
4893 | 4893 | |
4894 | 4894 | if (self::$support['mbstring'] === true) { |
@@ -4899,7 +4899,7 @@ discard block |
||
4899 | 4899 | return \grapheme_stristr($haystack, $needle, $before_needle); |
4900 | 4900 | } |
4901 | 4901 | |
4902 | - preg_match('/^(.*?)' . preg_quote($needle, '/') . '/usi', $haystack, $match); |
|
4902 | + preg_match('/^(.*?)'.preg_quote($needle, '/').'/usi', $haystack, $match); |
|
4903 | 4903 | |
4904 | 4904 | if (!isset($match[1])) { |
4905 | 4905 | return false; |
@@ -4961,7 +4961,7 @@ discard block |
||
4961 | 4961 | && |
4962 | 4962 | self::$support['mbstring'] === false |
4963 | 4963 | ) { |
4964 | - trigger_error('UTF8::strlen() without mbstring cannot handle "' . $encoding . '" encoding', E_USER_WARNING); |
|
4964 | + trigger_error('UTF8::strlen() without mbstring cannot handle "'.$encoding.'" encoding', E_USER_WARNING); |
|
4965 | 4965 | } |
4966 | 4966 | |
4967 | 4967 | if (self::$support['mbstring'] === true) { |
@@ -5026,7 +5026,7 @@ discard block |
||
5026 | 5026 | */ |
5027 | 5027 | public static function strnatcmp($str1, $str2) |
5028 | 5028 | { |
5029 | - return $str1 . '' === $str2 . '' ? 0 : strnatcmp(self::strtonatfold($str1), self::strtonatfold($str2)); |
|
5029 | + return $str1.'' === $str2.'' ? 0 : strnatcmp(self::strtonatfold($str1), self::strtonatfold($str2)); |
|
5030 | 5030 | } |
5031 | 5031 | |
5032 | 5032 | /** |
@@ -5087,7 +5087,7 @@ discard block |
||
5087 | 5087 | return false; |
5088 | 5088 | } |
5089 | 5089 | |
5090 | - if (preg_match('/' . self::rxClass($char_list) . '/us', $haystack, $m)) { |
|
5090 | + if (preg_match('/'.self::rxClass($char_list).'/us', $haystack, $m)) { |
|
5091 | 5091 | return substr($haystack, strpos($haystack, $m[0])); |
5092 | 5092 | } else { |
5093 | 5093 | return false; |
@@ -5154,7 +5154,7 @@ discard block |
||
5154 | 5154 | && |
5155 | 5155 | self::$support['mbstring'] === false |
5156 | 5156 | ) { |
5157 | - trigger_error('UTF8::strpos() without mbstring cannot handle "' . $encoding . '" encoding', E_USER_WARNING); |
|
5157 | + trigger_error('UTF8::strpos() without mbstring cannot handle "'.$encoding.'" encoding', E_USER_WARNING); |
|
5158 | 5158 | } |
5159 | 5159 | |
5160 | 5160 | if (self::$support['mbstring'] === true) { |
@@ -5356,7 +5356,7 @@ discard block |
||
5356 | 5356 | && |
5357 | 5357 | self::$support['mbstring'] === false |
5358 | 5358 | ) { |
5359 | - trigger_error('UTF8::strripos() without mbstring cannot handle "' . $encoding . '" encoding', E_USER_WARNING); |
|
5359 | + trigger_error('UTF8::strripos() without mbstring cannot handle "'.$encoding.'" encoding', E_USER_WARNING); |
|
5360 | 5360 | } |
5361 | 5361 | |
5362 | 5362 | if (self::$support['mbstring'] === true) { |
@@ -5436,7 +5436,7 @@ discard block |
||
5436 | 5436 | && |
5437 | 5437 | self::$support['mbstring'] === false |
5438 | 5438 | ) { |
5439 | - trigger_error('UTF8::strrpos() without mbstring cannot handle "' . $encoding . '" encoding', E_USER_WARNING); |
|
5439 | + trigger_error('UTF8::strrpos() without mbstring cannot handle "'.$encoding.'" encoding', E_USER_WARNING); |
|
5440 | 5440 | } |
5441 | 5441 | |
5442 | 5442 | if (self::$support['mbstring'] === true) { |
@@ -5496,7 +5496,7 @@ discard block |
||
5496 | 5496 | return 0; |
5497 | 5497 | } |
5498 | 5498 | |
5499 | - return preg_match('/^' . self::rxClass($mask) . '+/u', $str, $str) ? self::strlen($str[0]) : 0; |
|
5499 | + return preg_match('/^'.self::rxClass($mask).'+/u', $str, $str) ? self::strlen($str[0]) : 0; |
|
5500 | 5500 | } |
5501 | 5501 | |
5502 | 5502 | /** |
@@ -5542,7 +5542,7 @@ discard block |
||
5542 | 5542 | && |
5543 | 5543 | self::$support['mbstring'] === false |
5544 | 5544 | ) { |
5545 | - trigger_error('UTF8::strstr() without mbstring cannot handle "' . $encoding . '" encoding', E_USER_WARNING); |
|
5545 | + trigger_error('UTF8::strstr() without mbstring cannot handle "'.$encoding.'" encoding', E_USER_WARNING); |
|
5546 | 5546 | } |
5547 | 5547 | |
5548 | 5548 | if (self::$support['mbstring'] === true) { |
@@ -5559,7 +5559,7 @@ discard block |
||
5559 | 5559 | } |
5560 | 5560 | } |
5561 | 5561 | |
5562 | - preg_match('/^(.*?)' . preg_quote($needle, '/') . '/us', $haystack, $match); |
|
5562 | + preg_match('/^(.*?)'.preg_quote($needle, '/').'/us', $haystack, $match); |
|
5563 | 5563 | |
5564 | 5564 | if (!isset($match[1])) { |
5565 | 5565 | return false; |
@@ -5823,7 +5823,7 @@ discard block |
||
5823 | 5823 | && |
5824 | 5824 | self::$support['mbstring'] === false |
5825 | 5825 | ) { |
5826 | - trigger_error('UTF8::substr() without mbstring cannot handle "' . $encoding . '" encoding', E_USER_WARNING); |
|
5826 | + trigger_error('UTF8::substr() without mbstring cannot handle "'.$encoding.'" encoding', E_USER_WARNING); |
|
5827 | 5827 | } |
5828 | 5828 | |
5829 | 5829 | if (self::$support['mbstring'] === true) { |
@@ -5936,14 +5936,14 @@ discard block |
||
5936 | 5936 | && |
5937 | 5937 | self::$support['mbstring'] === false |
5938 | 5938 | ) { |
5939 | - trigger_error('UTF8::substr_count() without mbstring cannot handle "' . $encoding . '" encoding', E_USER_WARNING); |
|
5939 | + trigger_error('UTF8::substr_count() without mbstring cannot handle "'.$encoding.'" encoding', E_USER_WARNING); |
|
5940 | 5940 | } |
5941 | 5941 | |
5942 | 5942 | if (self::$support['mbstring'] === true) { |
5943 | 5943 | return \mb_substr_count($haystack, $needle, $encoding); |
5944 | 5944 | } |
5945 | 5945 | |
5946 | - preg_match_all('/' . preg_quote($needle, '/') . '/us', $haystack, $matches, PREG_SET_ORDER); |
|
5946 | + preg_match_all('/'.preg_quote($needle, '/').'/us', $haystack, $matches, PREG_SET_ORDER); |
|
5947 | 5947 | |
5948 | 5948 | return count($matches); |
5949 | 5949 | } |
@@ -6190,7 +6190,7 @@ discard block |
||
6190 | 6190 | |
6191 | 6191 | $strSwappedCase = preg_replace_callback( |
6192 | 6192 | '/[\S]/u', |
6193 | - function ($match) use ($encoding) { |
|
6193 | + function($match) use ($encoding) { |
|
6194 | 6194 | $marchToUpper = UTF8::strtoupper($match[0], $encoding); |
6195 | 6195 | |
6196 | 6196 | if ($match[0] === $marchToUpper) { |
@@ -6380,7 +6380,7 @@ discard block |
||
6380 | 6380 | |
6381 | 6381 | $bank = $ord >> 8; |
6382 | 6382 | if (!array_key_exists($bank, (array)$UTF8_TO_ASCII)) { |
6383 | - $bankfile = __DIR__ . '/data/' . sprintf('x%02x', $bank) . '.php'; |
|
6383 | + $bankfile = __DIR__.'/data/'.sprintf('x%02x', $bank).'.php'; |
|
6384 | 6384 | if (file_exists($bankfile)) { |
6385 | 6385 | /** @noinspection PhpIncludeInspection */ |
6386 | 6386 | require $bankfile; |
@@ -6502,40 +6502,40 @@ discard block |
||
6502 | 6502 | if ($c1 >= "\xc0" & $c1 <= "\xdf") { // looks like 2 bytes UTF8 |
6503 | 6503 | |
6504 | 6504 | if ($c2 >= "\x80" && $c2 <= "\xbf") { // yeah, almost sure it's UTF8 already |
6505 | - $buf .= $c1 . $c2; |
|
6505 | + $buf .= $c1.$c2; |
|
6506 | 6506 | $i++; |
6507 | 6507 | } else { // not valid UTF8 - convert it |
6508 | 6508 | $cc1 = (chr(ord($c1) / 64) | "\xc0"); |
6509 | 6509 | $cc2 = ($c1 & "\x3f") | "\x80"; |
6510 | - $buf .= $cc1 . $cc2; |
|
6510 | + $buf .= $cc1.$cc2; |
|
6511 | 6511 | } |
6512 | 6512 | |
6513 | 6513 | } elseif ($c1 >= "\xe0" & $c1 <= "\xef") { // looks like 3 bytes UTF8 |
6514 | 6514 | |
6515 | 6515 | if ($c2 >= "\x80" && $c2 <= "\xbf" && $c3 >= "\x80" && $c3 <= "\xbf") { // yeah, almost sure it's UTF8 already |
6516 | - $buf .= $c1 . $c2 . $c3; |
|
6516 | + $buf .= $c1.$c2.$c3; |
|
6517 | 6517 | $i += 2; |
6518 | 6518 | } else { // not valid UTF8 - convert it |
6519 | 6519 | $cc1 = (chr(ord($c1) / 64) | "\xc0"); |
6520 | 6520 | $cc2 = ($c1 & "\x3f") | "\x80"; |
6521 | - $buf .= $cc1 . $cc2; |
|
6521 | + $buf .= $cc1.$cc2; |
|
6522 | 6522 | } |
6523 | 6523 | |
6524 | 6524 | } elseif ($c1 >= "\xf0" & $c1 <= "\xf7") { // looks like 4 bytes UTF8 |
6525 | 6525 | |
6526 | 6526 | if ($c2 >= "\x80" && $c2 <= "\xbf" && $c3 >= "\x80" && $c3 <= "\xbf" && $c4 >= "\x80" && $c4 <= "\xbf") { // yeah, almost sure it's UTF8 already |
6527 | - $buf .= $c1 . $c2 . $c3 . $c4; |
|
6527 | + $buf .= $c1.$c2.$c3.$c4; |
|
6528 | 6528 | $i += 3; |
6529 | 6529 | } else { // not valid UTF8 - convert it |
6530 | 6530 | $cc1 = (chr(ord($c1) / 64) | "\xc0"); |
6531 | 6531 | $cc2 = ($c1 & "\x3f") | "\x80"; |
6532 | - $buf .= $cc1 . $cc2; |
|
6532 | + $buf .= $cc1.$cc2; |
|
6533 | 6533 | } |
6534 | 6534 | |
6535 | 6535 | } else { // doesn't look like UTF8, but should be converted |
6536 | 6536 | $cc1 = (chr(ord($c1) / 64) | "\xc0"); |
6537 | 6537 | $cc2 = (($c1 & "\x3f") | "\x80"); |
6538 | - $buf .= $cc1 . $cc2; |
|
6538 | + $buf .= $cc1.$cc2; |
|
6539 | 6539 | } |
6540 | 6540 | |
6541 | 6541 | } elseif (($c1 & "\xc0") === "\x80") { // needs conversion |
@@ -6546,7 +6546,7 @@ discard block |
||
6546 | 6546 | } else { |
6547 | 6547 | $cc1 = (chr($ordC1 / 64) | "\xc0"); |
6548 | 6548 | $cc2 = (($c1 & "\x3f") | "\x80"); |
6549 | - $buf .= $cc1 . $cc2; |
|
6549 | + $buf .= $cc1.$cc2; |
|
6550 | 6550 | } |
6551 | 6551 | |
6552 | 6552 | } else { // it doesn't need conversion |
@@ -6557,7 +6557,7 @@ discard block |
||
6557 | 6557 | // decode unicode escape sequences |
6558 | 6558 | $buf = preg_replace_callback( |
6559 | 6559 | '/\\\\u([0-9a-f]{4})/i', |
6560 | - function ($match) { |
|
6560 | + function($match) { |
|
6561 | 6561 | return \mb_convert_encoding(pack('H*', $match[1]), 'UTF-8', 'UCS-2BE'); |
6562 | 6562 | }, |
6563 | 6563 | $buf |
@@ -6611,7 +6611,7 @@ discard block |
||
6611 | 6611 | */ |
6612 | 6612 | public static function ucfirst($str, $encoding = 'UTF-8', $cleanUtf8 = false) |
6613 | 6613 | { |
6614 | - return self::strtoupper(self::substr($str, 0, 1, $encoding, $cleanUtf8), $encoding, $cleanUtf8) . self::substr($str, 1, null, $encoding, $cleanUtf8); |
|
6614 | + return self::strtoupper(self::substr($str, 0, 1, $encoding, $cleanUtf8), $encoding, $cleanUtf8).self::substr($str, 1, null, $encoding, $cleanUtf8); |
|
6615 | 6615 | } |
6616 | 6616 | |
6617 | 6617 | /** |
@@ -7088,7 +7088,7 @@ discard block |
||
7088 | 7088 | return ''; |
7089 | 7089 | } |
7090 | 7090 | |
7091 | - preg_match('/^\s*+(?:\S++\s*+){1,' . $words . '}/u', $str, $matches); |
|
7091 | + preg_match('/^\s*+(?:\S++\s*+){1,'.$words.'}/u', $str, $matches); |
|
7092 | 7092 | |
7093 | 7093 | if ( |
7094 | 7094 | !isset($matches[0]) |
@@ -7098,7 +7098,7 @@ discard block |
||
7098 | 7098 | return $str; |
7099 | 7099 | } |
7100 | 7100 | |
7101 | - return self::rtrim($matches[0]) . $strAddOn; |
|
7101 | + return self::rtrim($matches[0]).$strAddOn; |
|
7102 | 7102 | } |
7103 | 7103 | |
7104 | 7104 | /** |
@@ -7166,7 +7166,7 @@ discard block |
||
7166 | 7166 | $strReturn .= $break; |
7167 | 7167 | } |
7168 | 7168 | |
7169 | - return $strReturn . implode('', $chars); |
|
7169 | + return $strReturn.implode('', $chars); |
|
7170 | 7170 | } |
7171 | 7171 | |
7172 | 7172 | /** |
@@ -94,7 +94,7 @@ discard block |
||
94 | 94 | |
95 | 95 | $uri = preg_replace_callback( |
96 | 96 | '/[\x80-\xFF]+/', |
97 | - function ($m) { |
|
97 | + function($m) { |
|
98 | 98 | return urlencode($m[0]); |
99 | 99 | }, |
100 | 100 | $uri |
@@ -102,7 +102,7 @@ discard block |
||
102 | 102 | |
103 | 103 | $uri = preg_replace_callback( |
104 | 104 | '/(?:%[89A-F][0-9A-F])+/i', |
105 | - function ($m) { |
|
105 | + function($m) { |
|
106 | 106 | return urlencode(UTF8::encode('UTF-8', urldecode($m[0]))); |
107 | 107 | }, |
108 | 108 | $uri |
@@ -117,8 +117,8 @@ discard block |
||
117 | 117 | ) { |
118 | 118 | // Use ob_start() to buffer content and avoid problem of headers already sent... |
119 | 119 | $severProtocol = (isset($_SERVER['SERVER_PROTOCOL']) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.1'); |
120 | - header($severProtocol . ' 301 Moved Permanently'); |
|
121 | - header('Location: ' . $uri); |
|
120 | + header($severProtocol.' 301 Moved Permanently'); |
|
121 | + header('Location: '.$uri); |
|
122 | 122 | exit(); |
123 | 123 | } |
124 | 124 |