@@ -969,16 +969,16 @@ |
||
969 | 969 | $str = self::chr_and_parse_int($code_point); |
970 | 970 | } elseif (0x800 > $code_point) { |
971 | 971 | $str = self::chr_and_parse_int(0xC0 | $code_point >> 6) . |
972 | - self::chr_and_parse_int(0x80 | $code_point & 0x3F); |
|
972 | + self::chr_and_parse_int(0x80 | $code_point & 0x3F); |
|
973 | 973 | } elseif (0x10000 > $code_point) { |
974 | 974 | $str = self::chr_and_parse_int(0xE0 | $code_point >> 12) . |
975 | - self::chr_and_parse_int(0x80 | $code_point >> 6 & 0x3F) . |
|
976 | - self::chr_and_parse_int(0x80 | $code_point & 0x3F); |
|
975 | + self::chr_and_parse_int(0x80 | $code_point >> 6 & 0x3F) . |
|
976 | + self::chr_and_parse_int(0x80 | $code_point & 0x3F); |
|
977 | 977 | } else { |
978 | 978 | $str = self::chr_and_parse_int(0xF0 | $code_point >> 18) . |
979 | - self::chr_and_parse_int(0x80 | $code_point >> 12 & 0x3F) . |
|
980 | - self::chr_and_parse_int(0x80 | $code_point >> 6 & 0x3F) . |
|
981 | - self::chr_and_parse_int(0x80 | $code_point & 0x3F); |
|
979 | + self::chr_and_parse_int(0x80 | $code_point >> 12 & 0x3F) . |
|
980 | + self::chr_and_parse_int(0x80 | $code_point >> 6 & 0x3F) . |
|
981 | + self::chr_and_parse_int(0x80 | $code_point & 0x3F); |
|
982 | 982 | } |
983 | 983 | |
984 | 984 | if ($encoding !== 'UTF-8') { |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types=1); |
|
3 | +declare(strict_types = 1); |
|
4 | 4 | |
5 | 5 | namespace voku\helper; |
6 | 6 | |
@@ -853,7 +853,7 @@ discard block |
||
853 | 853 | public static function add_bom_to_string($str) |
854 | 854 | { |
855 | 855 | if (self::string_has_bom($str) === false) { |
856 | - $str = self::bom() . $str; |
|
856 | + $str = self::bom().$str; |
|
857 | 857 | } |
858 | 858 | |
859 | 859 | return $str; |
@@ -960,7 +960,7 @@ discard block |
||
960 | 960 | |
961 | 961 | // use static cache, only if there is no support for "\IntlChar" |
962 | 962 | static $CHAR_CACHE = array(); |
963 | - $cacheKey = $code_point . $encoding; |
|
963 | + $cacheKey = $code_point.$encoding; |
|
964 | 964 | if (isset($CHAR_CACHE[$cacheKey]) === true) { |
965 | 965 | return $CHAR_CACHE[$cacheKey]; |
966 | 966 | } |
@@ -968,16 +968,16 @@ discard block |
||
968 | 968 | if (0x80 > $code_point %= 0x200000) { |
969 | 969 | $str = self::chr_and_parse_int($code_point); |
970 | 970 | } elseif (0x800 > $code_point) { |
971 | - $str = self::chr_and_parse_int(0xC0 | $code_point >> 6) . |
|
971 | + $str = self::chr_and_parse_int(0xC0 | $code_point >> 6). |
|
972 | 972 | self::chr_and_parse_int(0x80 | $code_point & 0x3F); |
973 | 973 | } elseif (0x10000 > $code_point) { |
974 | - $str = self::chr_and_parse_int(0xE0 | $code_point >> 12) . |
|
975 | - self::chr_and_parse_int(0x80 | $code_point >> 6 & 0x3F) . |
|
974 | + $str = self::chr_and_parse_int(0xE0 | $code_point >> 12). |
|
975 | + self::chr_and_parse_int(0x80 | $code_point >> 6 & 0x3F). |
|
976 | 976 | self::chr_and_parse_int(0x80 | $code_point & 0x3F); |
977 | 977 | } else { |
978 | - $str = self::chr_and_parse_int(0xF0 | $code_point >> 18) . |
|
979 | - self::chr_and_parse_int(0x80 | $code_point >> 12 & 0x3F) . |
|
980 | - self::chr_and_parse_int(0x80 | $code_point >> 6 & 0x3F) . |
|
978 | + $str = self::chr_and_parse_int(0xF0 | $code_point >> 18). |
|
979 | + self::chr_and_parse_int(0x80 | $code_point >> 12 & 0x3F). |
|
980 | + self::chr_and_parse_int(0x80 | $code_point >> 6 & 0x3F). |
|
981 | 981 | self::chr_and_parse_int(0x80 | $code_point & 0x3F); |
982 | 982 | } |
983 | 983 | |
@@ -1274,7 +1274,7 @@ discard block |
||
1274 | 1274 | $flags = ENT_QUOTES; |
1275 | 1275 | } |
1276 | 1276 | |
1277 | - return self::html_entity_decode('&#' . $int . ';', $flags); |
|
1277 | + return self::html_entity_decode('&#'.$int.';', $flags); |
|
1278 | 1278 | } |
1279 | 1279 | |
1280 | 1280 | /** |
@@ -1351,7 +1351,7 @@ discard block |
||
1351 | 1351 | && |
1352 | 1352 | self::$SUPPORT['mbstring'] === false |
1353 | 1353 | ) { |
1354 | - trigger_error('UTF8::encode() without mbstring cannot handle "' . $encoding . '" encoding', E_USER_WARNING); |
|
1354 | + trigger_error('UTF8::encode() without mbstring cannot handle "'.$encoding.'" encoding', E_USER_WARNING); |
|
1355 | 1355 | } |
1356 | 1356 | |
1357 | 1357 | $strEncoded = \mb_convert_encoding( |
@@ -1560,7 +1560,7 @@ discard block |
||
1560 | 1560 | ) { |
1561 | 1561 | // Prevent leading combining chars |
1562 | 1562 | // for NFC-safe concatenations. |
1563 | - $var = $leading_combining . $var; |
|
1563 | + $var = $leading_combining.$var; |
|
1564 | 1564 | } |
1565 | 1565 | } |
1566 | 1566 | |
@@ -1981,7 +1981,7 @@ discard block |
||
1981 | 1981 | */ |
1982 | 1982 | private static function getData($file) |
1983 | 1983 | { |
1984 | - $file = __DIR__ . '/data/' . $file . '.php'; |
|
1984 | + $file = __DIR__.'/data/'.$file.'.php'; |
|
1985 | 1985 | if (file_exists($file)) { |
1986 | 1986 | /** @noinspection PhpIncludeInspection */ |
1987 | 1987 | return require $file; |
@@ -2100,7 +2100,7 @@ discard block |
||
2100 | 2100 | return implode( |
2101 | 2101 | '', |
2102 | 2102 | array_map( |
2103 | - function ($data) use ($keepAsciiChars, $encoding) { |
|
2103 | + function($data) use ($keepAsciiChars, $encoding) { |
|
2104 | 2104 | return UTF8::single_chr_html_encode($data, $keepAsciiChars, $encoding); |
2105 | 2105 | }, |
2106 | 2106 | self::split($str) |
@@ -2219,7 +2219,7 @@ discard block |
||
2219 | 2219 | |
2220 | 2220 | $str = preg_replace_callback( |
2221 | 2221 | "/&#\d{2,6};/", |
2222 | - function ($matches) use ($encoding) { |
|
2222 | + function($matches) use ($encoding) { |
|
2223 | 2223 | $returnTmp = \mb_convert_encoding($matches[0], $encoding, 'HTML-ENTITIES'); |
2224 | 2224 | |
2225 | 2225 | if ($returnTmp !== '"' && $returnTmp !== "'") { |
@@ -2543,9 +2543,9 @@ discard block |
||
2543 | 2543 | if ((int)$int === $int) { |
2544 | 2544 | $hex = dechex($int); |
2545 | 2545 | |
2546 | - $hex = (strlen($hex) < 4 ? substr('0000' . $hex, -4) : $hex); |
|
2546 | + $hex = (strlen($hex) < 4 ? substr('0000'.$hex, -4) : $hex); |
|
2547 | 2547 | |
2548 | - return $pfix . $hex; |
|
2548 | + return $pfix.$hex; |
|
2549 | 2549 | } |
2550 | 2550 | |
2551 | 2551 | return ''; |
@@ -3266,7 +3266,7 @@ discard block |
||
3266 | 3266 | */ |
3267 | 3267 | public static function lcfirst($str) |
3268 | 3268 | { |
3269 | - return self::strtolower(self::substr($str, 0, 1)) . self::substr($str, 1); |
|
3269 | + return self::strtolower(self::substr($str, 0, 1)).self::substr($str, 1); |
|
3270 | 3270 | } |
3271 | 3271 | |
3272 | 3272 | /** |
@@ -3290,7 +3290,7 @@ discard block |
||
3290 | 3290 | return preg_replace('/^[\pZ\pC]+/u', '', $str); |
3291 | 3291 | } |
3292 | 3292 | |
3293 | - return preg_replace('/^' . self::rxClass($chars) . '+/u', '', $str); |
|
3293 | + return preg_replace('/^'.self::rxClass($chars).'+/u', '', $str); |
|
3294 | 3294 | } |
3295 | 3295 | |
3296 | 3296 | /** |
@@ -3804,7 +3804,7 @@ discard block |
||
3804 | 3804 | if (is_array($what) === true) { |
3805 | 3805 | /** @noinspection ForeachSourceInspection */ |
3806 | 3806 | foreach ($what as $item) { |
3807 | - $str = preg_replace('/(' . preg_quote($item, '/') . ')+/', $item, $str); |
|
3807 | + $str = preg_replace('/('.preg_quote($item, '/').')+/', $item, $str); |
|
3808 | 3808 | } |
3809 | 3809 | } |
3810 | 3810 | |
@@ -3917,7 +3917,7 @@ discard block |
||
3917 | 3917 | return preg_replace('/[\pZ\pC]+$/u', '', $str); |
3918 | 3918 | } |
3919 | 3919 | |
3920 | - return preg_replace('/' . self::rxClass($chars) . '+$/u', '', $str); |
|
3920 | + return preg_replace('/'.self::rxClass($chars).'+$/u', '', $str); |
|
3921 | 3921 | } |
3922 | 3922 | |
3923 | 3923 | /** |
@@ -3932,7 +3932,7 @@ discard block |
||
3932 | 3932 | { |
3933 | 3933 | static $RX_CLASSS_CACHE = array(); |
3934 | 3934 | |
3935 | - $cacheKey = $s . $class; |
|
3935 | + $cacheKey = $s.$class; |
|
3936 | 3936 | |
3937 | 3937 | if (isset($RX_CLASSS_CACHE[$cacheKey])) { |
3938 | 3938 | return $RX_CLASSS_CACHE[$cacheKey]; |
@@ -3944,7 +3944,7 @@ discard block |
||
3944 | 3944 | /** @noinspection SuspiciousLoopInspection */ |
3945 | 3945 | foreach (self::str_split($s) as $s) { |
3946 | 3946 | if ('-' === $s) { |
3947 | - $class[0] = '-' . $class[0]; |
|
3947 | + $class[0] = '-'.$class[0]; |
|
3948 | 3948 | } elseif (!isset($s[2])) { |
3949 | 3949 | $class[0] .= preg_quote($s, '/'); |
3950 | 3950 | } elseif (1 === self::strlen($s)) { |
@@ -3955,13 +3955,13 @@ discard block |
||
3955 | 3955 | } |
3956 | 3956 | |
3957 | 3957 | if ($class[0]) { |
3958 | - $class[0] = '[' . $class[0] . ']'; |
|
3958 | + $class[0] = '['.$class[0].']'; |
|
3959 | 3959 | } |
3960 | 3960 | |
3961 | 3961 | if (1 === count($class)) { |
3962 | 3962 | $return = $class[0]; |
3963 | 3963 | } else { |
3964 | - $return = '(?:' . implode('|', $class) . ')'; |
|
3964 | + $return = '(?:'.implode('|', $class).')'; |
|
3965 | 3965 | } |
3966 | 3966 | |
3967 | 3967 | $RX_CLASSS_CACHE[$cacheKey] = $return; |
@@ -3979,7 +3979,7 @@ discard block |
||
3979 | 3979 | } |
3980 | 3980 | |
3981 | 3981 | foreach (self::$SUPPORT as $utf8Support) { |
3982 | - echo $utf8Support . "\n<br>"; |
|
3982 | + echo $utf8Support."\n<br>"; |
|
3983 | 3983 | } |
3984 | 3984 | } |
3985 | 3985 | |
@@ -4013,7 +4013,7 @@ discard block |
||
4013 | 4013 | $encoding = self::normalize_encoding($encoding, 'UTF-8'); |
4014 | 4014 | } |
4015 | 4015 | |
4016 | - return '&#' . self::ord($char, $encoding) . ';'; |
|
4016 | + return '&#'.self::ord($char, $encoding).';'; |
|
4017 | 4017 | } |
4018 | 4018 | |
4019 | 4019 | /** |
@@ -4072,7 +4072,7 @@ discard block |
||
4072 | 4072 | ) { |
4073 | 4073 | |
4074 | 4074 | if (($str[$i + 1] & "\xC0") === "\x80") { |
4075 | - $ret[] = $str[$i] . $str[$i + 1]; |
|
4075 | + $ret[] = $str[$i].$str[$i + 1]; |
|
4076 | 4076 | |
4077 | 4077 | $i++; |
4078 | 4078 | } |
@@ -4088,7 +4088,7 @@ discard block |
||
4088 | 4088 | && |
4089 | 4089 | ($str[$i + 2] & "\xC0") === "\x80" |
4090 | 4090 | ) { |
4091 | - $ret[] = $str[$i] . $str[$i + 1] . $str[$i + 2]; |
|
4091 | + $ret[] = $str[$i].$str[$i + 1].$str[$i + 2]; |
|
4092 | 4092 | |
4093 | 4093 | $i += 2; |
4094 | 4094 | } |
@@ -4106,7 +4106,7 @@ discard block |
||
4106 | 4106 | && |
4107 | 4107 | ($str[$i + 3] & "\xC0") === "\x80" |
4108 | 4108 | ) { |
4109 | - $ret[] = $str[$i] . $str[$i + 1] . $str[$i + 2] . $str[$i + 3]; |
|
4109 | + $ret[] = $str[$i].$str[$i + 1].$str[$i + 2].$str[$i + 3]; |
|
4110 | 4110 | |
4111 | 4111 | $i += 3; |
4112 | 4112 | } |
@@ -4119,7 +4119,7 @@ discard block |
||
4119 | 4119 | $ret = array_chunk($ret, $length); |
4120 | 4120 | |
4121 | 4121 | return array_map( |
4122 | - function ($item) { |
|
4122 | + function($item) { |
|
4123 | 4123 | return implode('', $item); |
4124 | 4124 | }, $ret |
4125 | 4125 | ); |
@@ -4218,7 +4218,7 @@ discard block |
||
4218 | 4218 | foreach (self::$ICONV_ENCODING as $encodingTmp) { |
4219 | 4219 | # INFO: //IGNORE and //TRANSLIT still throw notice |
4220 | 4220 | /** @noinspection PhpUsageOfSilenceOperatorInspection */ |
4221 | - if (md5(@\iconv($encodingTmp, $encodingTmp . '//IGNORE', $str)) === $md5) { |
|
4221 | + if (md5(@\iconv($encodingTmp, $encodingTmp.'//IGNORE', $str)) === $md5) { |
|
4222 | 4222 | return $encodingTmp; |
4223 | 4223 | } |
4224 | 4224 | } |
@@ -4308,7 +4308,7 @@ discard block |
||
4308 | 4308 | if ('' === $s .= '') { |
4309 | 4309 | $s = '/^(?<=.)$/'; |
4310 | 4310 | } else { |
4311 | - $s = '/' . preg_quote($s, '/') . '/ui'; |
|
4311 | + $s = '/'.preg_quote($s, '/').'/ui'; |
|
4312 | 4312 | } |
4313 | 4313 | } |
4314 | 4314 | |
@@ -4366,7 +4366,7 @@ discard block |
||
4366 | 4366 | } |
4367 | 4367 | |
4368 | 4368 | if (self::substr($str, $length - 1, 1) === ' ') { |
4369 | - return self::substr($str, 0, $length - 1) . $strAddOn; |
|
4369 | + return self::substr($str, 0, $length - 1).$strAddOn; |
|
4370 | 4370 | } |
4371 | 4371 | |
4372 | 4372 | $str = self::substr($str, 0, $length); |
@@ -4375,9 +4375,9 @@ discard block |
||
4375 | 4375 | $new_str = implode(' ', $array); |
4376 | 4376 | |
4377 | 4377 | if ($new_str === '') { |
4378 | - $str = self::substr($str, 0, $length - 1) . $strAddOn; |
|
4378 | + $str = self::substr($str, 0, $length - 1).$strAddOn; |
|
4379 | 4379 | } else { |
4380 | - $str = $new_str . $strAddOn; |
|
4380 | + $str = $new_str.$strAddOn; |
|
4381 | 4381 | } |
4382 | 4382 | |
4383 | 4383 | return $str; |
@@ -4432,7 +4432,7 @@ discard block |
||
4432 | 4432 | $pre = ''; |
4433 | 4433 | } |
4434 | 4434 | |
4435 | - return $pre . $str . $post; |
|
4435 | + return $pre.$str.$post; |
|
4436 | 4436 | } |
4437 | 4437 | |
4438 | 4438 | return $str; |
@@ -4582,7 +4582,7 @@ discard block |
||
4582 | 4582 | } |
4583 | 4583 | |
4584 | 4584 | /** @noinspection PhpInternalEntityUsedInspection */ |
4585 | - preg_match_all('/' . Grapheme::GRAPHEME_CLUSTER_RX . '/u', $str, $a); |
|
4585 | + preg_match_all('/'.Grapheme::GRAPHEME_CLUSTER_RX.'/u', $str, $a); |
|
4586 | 4586 | $a = $a[0]; |
4587 | 4587 | |
4588 | 4588 | if ($len === 1) { |
@@ -4777,7 +4777,7 @@ discard block |
||
4777 | 4777 | public static function strcmp($str1, $str2) |
4778 | 4778 | { |
4779 | 4779 | /** @noinspection PhpUndefinedClassInspection */ |
4780 | - return $str1 . '' === $str2 . '' ? 0 : strcmp( |
|
4780 | + return $str1.'' === $str2.'' ? 0 : strcmp( |
|
4781 | 4781 | \Normalizer::normalize($str1, \Normalizer::NFD), |
4782 | 4782 | \Normalizer::normalize($str2, \Normalizer::NFD) |
4783 | 4783 | ); |
@@ -4808,7 +4808,7 @@ discard block |
||
4808 | 4808 | return null; |
4809 | 4809 | } |
4810 | 4810 | |
4811 | - if (preg_match('/^(.*?)' . self::rxClass($charList) . '/us', $str, $length)) { |
|
4811 | + if (preg_match('/^(.*?)'.self::rxClass($charList).'/us', $str, $length)) { |
|
4812 | 4812 | /** @noinspection OffsetOperationsInspection */ |
4813 | 4813 | return self::strlen($length[1]); |
4814 | 4814 | } |
@@ -5023,7 +5023,7 @@ discard block |
||
5023 | 5023 | && |
5024 | 5024 | self::$SUPPORT['mbstring'] === false |
5025 | 5025 | ) { |
5026 | - trigger_error('UTF8::stristr() without mbstring cannot handle "' . $encoding . '" encoding', E_USER_WARNING); |
|
5026 | + trigger_error('UTF8::stristr() without mbstring cannot handle "'.$encoding.'" encoding', E_USER_WARNING); |
|
5027 | 5027 | } |
5028 | 5028 | |
5029 | 5029 | if (self::$SUPPORT['mbstring'] === true) { |
@@ -5034,7 +5034,7 @@ discard block |
||
5034 | 5034 | return \grapheme_stristr($haystack, $needle, $before_needle); |
5035 | 5035 | } |
5036 | 5036 | |
5037 | - preg_match('/^(.*?)' . preg_quote($needle, '/') . '/usi', $haystack, $match); |
|
5037 | + preg_match('/^(.*?)'.preg_quote($needle, '/').'/usi', $haystack, $match); |
|
5038 | 5038 | |
5039 | 5039 | if (!isset($match[1])) { |
5040 | 5040 | return false; |
@@ -5098,7 +5098,7 @@ discard block |
||
5098 | 5098 | && |
5099 | 5099 | self::$SUPPORT['iconv'] === false |
5100 | 5100 | ) { |
5101 | - trigger_error('UTF8::strlen() without mbstring / iconv cannot handle "' . $encoding . '" encoding', E_USER_WARNING); |
|
5101 | + trigger_error('UTF8::strlen() without mbstring / iconv cannot handle "'.$encoding.'" encoding', E_USER_WARNING); |
|
5102 | 5102 | } |
5103 | 5103 | |
5104 | 5104 | if ( |
@@ -5177,7 +5177,7 @@ discard block |
||
5177 | 5177 | */ |
5178 | 5178 | public static function strnatcmp($str1, $str2) |
5179 | 5179 | { |
5180 | - return $str1 . '' === $str2 . '' ? 0 : strnatcmp(self::strtonatfold($str1), self::strtonatfold($str2)); |
|
5180 | + return $str1.'' === $str2.'' ? 0 : strnatcmp(self::strtonatfold($str1), self::strtonatfold($str2)); |
|
5181 | 5181 | } |
5182 | 5182 | |
5183 | 5183 | /** |
@@ -5238,7 +5238,7 @@ discard block |
||
5238 | 5238 | return false; |
5239 | 5239 | } |
5240 | 5240 | |
5241 | - if (preg_match('/' . self::rxClass($char_list) . '/us', $haystack, $m)) { |
|
5241 | + if (preg_match('/'.self::rxClass($char_list).'/us', $haystack, $m)) { |
|
5242 | 5242 | return substr($haystack, strpos($haystack, $m[0])); |
5243 | 5243 | } else { |
5244 | 5244 | return false; |
@@ -5307,7 +5307,7 @@ discard block |
||
5307 | 5307 | && |
5308 | 5308 | self::$SUPPORT['mbstring'] === false |
5309 | 5309 | ) { |
5310 | - trigger_error('UTF8::strpos() without mbstring / iconv cannot handle "' . $encoding . '" encoding', E_USER_WARNING); |
|
5310 | + trigger_error('UTF8::strpos() without mbstring / iconv cannot handle "'.$encoding.'" encoding', E_USER_WARNING); |
|
5311 | 5311 | } |
5312 | 5312 | |
5313 | 5313 | if ( |
@@ -5523,7 +5523,7 @@ discard block |
||
5523 | 5523 | && |
5524 | 5524 | self::$SUPPORT['mbstring'] === false |
5525 | 5525 | ) { |
5526 | - trigger_error('UTF8::strripos() without mbstring cannot handle "' . $encoding . '" encoding', E_USER_WARNING); |
|
5526 | + trigger_error('UTF8::strripos() without mbstring cannot handle "'.$encoding.'" encoding', E_USER_WARNING); |
|
5527 | 5527 | } |
5528 | 5528 | |
5529 | 5529 | if (self::$SUPPORT['mbstring'] === true) { |
@@ -5603,7 +5603,7 @@ discard block |
||
5603 | 5603 | && |
5604 | 5604 | self::$SUPPORT['mbstring'] === false |
5605 | 5605 | ) { |
5606 | - trigger_error('UTF8::strrpos() without mbstring cannot handle "' . $encoding . '" encoding', E_USER_WARNING); |
|
5606 | + trigger_error('UTF8::strrpos() without mbstring cannot handle "'.$encoding.'" encoding', E_USER_WARNING); |
|
5607 | 5607 | } |
5608 | 5608 | |
5609 | 5609 | if (self::$SUPPORT['mbstring'] === true) { |
@@ -5663,7 +5663,7 @@ discard block |
||
5663 | 5663 | return 0; |
5664 | 5664 | } |
5665 | 5665 | |
5666 | - return preg_match('/^' . self::rxClass($mask) . '+/u', $str, $str) ? self::strlen($str[0]) : 0; |
|
5666 | + return preg_match('/^'.self::rxClass($mask).'+/u', $str, $str) ? self::strlen($str[0]) : 0; |
|
5667 | 5667 | } |
5668 | 5668 | |
5669 | 5669 | /** |
@@ -5709,7 +5709,7 @@ discard block |
||
5709 | 5709 | && |
5710 | 5710 | self::$SUPPORT['mbstring'] === false |
5711 | 5711 | ) { |
5712 | - trigger_error('UTF8::strstr() without mbstring cannot handle "' . $encoding . '" encoding', E_USER_WARNING); |
|
5712 | + trigger_error('UTF8::strstr() without mbstring cannot handle "'.$encoding.'" encoding', E_USER_WARNING); |
|
5713 | 5713 | } |
5714 | 5714 | |
5715 | 5715 | if (self::$SUPPORT['mbstring'] === true) { |
@@ -5726,7 +5726,7 @@ discard block |
||
5726 | 5726 | } |
5727 | 5727 | } |
5728 | 5728 | |
5729 | - preg_match('/^(.*?)' . preg_quote($needle, '/') . '/us', $haystack, $match); |
|
5729 | + preg_match('/^(.*?)'.preg_quote($needle, '/').'/us', $haystack, $match); |
|
5730 | 5730 | |
5731 | 5731 | if (!isset($match[1])) { |
5732 | 5732 | return false; |
@@ -5990,7 +5990,7 @@ discard block |
||
5990 | 5990 | && |
5991 | 5991 | self::$SUPPORT['mbstring'] === false |
5992 | 5992 | ) { |
5993 | - trigger_error('UTF8::substr() without mbstring cannot handle "' . $encoding . '" encoding', E_USER_WARNING); |
|
5993 | + trigger_error('UTF8::substr() without mbstring cannot handle "'.$encoding.'" encoding', E_USER_WARNING); |
|
5994 | 5994 | } |
5995 | 5995 | |
5996 | 5996 | if (self::$SUPPORT['mbstring'] === true) { |
@@ -6103,14 +6103,14 @@ discard block |
||
6103 | 6103 | && |
6104 | 6104 | self::$SUPPORT['mbstring'] === false |
6105 | 6105 | ) { |
6106 | - trigger_error('UTF8::substr_count() without mbstring cannot handle "' . $encoding . '" encoding', E_USER_WARNING); |
|
6106 | + trigger_error('UTF8::substr_count() without mbstring cannot handle "'.$encoding.'" encoding', E_USER_WARNING); |
|
6107 | 6107 | } |
6108 | 6108 | |
6109 | 6109 | if (self::$SUPPORT['mbstring'] === true) { |
6110 | 6110 | return \mb_substr_count($haystack, $needle, $encoding); |
6111 | 6111 | } |
6112 | 6112 | |
6113 | - preg_match_all('/' . preg_quote($needle, '/') . '/us', $haystack, $matches, PREG_SET_ORDER); |
|
6113 | + preg_match_all('/'.preg_quote($needle, '/').'/us', $haystack, $matches, PREG_SET_ORDER); |
|
6114 | 6114 | |
6115 | 6115 | return count($matches); |
6116 | 6116 | } |
@@ -6357,7 +6357,7 @@ discard block |
||
6357 | 6357 | |
6358 | 6358 | $strSwappedCase = preg_replace_callback( |
6359 | 6359 | '/[\S]/u', |
6360 | - function ($match) use ($encoding) { |
|
6360 | + function($match) use ($encoding) { |
|
6361 | 6361 | $marchToUpper = UTF8::strtoupper($match[0], $encoding); |
6362 | 6362 | |
6363 | 6363 | if ($match[0] === $marchToUpper) { |
@@ -6687,13 +6687,13 @@ discard block |
||
6687 | 6687 | $c2 = $i + 1 >= $max ? "\x00" : $str[$i + 1]; |
6688 | 6688 | |
6689 | 6689 | if ($c2 >= "\x80" && $c2 <= "\xBF") { // yeah, almost sure it's UTF8 already |
6690 | - $buf .= $c1 . $c2; |
|
6690 | + $buf .= $c1.$c2; |
|
6691 | 6691 | $i++; |
6692 | 6692 | } else { // not valid UTF8 - convert it |
6693 | 6693 | $cc1tmp = ord($c1) / 64; |
6694 | 6694 | $cc1 = self::chr_and_parse_int($cc1tmp) | "\xC0"; |
6695 | 6695 | $cc2 = ($c1 & "\x3F") | "\x80"; |
6696 | - $buf .= $cc1 . $cc2; |
|
6696 | + $buf .= $cc1.$cc2; |
|
6697 | 6697 | } |
6698 | 6698 | |
6699 | 6699 | } elseif ($c1 >= "\xE0" && $c1 <= "\xEF") { // looks like 3 bytes UTF8 |
@@ -6702,13 +6702,13 @@ discard block |
||
6702 | 6702 | $c3 = $i + 2 >= $max ? "\x00" : $str[$i + 2]; |
6703 | 6703 | |
6704 | 6704 | if ($c2 >= "\x80" && $c2 <= "\xBF" && $c3 >= "\x80" && $c3 <= "\xBF") { // yeah, almost sure it's UTF8 already |
6705 | - $buf .= $c1 . $c2 . $c3; |
|
6705 | + $buf .= $c1.$c2.$c3; |
|
6706 | 6706 | $i += 2; |
6707 | 6707 | } else { // not valid UTF8 - convert it |
6708 | 6708 | $cc1tmp = ord($c1) / 64; |
6709 | 6709 | $cc1 = self::chr_and_parse_int($cc1tmp) | "\xC0"; |
6710 | 6710 | $cc2 = ($c1 & "\x3F") | "\x80"; |
6711 | - $buf .= $cc1 . $cc2; |
|
6711 | + $buf .= $cc1.$cc2; |
|
6712 | 6712 | } |
6713 | 6713 | |
6714 | 6714 | } elseif ($c1 >= "\xF0" && $c1 <= "\xF7") { // looks like 4 bytes UTF8 |
@@ -6718,20 +6718,20 @@ discard block |
||
6718 | 6718 | $c4 = $i + 3 >= $max ? "\x00" : $str[$i + 3]; |
6719 | 6719 | |
6720 | 6720 | if ($c2 >= "\x80" && $c2 <= "\xBF" && $c3 >= "\x80" && $c3 <= "\xBF" && $c4 >= "\x80" && $c4 <= "\xBF") { // yeah, almost sure it's UTF8 already |
6721 | - $buf .= $c1 . $c2 . $c3 . $c4; |
|
6721 | + $buf .= $c1.$c2.$c3.$c4; |
|
6722 | 6722 | $i += 3; |
6723 | 6723 | } else { // not valid UTF8 - convert it |
6724 | 6724 | $cc1tmp = ord($c1) / 64; |
6725 | 6725 | $cc1 = self::chr_and_parse_int($cc1tmp) | "\xC0"; |
6726 | 6726 | $cc2 = ($c1 & "\x3F") | "\x80"; |
6727 | - $buf .= $cc1 . $cc2; |
|
6727 | + $buf .= $cc1.$cc2; |
|
6728 | 6728 | } |
6729 | 6729 | |
6730 | 6730 | } else { // doesn't look like UTF8, but should be converted |
6731 | 6731 | $cc1tmp = ord($c1) / 64; |
6732 | 6732 | $cc1 = self::chr_and_parse_int($cc1tmp) | "\xC0"; |
6733 | 6733 | $cc2 = ($c1 & "\x3F") | "\x80"; |
6734 | - $buf .= $cc1 . $cc2; |
|
6734 | + $buf .= $cc1.$cc2; |
|
6735 | 6735 | } |
6736 | 6736 | |
6737 | 6737 | } elseif (($c1 & "\xC0") === "\x80") { // needs conversion |
@@ -6742,7 +6742,7 @@ discard block |
||
6742 | 6742 | } else { |
6743 | 6743 | $cc1 = self::chr_and_parse_int($ordC1 / 64) | "\xC0"; |
6744 | 6744 | $cc2 = ($c1 & "\x3F") | "\x80"; |
6745 | - $buf .= $cc1 . $cc2; |
|
6745 | + $buf .= $cc1.$cc2; |
|
6746 | 6746 | } |
6747 | 6747 | |
6748 | 6748 | } else { // it doesn't need conversion |
@@ -6753,7 +6753,7 @@ discard block |
||
6753 | 6753 | // decode unicode escape sequences |
6754 | 6754 | $buf = preg_replace_callback( |
6755 | 6755 | '/\\\\u([0-9a-f]{4})/i', |
6756 | - function ($match) { |
|
6756 | + function($match) { |
|
6757 | 6757 | return \mb_convert_encoding(pack('H*', $match[1]), 'UTF-8', 'UCS-2BE'); |
6758 | 6758 | }, |
6759 | 6759 | $buf |
@@ -6807,7 +6807,7 @@ discard block |
||
6807 | 6807 | */ |
6808 | 6808 | public static function ucfirst($str, $encoding = 'UTF-8', $cleanUtf8 = false) |
6809 | 6809 | { |
6810 | - return self::strtoupper(self::substr($str, 0, 1, $encoding, $cleanUtf8), $encoding, $cleanUtf8) . self::substr($str, 1, null, $encoding, $cleanUtf8); |
|
6810 | + return self::strtoupper(self::substr($str, 0, 1, $encoding, $cleanUtf8), $encoding, $cleanUtf8).self::substr($str, 1, null, $encoding, $cleanUtf8); |
|
6811 | 6811 | } |
6812 | 6812 | |
6813 | 6813 | /** |
@@ -7282,7 +7282,7 @@ discard block |
||
7282 | 7282 | return ''; |
7283 | 7283 | } |
7284 | 7284 | |
7285 | - preg_match('/^\s*+(?:\S++\s*+){1,' . $words . '}/u', $str, $matches); |
|
7285 | + preg_match('/^\s*+(?:\S++\s*+){1,'.$words.'}/u', $str, $matches); |
|
7286 | 7286 | |
7287 | 7287 | if ( |
7288 | 7288 | !isset($matches[0]) |
@@ -7292,7 +7292,7 @@ discard block |
||
7292 | 7292 | return $str; |
7293 | 7293 | } |
7294 | 7294 | |
7295 | - return self::rtrim($matches[0]) . $strAddOn; |
|
7295 | + return self::rtrim($matches[0]).$strAddOn; |
|
7296 | 7296 | } |
7297 | 7297 | |
7298 | 7298 | /** |
@@ -7360,7 +7360,7 @@ discard block |
||
7360 | 7360 | $strReturn .= $break; |
7361 | 7361 | } |
7362 | 7362 | |
7363 | - return $strReturn . implode('', $chars); |
|
7363 | + return $strReturn.implode('', $chars); |
|
7364 | 7364 | } |
7365 | 7365 | |
7366 | 7366 | /** |