@@ -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 | |
@@ -1254,7 +1254,7 @@ discard block |
||
| 1254 | 1254 | $flags = ENT_QUOTES; |
| 1255 | 1255 | } |
| 1256 | 1256 | |
| 1257 | - return self::html_entity_decode('&#' . $int . ';', $flags); |
|
| 1257 | + return self::html_entity_decode('&#'.$int.';', $flags); |
|
| 1258 | 1258 | } |
| 1259 | 1259 | |
| 1260 | 1260 | /** |
@@ -1331,7 +1331,7 @@ discard block |
||
| 1331 | 1331 | && |
| 1332 | 1332 | self::$support['mbstring'] === false |
| 1333 | 1333 | ) { |
| 1334 | - trigger_error('UTF8::encode() without mbstring cannot handle "' . $encoding . '" encoding', E_USER_WARNING); |
|
| 1334 | + trigger_error('UTF8::encode() without mbstring cannot handle "'.$encoding.'" encoding', E_USER_WARNING); |
|
| 1335 | 1335 | } |
| 1336 | 1336 | |
| 1337 | 1337 | $strEncoded = \mb_convert_encoding( |
@@ -1530,7 +1530,7 @@ discard block |
||
| 1530 | 1530 | ) { |
| 1531 | 1531 | // Prevent leading combining chars |
| 1532 | 1532 | // for NFC-safe concatenations. |
| 1533 | - $var = $leading_combining . $var; |
|
| 1533 | + $var = $leading_combining.$var; |
|
| 1534 | 1534 | } |
| 1535 | 1535 | } |
| 1536 | 1536 | |
@@ -1951,7 +1951,7 @@ discard block |
||
| 1951 | 1951 | */ |
| 1952 | 1952 | private static function getData($file) |
| 1953 | 1953 | { |
| 1954 | - $file = __DIR__ . '/data/' . $file . '.php'; |
|
| 1954 | + $file = __DIR__.'/data/'.$file.'.php'; |
|
| 1955 | 1955 | if (file_exists($file)) { |
| 1956 | 1956 | /** @noinspection PhpIncludeInspection */ |
| 1957 | 1957 | return require $file; |
@@ -2068,7 +2068,7 @@ discard block |
||
| 2068 | 2068 | return implode( |
| 2069 | 2069 | '', |
| 2070 | 2070 | array_map( |
| 2071 | - function ($data) use ($keepAsciiChars, $encoding) { |
|
| 2071 | + function($data) use ($keepAsciiChars, $encoding) { |
|
| 2072 | 2072 | return UTF8::single_chr_html_encode($data, $keepAsciiChars, $encoding); |
| 2073 | 2073 | }, |
| 2074 | 2074 | self::split($str) |
@@ -2187,7 +2187,7 @@ discard block |
||
| 2187 | 2187 | |
| 2188 | 2188 | $str = preg_replace_callback( |
| 2189 | 2189 | "/&#\d{2,6};/", |
| 2190 | - function ($matches) use ($encoding) { |
|
| 2190 | + function($matches) use ($encoding) { |
|
| 2191 | 2191 | $returnTmp = \mb_convert_encoding($matches[0], $encoding, 'HTML-ENTITIES'); |
| 2192 | 2192 | |
| 2193 | 2193 | if ($returnTmp !== '"' && $returnTmp !== "'") { |
@@ -2511,9 +2511,9 @@ discard block |
||
| 2511 | 2511 | if (ctype_digit((string)$int)) { |
| 2512 | 2512 | $hex = dechex((int)$int); |
| 2513 | 2513 | |
| 2514 | - $hex = (strlen($hex) < 4 ? substr('0000' . $hex, -4) : $hex); |
|
| 2514 | + $hex = (strlen($hex) < 4 ? substr('0000'.$hex, -4) : $hex); |
|
| 2515 | 2515 | |
| 2516 | - return $pfix . $hex; |
|
| 2516 | + return $pfix.$hex; |
|
| 2517 | 2517 | } |
| 2518 | 2518 | |
| 2519 | 2519 | return ''; |
@@ -3217,7 +3217,7 @@ discard block |
||
| 3217 | 3217 | */ |
| 3218 | 3218 | public static function lcfirst($str) |
| 3219 | 3219 | { |
| 3220 | - return self::strtolower(self::substr($str, 0, 1)) . self::substr($str, 1); |
|
| 3220 | + return self::strtolower(self::substr($str, 0, 1)).self::substr($str, 1); |
|
| 3221 | 3221 | } |
| 3222 | 3222 | |
| 3223 | 3223 | /** |
@@ -3241,7 +3241,7 @@ discard block |
||
| 3241 | 3241 | return preg_replace('/^[\pZ\pC]+/u', '', $str); |
| 3242 | 3242 | } |
| 3243 | 3243 | |
| 3244 | - return preg_replace('/^' . self::rxClass($chars) . '+/u', '', $str); |
|
| 3244 | + return preg_replace('/^'.self::rxClass($chars).'+/u', '', $str); |
|
| 3245 | 3245 | } |
| 3246 | 3246 | |
| 3247 | 3247 | /** |
@@ -3744,7 +3744,7 @@ discard block |
||
| 3744 | 3744 | if (is_array($what)) { |
| 3745 | 3745 | /** @noinspection ForeachSourceInspection */ |
| 3746 | 3746 | foreach ($what as $item) { |
| 3747 | - $str = preg_replace('/(' . preg_quote($item, '/') . ')+/', $item, $str); |
|
| 3747 | + $str = preg_replace('/('.preg_quote($item, '/').')+/', $item, $str); |
|
| 3748 | 3748 | } |
| 3749 | 3749 | } |
| 3750 | 3750 | |
@@ -3846,7 +3846,7 @@ discard block |
||
| 3846 | 3846 | return preg_replace('/[\pZ\pC]+$/u', '', $str); |
| 3847 | 3847 | } |
| 3848 | 3848 | |
| 3849 | - return preg_replace('/' . self::rxClass($chars) . '+$/u', '', $str); |
|
| 3849 | + return preg_replace('/'.self::rxClass($chars).'+$/u', '', $str); |
|
| 3850 | 3850 | } |
| 3851 | 3851 | |
| 3852 | 3852 | /** |
@@ -3861,7 +3861,7 @@ discard block |
||
| 3861 | 3861 | { |
| 3862 | 3862 | static $rxClassCache = array(); |
| 3863 | 3863 | |
| 3864 | - $cacheKey = $s . $class; |
|
| 3864 | + $cacheKey = $s.$class; |
|
| 3865 | 3865 | |
| 3866 | 3866 | if (isset($rxClassCache[$cacheKey])) { |
| 3867 | 3867 | return $rxClassCache[$cacheKey]; |
@@ -3873,7 +3873,7 @@ discard block |
||
| 3873 | 3873 | /** @noinspection SuspiciousLoopInspection */ |
| 3874 | 3874 | foreach (self::str_split($s) as $s) { |
| 3875 | 3875 | if ('-' === $s) { |
| 3876 | - $class[0] = '-' . $class[0]; |
|
| 3876 | + $class[0] = '-'.$class[0]; |
|
| 3877 | 3877 | } elseif (!isset($s[2])) { |
| 3878 | 3878 | $class[0] .= preg_quote($s, '/'); |
| 3879 | 3879 | } elseif (1 === self::strlen($s)) { |
@@ -3884,13 +3884,13 @@ discard block |
||
| 3884 | 3884 | } |
| 3885 | 3885 | |
| 3886 | 3886 | if ($class[0]) { |
| 3887 | - $class[0] = '[' . $class[0] . ']'; |
|
| 3887 | + $class[0] = '['.$class[0].']'; |
|
| 3888 | 3888 | } |
| 3889 | 3889 | |
| 3890 | 3890 | if (1 === count($class)) { |
| 3891 | 3891 | $return = $class[0]; |
| 3892 | 3892 | } else { |
| 3893 | - $return = '(?:' . implode('|', $class) . ')'; |
|
| 3893 | + $return = '(?:'.implode('|', $class).')'; |
|
| 3894 | 3894 | } |
| 3895 | 3895 | |
| 3896 | 3896 | $rxClassCache[$cacheKey] = $return; |
@@ -3908,7 +3908,7 @@ discard block |
||
| 3908 | 3908 | } |
| 3909 | 3909 | |
| 3910 | 3910 | foreach (self::$support as $utf8Support) { |
| 3911 | - echo $utf8Support . "\n<br>"; |
|
| 3911 | + echo $utf8Support."\n<br>"; |
|
| 3912 | 3912 | } |
| 3913 | 3913 | } |
| 3914 | 3914 | |
@@ -3942,7 +3942,7 @@ discard block |
||
| 3942 | 3942 | $encoding = self::normalize_encoding($encoding); |
| 3943 | 3943 | } |
| 3944 | 3944 | |
| 3945 | - return '&#' . self::ord($char, $encoding) . ';'; |
|
| 3945 | + return '&#'.self::ord($char, $encoding).';'; |
|
| 3946 | 3946 | } |
| 3947 | 3947 | |
| 3948 | 3948 | /** |
@@ -3994,19 +3994,19 @@ discard block |
||
| 3994 | 3994 | $ret[] = $str[$i]; |
| 3995 | 3995 | } elseif ((($str[$i] & "\xE0") === "\xC0") && isset($str[$i + 1])) { |
| 3996 | 3996 | if (($str[$i + 1] & "\xC0") === "\x80") { |
| 3997 | - $ret[] = $str[$i] . $str[$i + 1]; |
|
| 3997 | + $ret[] = $str[$i].$str[$i + 1]; |
|
| 3998 | 3998 | |
| 3999 | 3999 | $i++; |
| 4000 | 4000 | } |
| 4001 | 4001 | } elseif ((($str[$i] & "\xF0") === "\xE0") && isset($str[$i + 2])) { |
| 4002 | 4002 | if ((($str[$i + 1] & "\xC0") === "\x80") && (($str[$i + 2] & "\xC0") === "\x80")) { |
| 4003 | - $ret[] = $str[$i] . $str[$i + 1] . $str[$i + 2]; |
|
| 4003 | + $ret[] = $str[$i].$str[$i + 1].$str[$i + 2]; |
|
| 4004 | 4004 | |
| 4005 | 4005 | $i += 2; |
| 4006 | 4006 | } |
| 4007 | 4007 | } elseif ((($str[$i] & "\xF8") === "\xF0") && isset($str[$i + 3])) { |
| 4008 | 4008 | if ((($str[$i + 1] & "\xC0") === "\x80") && (($str[$i + 2] & "\xC0") === "\x80") && (($str[$i + 3] & "\xC0") === "\x80")) { |
| 4009 | - $ret[] = $str[$i] . $str[$i + 1] . $str[$i + 2] . $str[$i + 3]; |
|
| 4009 | + $ret[] = $str[$i].$str[$i + 1].$str[$i + 2].$str[$i + 3]; |
|
| 4010 | 4010 | |
| 4011 | 4011 | $i += 3; |
| 4012 | 4012 | } |
@@ -4018,7 +4018,7 @@ discard block |
||
| 4018 | 4018 | $ret = array_chunk($ret, $length); |
| 4019 | 4019 | |
| 4020 | 4020 | return array_map( |
| 4021 | - function ($item) { |
|
| 4021 | + function($item) { |
|
| 4022 | 4022 | return implode('', $item); |
| 4023 | 4023 | }, $ret |
| 4024 | 4024 | ); |
@@ -4117,7 +4117,7 @@ discard block |
||
| 4117 | 4117 | foreach (self::$iconvEncoding as $encodingTmp) { |
| 4118 | 4118 | # INFO: //IGNORE and //TRANSLIT still throw notice |
| 4119 | 4119 | /** @noinspection PhpUsageOfSilenceOperatorInspection */ |
| 4120 | - if (md5(@\iconv($encodingTmp, $encodingTmp . '//IGNORE', $str)) === $md5) { |
|
| 4120 | + if (md5(@\iconv($encodingTmp, $encodingTmp.'//IGNORE', $str)) === $md5) { |
|
| 4121 | 4121 | return $encodingTmp; |
| 4122 | 4122 | } |
| 4123 | 4123 | } |
@@ -4207,7 +4207,7 @@ discard block |
||
| 4207 | 4207 | if ('' === $s .= '') { |
| 4208 | 4208 | $s = '/^(?<=.)$/'; |
| 4209 | 4209 | } else { |
| 4210 | - $s = '/' . preg_quote($s, '/') . '/ui'; |
|
| 4210 | + $s = '/'.preg_quote($s, '/').'/ui'; |
|
| 4211 | 4211 | } |
| 4212 | 4212 | } |
| 4213 | 4213 | |
@@ -4265,7 +4265,7 @@ discard block |
||
| 4265 | 4265 | } |
| 4266 | 4266 | |
| 4267 | 4267 | if (self::substr($str, $length - 1, 1) === ' ') { |
| 4268 | - return self::substr($str, 0, $length - 1) . $strAddOn; |
|
| 4268 | + return self::substr($str, 0, $length - 1).$strAddOn; |
|
| 4269 | 4269 | } |
| 4270 | 4270 | |
| 4271 | 4271 | $str = self::substr($str, 0, $length); |
@@ -4274,9 +4274,9 @@ discard block |
||
| 4274 | 4274 | $new_str = implode(' ', $array); |
| 4275 | 4275 | |
| 4276 | 4276 | if ($new_str === '') { |
| 4277 | - $str = self::substr($str, 0, $length - 1) . $strAddOn; |
|
| 4277 | + $str = self::substr($str, 0, $length - 1).$strAddOn; |
|
| 4278 | 4278 | } else { |
| 4279 | - $str = $new_str . $strAddOn; |
|
| 4279 | + $str = $new_str.$strAddOn; |
|
| 4280 | 4280 | } |
| 4281 | 4281 | |
| 4282 | 4282 | return $str; |
@@ -4331,7 +4331,7 @@ discard block |
||
| 4331 | 4331 | $pre = ''; |
| 4332 | 4332 | } |
| 4333 | 4333 | |
| 4334 | - return $pre . $str . $post; |
|
| 4334 | + return $pre.$str.$post; |
|
| 4335 | 4335 | } |
| 4336 | 4336 | |
| 4337 | 4337 | return $str; |
@@ -4461,7 +4461,7 @@ discard block |
||
| 4461 | 4461 | } |
| 4462 | 4462 | |
| 4463 | 4463 | /** @noinspection PhpInternalEntityUsedInspection */ |
| 4464 | - preg_match_all('/' . Grapheme::GRAPHEME_CLUSTER_RX . '/u', $str, $a); |
|
| 4464 | + preg_match_all('/'.Grapheme::GRAPHEME_CLUSTER_RX.'/u', $str, $a); |
|
| 4465 | 4465 | $a = $a[0]; |
| 4466 | 4466 | |
| 4467 | 4467 | if ($len === 1) { |
@@ -4656,7 +4656,7 @@ discard block |
||
| 4656 | 4656 | public static function strcmp($str1, $str2) |
| 4657 | 4657 | { |
| 4658 | 4658 | /** @noinspection PhpUndefinedClassInspection */ |
| 4659 | - return $str1 . '' === $str2 . '' ? 0 : strcmp( |
|
| 4659 | + return $str1.'' === $str2.'' ? 0 : strcmp( |
|
| 4660 | 4660 | \Normalizer::normalize($str1, \Normalizer::NFD), |
| 4661 | 4661 | \Normalizer::normalize($str2, \Normalizer::NFD) |
| 4662 | 4662 | ); |
@@ -4687,7 +4687,7 @@ discard block |
||
| 4687 | 4687 | return null; |
| 4688 | 4688 | } |
| 4689 | 4689 | |
| 4690 | - if (preg_match('/^(.*?)' . self::rxClass($charList) . '/us', $str, $length)) { |
|
| 4690 | + if (preg_match('/^(.*?)'.self::rxClass($charList).'/us', $str, $length)) { |
|
| 4691 | 4691 | /** @noinspection OffsetOperationsInspection */ |
| 4692 | 4692 | return self::strlen($length[1]); |
| 4693 | 4693 | } |
@@ -4894,7 +4894,7 @@ discard block |
||
| 4894 | 4894 | && |
| 4895 | 4895 | self::$support['mbstring'] === false |
| 4896 | 4896 | ) { |
| 4897 | - trigger_error('UTF8::stristr() without mbstring cannot handle "' . $encoding . '" encoding', E_USER_WARNING); |
|
| 4897 | + trigger_error('UTF8::stristr() without mbstring cannot handle "'.$encoding.'" encoding', E_USER_WARNING); |
|
| 4898 | 4898 | } |
| 4899 | 4899 | |
| 4900 | 4900 | if (self::$support['mbstring'] === true) { |
@@ -4905,7 +4905,7 @@ discard block |
||
| 4905 | 4905 | return \grapheme_stristr($haystack, $needle, $before_needle); |
| 4906 | 4906 | } |
| 4907 | 4907 | |
| 4908 | - preg_match('/^(.*?)' . preg_quote($needle, '/') . '/usi', $haystack, $match); |
|
| 4908 | + preg_match('/^(.*?)'.preg_quote($needle, '/').'/usi', $haystack, $match); |
|
| 4909 | 4909 | |
| 4910 | 4910 | if (!isset($match[1])) { |
| 4911 | 4911 | return false; |
@@ -4967,7 +4967,7 @@ discard block |
||
| 4967 | 4967 | && |
| 4968 | 4968 | self::$support['mbstring'] === false |
| 4969 | 4969 | ) { |
| 4970 | - trigger_error('UTF8::strlen() without mbstring cannot handle "' . $encoding . '" encoding', E_USER_WARNING); |
|
| 4970 | + trigger_error('UTF8::strlen() without mbstring cannot handle "'.$encoding.'" encoding', E_USER_WARNING); |
|
| 4971 | 4971 | } |
| 4972 | 4972 | |
| 4973 | 4973 | if (self::$support['mbstring'] === true) { |
@@ -5032,7 +5032,7 @@ discard block |
||
| 5032 | 5032 | */ |
| 5033 | 5033 | public static function strnatcmp($str1, $str2) |
| 5034 | 5034 | { |
| 5035 | - return $str1 . '' === $str2 . '' ? 0 : strnatcmp(self::strtonatfold($str1), self::strtonatfold($str2)); |
|
| 5035 | + return $str1.'' === $str2.'' ? 0 : strnatcmp(self::strtonatfold($str1), self::strtonatfold($str2)); |
|
| 5036 | 5036 | } |
| 5037 | 5037 | |
| 5038 | 5038 | /** |
@@ -5093,7 +5093,7 @@ discard block |
||
| 5093 | 5093 | return false; |
| 5094 | 5094 | } |
| 5095 | 5095 | |
| 5096 | - if (preg_match('/' . self::rxClass($char_list) . '/us', $haystack, $m)) { |
|
| 5096 | + if (preg_match('/'.self::rxClass($char_list).'/us', $haystack, $m)) { |
|
| 5097 | 5097 | return substr($haystack, strpos($haystack, $m[0])); |
| 5098 | 5098 | } else { |
| 5099 | 5099 | return false; |
@@ -5160,7 +5160,7 @@ discard block |
||
| 5160 | 5160 | && |
| 5161 | 5161 | self::$support['mbstring'] === false |
| 5162 | 5162 | ) { |
| 5163 | - trigger_error('UTF8::strpos() without mbstring cannot handle "' . $encoding . '" encoding', E_USER_WARNING); |
|
| 5163 | + trigger_error('UTF8::strpos() without mbstring cannot handle "'.$encoding.'" encoding', E_USER_WARNING); |
|
| 5164 | 5164 | } |
| 5165 | 5165 | |
| 5166 | 5166 | if (self::$support['mbstring'] === true) { |
@@ -5362,7 +5362,7 @@ discard block |
||
| 5362 | 5362 | && |
| 5363 | 5363 | self::$support['mbstring'] === false |
| 5364 | 5364 | ) { |
| 5365 | - trigger_error('UTF8::strripos() without mbstring cannot handle "' . $encoding . '" encoding', E_USER_WARNING); |
|
| 5365 | + trigger_error('UTF8::strripos() without mbstring cannot handle "'.$encoding.'" encoding', E_USER_WARNING); |
|
| 5366 | 5366 | } |
| 5367 | 5367 | |
| 5368 | 5368 | if (self::$support['mbstring'] === true) { |
@@ -5442,7 +5442,7 @@ discard block |
||
| 5442 | 5442 | && |
| 5443 | 5443 | self::$support['mbstring'] === false |
| 5444 | 5444 | ) { |
| 5445 | - trigger_error('UTF8::strrpos() without mbstring cannot handle "' . $encoding . '" encoding', E_USER_WARNING); |
|
| 5445 | + trigger_error('UTF8::strrpos() without mbstring cannot handle "'.$encoding.'" encoding', E_USER_WARNING); |
|
| 5446 | 5446 | } |
| 5447 | 5447 | |
| 5448 | 5448 | if (self::$support['mbstring'] === true) { |
@@ -5502,7 +5502,7 @@ discard block |
||
| 5502 | 5502 | return 0; |
| 5503 | 5503 | } |
| 5504 | 5504 | |
| 5505 | - return preg_match('/^' . self::rxClass($mask) . '+/u', $str, $str) ? self::strlen($str[0]) : 0; |
|
| 5505 | + return preg_match('/^'.self::rxClass($mask).'+/u', $str, $str) ? self::strlen($str[0]) : 0; |
|
| 5506 | 5506 | } |
| 5507 | 5507 | |
| 5508 | 5508 | /** |
@@ -5548,7 +5548,7 @@ discard block |
||
| 5548 | 5548 | && |
| 5549 | 5549 | self::$support['mbstring'] === false |
| 5550 | 5550 | ) { |
| 5551 | - trigger_error('UTF8::strstr() without mbstring cannot handle "' . $encoding . '" encoding', E_USER_WARNING); |
|
| 5551 | + trigger_error('UTF8::strstr() without mbstring cannot handle "'.$encoding.'" encoding', E_USER_WARNING); |
|
| 5552 | 5552 | } |
| 5553 | 5553 | |
| 5554 | 5554 | if (self::$support['mbstring'] === true) { |
@@ -5565,7 +5565,7 @@ discard block |
||
| 5565 | 5565 | } |
| 5566 | 5566 | } |
| 5567 | 5567 | |
| 5568 | - preg_match('/^(.*?)' . preg_quote($needle, '/') . '/us', $haystack, $match); |
|
| 5568 | + preg_match('/^(.*?)'.preg_quote($needle, '/').'/us', $haystack, $match); |
|
| 5569 | 5569 | |
| 5570 | 5570 | if (!isset($match[1])) { |
| 5571 | 5571 | return false; |
@@ -5829,7 +5829,7 @@ discard block |
||
| 5829 | 5829 | && |
| 5830 | 5830 | self::$support['mbstring'] === false |
| 5831 | 5831 | ) { |
| 5832 | - trigger_error('UTF8::substr() without mbstring cannot handle "' . $encoding . '" encoding', E_USER_WARNING); |
|
| 5832 | + trigger_error('UTF8::substr() without mbstring cannot handle "'.$encoding.'" encoding', E_USER_WARNING); |
|
| 5833 | 5833 | } |
| 5834 | 5834 | |
| 5835 | 5835 | if (self::$support['mbstring'] === true) { |
@@ -5942,14 +5942,14 @@ discard block |
||
| 5942 | 5942 | && |
| 5943 | 5943 | self::$support['mbstring'] === false |
| 5944 | 5944 | ) { |
| 5945 | - trigger_error('UTF8::substr_count() without mbstring cannot handle "' . $encoding . '" encoding', E_USER_WARNING); |
|
| 5945 | + trigger_error('UTF8::substr_count() without mbstring cannot handle "'.$encoding.'" encoding', E_USER_WARNING); |
|
| 5946 | 5946 | } |
| 5947 | 5947 | |
| 5948 | 5948 | if (self::$support['mbstring'] === true) { |
| 5949 | 5949 | return \mb_substr_count($haystack, $needle, $encoding); |
| 5950 | 5950 | } |
| 5951 | 5951 | |
| 5952 | - preg_match_all('/' . preg_quote($needle, '/') . '/us', $haystack, $matches, PREG_SET_ORDER); |
|
| 5952 | + preg_match_all('/'.preg_quote($needle, '/').'/us', $haystack, $matches, PREG_SET_ORDER); |
|
| 5953 | 5953 | |
| 5954 | 5954 | return count($matches); |
| 5955 | 5955 | } |
@@ -6196,7 +6196,7 @@ discard block |
||
| 6196 | 6196 | |
| 6197 | 6197 | $strSwappedCase = preg_replace_callback( |
| 6198 | 6198 | '/[\S]/u', |
| 6199 | - function ($match) use ($encoding) { |
|
| 6199 | + function($match) use ($encoding) { |
|
| 6200 | 6200 | $marchToUpper = UTF8::strtoupper($match[0], $encoding); |
| 6201 | 6201 | |
| 6202 | 6202 | if ($match[0] === $marchToUpper) { |
@@ -6386,7 +6386,7 @@ discard block |
||
| 6386 | 6386 | |
| 6387 | 6387 | $bank = $ord >> 8; |
| 6388 | 6388 | if (!array_key_exists($bank, (array)$UTF8_TO_ASCII)) { |
| 6389 | - $bankfile = __DIR__ . '/data/' . sprintf('x%02x', $bank) . '.php'; |
|
| 6389 | + $bankfile = __DIR__.'/data/'.sprintf('x%02x', $bank).'.php'; |
|
| 6390 | 6390 | if (file_exists($bankfile)) { |
| 6391 | 6391 | /** @noinspection PhpIncludeInspection */ |
| 6392 | 6392 | require $bankfile; |
@@ -6508,40 +6508,40 @@ discard block |
||
| 6508 | 6508 | if ($c1 >= "\xc0" & $c1 <= "\xdf") { // looks like 2 bytes UTF8 |
| 6509 | 6509 | |
| 6510 | 6510 | if ($c2 >= "\x80" && $c2 <= "\xbf") { // yeah, almost sure it's UTF8 already |
| 6511 | - $buf .= $c1 . $c2; |
|
| 6511 | + $buf .= $c1.$c2; |
|
| 6512 | 6512 | $i++; |
| 6513 | 6513 | } else { // not valid UTF8 - convert it |
| 6514 | 6514 | $cc1 = (chr(ord($c1) / 64) | "\xc0"); |
| 6515 | 6515 | $cc2 = ($c1 & "\x3f") | "\x80"; |
| 6516 | - $buf .= $cc1 . $cc2; |
|
| 6516 | + $buf .= $cc1.$cc2; |
|
| 6517 | 6517 | } |
| 6518 | 6518 | |
| 6519 | 6519 | } elseif ($c1 >= "\xe0" & $c1 <= "\xef") { // looks like 3 bytes UTF8 |
| 6520 | 6520 | |
| 6521 | 6521 | if ($c2 >= "\x80" && $c2 <= "\xbf" && $c3 >= "\x80" && $c3 <= "\xbf") { // yeah, almost sure it's UTF8 already |
| 6522 | - $buf .= $c1 . $c2 . $c3; |
|
| 6522 | + $buf .= $c1.$c2.$c3; |
|
| 6523 | 6523 | $i += 2; |
| 6524 | 6524 | } else { // not valid UTF8 - convert it |
| 6525 | 6525 | $cc1 = (chr(ord($c1) / 64) | "\xc0"); |
| 6526 | 6526 | $cc2 = ($c1 & "\x3f") | "\x80"; |
| 6527 | - $buf .= $cc1 . $cc2; |
|
| 6527 | + $buf .= $cc1.$cc2; |
|
| 6528 | 6528 | } |
| 6529 | 6529 | |
| 6530 | 6530 | } elseif ($c1 >= "\xf0" & $c1 <= "\xf7") { // looks like 4 bytes UTF8 |
| 6531 | 6531 | |
| 6532 | 6532 | if ($c2 >= "\x80" && $c2 <= "\xbf" && $c3 >= "\x80" && $c3 <= "\xbf" && $c4 >= "\x80" && $c4 <= "\xbf") { // yeah, almost sure it's UTF8 already |
| 6533 | - $buf .= $c1 . $c2 . $c3 . $c4; |
|
| 6533 | + $buf .= $c1.$c2.$c3.$c4; |
|
| 6534 | 6534 | $i += 3; |
| 6535 | 6535 | } else { // not valid UTF8 - convert it |
| 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 | } else { // doesn't look like UTF8, but should be converted |
| 6542 | 6542 | $cc1 = (chr(ord($c1) / 64) | "\xc0"); |
| 6543 | 6543 | $cc2 = (($c1 & "\x3f") | "\x80"); |
| 6544 | - $buf .= $cc1 . $cc2; |
|
| 6544 | + $buf .= $cc1.$cc2; |
|
| 6545 | 6545 | } |
| 6546 | 6546 | |
| 6547 | 6547 | } elseif (($c1 & "\xc0") === "\x80") { // needs conversion |
@@ -6552,7 +6552,7 @@ discard block |
||
| 6552 | 6552 | } else { |
| 6553 | 6553 | $cc1 = (chr($ordC1 / 64) | "\xc0"); |
| 6554 | 6554 | $cc2 = (($c1 & "\x3f") | "\x80"); |
| 6555 | - $buf .= $cc1 . $cc2; |
|
| 6555 | + $buf .= $cc1.$cc2; |
|
| 6556 | 6556 | } |
| 6557 | 6557 | |
| 6558 | 6558 | } else { // it doesn't need conversion |
@@ -6563,7 +6563,7 @@ discard block |
||
| 6563 | 6563 | // decode unicode escape sequences |
| 6564 | 6564 | $buf = preg_replace_callback( |
| 6565 | 6565 | '/\\\\u([0-9a-f]{4})/i', |
| 6566 | - function ($match) { |
|
| 6566 | + function($match) { |
|
| 6567 | 6567 | return \mb_convert_encoding(pack('H*', $match[1]), 'UTF-8', 'UCS-2BE'); |
| 6568 | 6568 | }, |
| 6569 | 6569 | $buf |
@@ -6617,7 +6617,7 @@ discard block |
||
| 6617 | 6617 | */ |
| 6618 | 6618 | public static function ucfirst($str, $encoding = 'UTF-8', $cleanUtf8 = false) |
| 6619 | 6619 | { |
| 6620 | - return self::strtoupper(self::substr($str, 0, 1, $encoding, $cleanUtf8), $encoding, $cleanUtf8) . self::substr($str, 1, null, $encoding, $cleanUtf8); |
|
| 6620 | + return self::strtoupper(self::substr($str, 0, 1, $encoding, $cleanUtf8), $encoding, $cleanUtf8).self::substr($str, 1, null, $encoding, $cleanUtf8); |
|
| 6621 | 6621 | } |
| 6622 | 6622 | |
| 6623 | 6623 | /** |
@@ -7094,7 +7094,7 @@ discard block |
||
| 7094 | 7094 | return ''; |
| 7095 | 7095 | } |
| 7096 | 7096 | |
| 7097 | - preg_match('/^\s*+(?:\S++\s*+){1,' . $words . '}/u', $str, $matches); |
|
| 7097 | + preg_match('/^\s*+(?:\S++\s*+){1,'.$words.'}/u', $str, $matches); |
|
| 7098 | 7098 | |
| 7099 | 7099 | if ( |
| 7100 | 7100 | !isset($matches[0]) |
@@ -7104,7 +7104,7 @@ discard block |
||
| 7104 | 7104 | return $str; |
| 7105 | 7105 | } |
| 7106 | 7106 | |
| 7107 | - return self::rtrim($matches[0]) . $strAddOn; |
|
| 7107 | + return self::rtrim($matches[0]).$strAddOn; |
|
| 7108 | 7108 | } |
| 7109 | 7109 | |
| 7110 | 7110 | /** |
@@ -7172,7 +7172,7 @@ discard block |
||
| 7172 | 7172 | $strReturn .= $break; |
| 7173 | 7173 | } |
| 7174 | 7174 | |
| 7175 | - return $strReturn . implode('', $chars); |
|
| 7175 | + return $strReturn.implode('', $chars); |
|
| 7176 | 7176 | } |
| 7177 | 7177 | |
| 7178 | 7178 | /** |