@@ -985,16 +985,16 @@ |
||
| 985 | 985 | $str = self::chr_and_parse_int($code_point); |
| 986 | 986 | } else if ($code_point <= 0x7FF) { |
| 987 | 987 | $str = self::chr_and_parse_int(($code_point >> 6) + 0xC0) . |
| 988 | - self::chr_and_parse_int(($code_point & 0x3F) + 0x80); |
|
| 988 | + self::chr_and_parse_int(($code_point & 0x3F) + 0x80); |
|
| 989 | 989 | } else if ($code_point <= 0xFFFF) { |
| 990 | 990 | $str = self::chr_and_parse_int(($code_point >> 12) + 0xE0) . |
| 991 | - self::chr_and_parse_int((($code_point >> 6) & 0x3F) + 0x80) . |
|
| 992 | - self::chr_and_parse_int(($code_point & 0x3F) + 0x80); |
|
| 991 | + self::chr_and_parse_int((($code_point >> 6) & 0x3F) + 0x80) . |
|
| 992 | + self::chr_and_parse_int(($code_point & 0x3F) + 0x80); |
|
| 993 | 993 | } else { |
| 994 | 994 | $str = self::chr_and_parse_int(($code_point >> 18) + 0xF0) . |
| 995 | - self::chr_and_parse_int((($code_point >> 12) & 0x3F) + 0x80) . |
|
| 996 | - self::chr_and_parse_int((($code_point >> 6) & 0x3F) + 0x80) . |
|
| 997 | - self::chr_and_parse_int(($code_point & 0x3F) + 0x80); |
|
| 995 | + self::chr_and_parse_int((($code_point >> 12) & 0x3F) + 0x80) . |
|
| 996 | + self::chr_and_parse_int((($code_point >> 6) & 0x3F) + 0x80) . |
|
| 997 | + self::chr_and_parse_int(($code_point & 0x3F) + 0x80); |
|
| 998 | 998 | } |
| 999 | 999 | |
| 1000 | 1000 | if ($encoding !== 'UTF-8') { |
@@ -851,7 +851,7 @@ discard block |
||
| 851 | 851 | public static function add_bom_to_string($str) |
| 852 | 852 | { |
| 853 | 853 | if (self::string_has_bom($str) === false) { |
| 854 | - $str = self::bom() . $str; |
|
| 854 | + $str = self::bom().$str; |
|
| 855 | 855 | } |
| 856 | 856 | |
| 857 | 857 | return $str; |
@@ -976,7 +976,7 @@ discard block |
||
| 976 | 976 | |
| 977 | 977 | // use static cache, only if there is no support for "\IntlChar" |
| 978 | 978 | static $CHAR_CACHE = array(); |
| 979 | - $cacheKey = $code_point . $encoding; |
|
| 979 | + $cacheKey = $code_point.$encoding; |
|
| 980 | 980 | if (isset($CHAR_CACHE[$cacheKey]) === true) { |
| 981 | 981 | return $CHAR_CACHE[$cacheKey]; |
| 982 | 982 | } |
@@ -984,16 +984,16 @@ discard block |
||
| 984 | 984 | if ($code_point <= 0x7F) { |
| 985 | 985 | $str = self::chr_and_parse_int($code_point); |
| 986 | 986 | } else if ($code_point <= 0x7FF) { |
| 987 | - $str = self::chr_and_parse_int(($code_point >> 6) + 0xC0) . |
|
| 987 | + $str = self::chr_and_parse_int(($code_point >> 6) + 0xC0). |
|
| 988 | 988 | self::chr_and_parse_int(($code_point & 0x3F) + 0x80); |
| 989 | 989 | } else if ($code_point <= 0xFFFF) { |
| 990 | - $str = self::chr_and_parse_int(($code_point >> 12) + 0xE0) . |
|
| 991 | - self::chr_and_parse_int((($code_point >> 6) & 0x3F) + 0x80) . |
|
| 990 | + $str = self::chr_and_parse_int(($code_point >> 12) + 0xE0). |
|
| 991 | + self::chr_and_parse_int((($code_point >> 6) & 0x3F) + 0x80). |
|
| 992 | 992 | self::chr_and_parse_int(($code_point & 0x3F) + 0x80); |
| 993 | 993 | } else { |
| 994 | - $str = self::chr_and_parse_int(($code_point >> 18) + 0xF0) . |
|
| 995 | - self::chr_and_parse_int((($code_point >> 12) & 0x3F) + 0x80) . |
|
| 996 | - self::chr_and_parse_int((($code_point >> 6) & 0x3F) + 0x80) . |
|
| 994 | + $str = self::chr_and_parse_int(($code_point >> 18) + 0xF0). |
|
| 995 | + self::chr_and_parse_int((($code_point >> 12) & 0x3F) + 0x80). |
|
| 996 | + self::chr_and_parse_int((($code_point >> 6) & 0x3F) + 0x80). |
|
| 997 | 997 | self::chr_and_parse_int(($code_point & 0x3F) + 0x80); |
| 998 | 998 | } |
| 999 | 999 | |
@@ -1053,7 +1053,7 @@ discard block |
||
| 1053 | 1053 | } |
| 1054 | 1054 | |
| 1055 | 1055 | return array_map( |
| 1056 | - function ($data) { |
|
| 1056 | + function($data) { |
|
| 1057 | 1057 | return UTF8::strlen($data, '8BIT'); |
| 1058 | 1058 | }, |
| 1059 | 1059 | self::split($str) |
@@ -1295,7 +1295,7 @@ discard block |
||
| 1295 | 1295 | $flags = ENT_QUOTES; |
| 1296 | 1296 | } |
| 1297 | 1297 | |
| 1298 | - return self::html_entity_decode('&#' . $int . ';', $flags); |
|
| 1298 | + return self::html_entity_decode('&#'.$int.';', $flags); |
|
| 1299 | 1299 | } |
| 1300 | 1300 | |
| 1301 | 1301 | /** |
@@ -1372,7 +1372,7 @@ discard block |
||
| 1372 | 1372 | && |
| 1373 | 1373 | self::$SUPPORT['mbstring'] === false |
| 1374 | 1374 | ) { |
| 1375 | - trigger_error('UTF8::encode() without mbstring cannot handle "' . $encoding . '" encoding', E_USER_WARNING); |
|
| 1375 | + trigger_error('UTF8::encode() without mbstring cannot handle "'.$encoding.'" encoding', E_USER_WARNING); |
|
| 1376 | 1376 | } |
| 1377 | 1377 | |
| 1378 | 1378 | $strEncoded = \mb_convert_encoding( |
@@ -1581,7 +1581,7 @@ discard block |
||
| 1581 | 1581 | ) { |
| 1582 | 1582 | // Prevent leading combining chars |
| 1583 | 1583 | // for NFC-safe concatenations. |
| 1584 | - $var = $leading_combining . $var; |
|
| 1584 | + $var = $leading_combining.$var; |
|
| 1585 | 1585 | } |
| 1586 | 1586 | } |
| 1587 | 1587 | |
@@ -2005,7 +2005,7 @@ discard block |
||
| 2005 | 2005 | */ |
| 2006 | 2006 | private static function getData($file) |
| 2007 | 2007 | { |
| 2008 | - $file = __DIR__ . '/data/' . $file . '.php'; |
|
| 2008 | + $file = __DIR__.'/data/'.$file.'.php'; |
|
| 2009 | 2009 | if (file_exists($file)) { |
| 2010 | 2010 | /** @noinspection PhpIncludeInspection */ |
| 2011 | 2011 | return require $file; |
@@ -2150,7 +2150,7 @@ discard block |
||
| 2150 | 2150 | return implode( |
| 2151 | 2151 | '', |
| 2152 | 2152 | array_map( |
| 2153 | - function ($data) use ($keepAsciiChars, $encoding) { |
|
| 2153 | + function($data) use ($keepAsciiChars, $encoding) { |
|
| 2154 | 2154 | return UTF8::single_chr_html_encode($data, $keepAsciiChars, $encoding); |
| 2155 | 2155 | }, |
| 2156 | 2156 | self::split($str) |
@@ -2269,7 +2269,7 @@ discard block |
||
| 2269 | 2269 | |
| 2270 | 2270 | $str = preg_replace_callback( |
| 2271 | 2271 | "/&#\d{2,6};/", |
| 2272 | - function ($matches) use ($encoding) { |
|
| 2272 | + function($matches) use ($encoding) { |
|
| 2273 | 2273 | $returnTmp = \mb_convert_encoding($matches[0], $encoding, 'HTML-ENTITIES'); |
| 2274 | 2274 | |
| 2275 | 2275 | if ($returnTmp !== '"' && $returnTmp !== "'") { |
@@ -2593,9 +2593,9 @@ discard block |
||
| 2593 | 2593 | if ((int)$int === $int) { |
| 2594 | 2594 | $hex = dechex($int); |
| 2595 | 2595 | |
| 2596 | - $hex = (strlen($hex) < 4 ? substr('0000' . $hex, -4) : $hex); |
|
| 2596 | + $hex = (strlen($hex) < 4 ? substr('0000'.$hex, -4) : $hex); |
|
| 2597 | 2597 | |
| 2598 | - return $pfix . $hex; |
|
| 2598 | + return $pfix.$hex; |
|
| 2599 | 2599 | } |
| 2600 | 2600 | |
| 2601 | 2601 | return ''; |
@@ -3336,7 +3336,7 @@ discard block |
||
| 3336 | 3336 | $cleanUtf8 |
| 3337 | 3337 | ); |
| 3338 | 3338 | |
| 3339 | - return $strPartOne . $strPartTwo; |
|
| 3339 | + return $strPartOne.$strPartTwo; |
|
| 3340 | 3340 | } |
| 3341 | 3341 | |
| 3342 | 3342 | /** |
@@ -3426,7 +3426,7 @@ discard block |
||
| 3426 | 3426 | return preg_replace('/^[\pZ\pC]+/u', '', $str); |
| 3427 | 3427 | } |
| 3428 | 3428 | |
| 3429 | - return preg_replace('/^' . self::rxClass($chars) . '+/u', '', $str); |
|
| 3429 | + return preg_replace('/^'.self::rxClass($chars).'+/u', '', $str); |
|
| 3430 | 3430 | } |
| 3431 | 3431 | |
| 3432 | 3432 | /** |
@@ -3964,7 +3964,7 @@ discard block |
||
| 3964 | 3964 | if (is_array($what) === true) { |
| 3965 | 3965 | /** @noinspection ForeachSourceInspection */ |
| 3966 | 3966 | foreach ($what as $item) { |
| 3967 | - $str = preg_replace('/(' . preg_quote($item, '/') . ')+/', $item, $str); |
|
| 3967 | + $str = preg_replace('/('.preg_quote($item, '/').')+/', $item, $str); |
|
| 3968 | 3968 | } |
| 3969 | 3969 | } |
| 3970 | 3970 | |
@@ -4073,7 +4073,7 @@ discard block |
||
| 4073 | 4073 | return preg_replace('/[\pZ\pC]+$/u', '', $str); |
| 4074 | 4074 | } |
| 4075 | 4075 | |
| 4076 | - return preg_replace('/' . self::rxClass($chars) . '+$/u', '', $str); |
|
| 4076 | + return preg_replace('/'.self::rxClass($chars).'+$/u', '', $str); |
|
| 4077 | 4077 | } |
| 4078 | 4078 | |
| 4079 | 4079 | /** |
@@ -4088,7 +4088,7 @@ discard block |
||
| 4088 | 4088 | { |
| 4089 | 4089 | static $RX_CLASSS_CACHE = array(); |
| 4090 | 4090 | |
| 4091 | - $cacheKey = $s . $class; |
|
| 4091 | + $cacheKey = $s.$class; |
|
| 4092 | 4092 | |
| 4093 | 4093 | if (isset($RX_CLASSS_CACHE[$cacheKey])) { |
| 4094 | 4094 | return $RX_CLASSS_CACHE[$cacheKey]; |
@@ -4100,7 +4100,7 @@ discard block |
||
| 4100 | 4100 | /** @noinspection SuspiciousLoopInspection */ |
| 4101 | 4101 | foreach (self::str_split($s) as $s) { |
| 4102 | 4102 | if ('-' === $s) { |
| 4103 | - $class[0] = '-' . $class[0]; |
|
| 4103 | + $class[0] = '-'.$class[0]; |
|
| 4104 | 4104 | } elseif (!isset($s[2])) { |
| 4105 | 4105 | $class[0] .= preg_quote($s, '/'); |
| 4106 | 4106 | } elseif (1 === self::strlen($s)) { |
@@ -4111,13 +4111,13 @@ discard block |
||
| 4111 | 4111 | } |
| 4112 | 4112 | |
| 4113 | 4113 | if ($class[0]) { |
| 4114 | - $class[0] = '[' . $class[0] . ']'; |
|
| 4114 | + $class[0] = '['.$class[0].']'; |
|
| 4115 | 4115 | } |
| 4116 | 4116 | |
| 4117 | 4117 | if (1 === count($class)) { |
| 4118 | 4118 | $return = $class[0]; |
| 4119 | 4119 | } else { |
| 4120 | - $return = '(?:' . implode('|', $class) . ')'; |
|
| 4120 | + $return = '(?:'.implode('|', $class).')'; |
|
| 4121 | 4121 | } |
| 4122 | 4122 | |
| 4123 | 4123 | $RX_CLASSS_CACHE[$cacheKey] = $return; |
@@ -4135,7 +4135,7 @@ discard block |
||
| 4135 | 4135 | } |
| 4136 | 4136 | |
| 4137 | 4137 | foreach (self::$SUPPORT as $utf8Support) { |
| 4138 | - echo $utf8Support . "\n<br>"; |
|
| 4138 | + echo $utf8Support."\n<br>"; |
|
| 4139 | 4139 | } |
| 4140 | 4140 | } |
| 4141 | 4141 | |
@@ -4168,7 +4168,7 @@ discard block |
||
| 4168 | 4168 | $encoding = self::normalize_encoding($encoding, 'UTF-8'); |
| 4169 | 4169 | } |
| 4170 | 4170 | |
| 4171 | - return '&#' . self::ord($char, $encoding) . ';'; |
|
| 4171 | + return '&#'.self::ord($char, $encoding).';'; |
|
| 4172 | 4172 | } |
| 4173 | 4173 | |
| 4174 | 4174 | /** |
@@ -4235,7 +4235,7 @@ discard block |
||
| 4235 | 4235 | ) { |
| 4236 | 4236 | |
| 4237 | 4237 | if (($str[$i + 1] & "\xC0") === "\x80") { |
| 4238 | - $ret[] = $str[$i] . $str[$i + 1]; |
|
| 4238 | + $ret[] = $str[$i].$str[$i + 1]; |
|
| 4239 | 4239 | |
| 4240 | 4240 | $i++; |
| 4241 | 4241 | } |
@@ -4251,7 +4251,7 @@ discard block |
||
| 4251 | 4251 | && |
| 4252 | 4252 | ($str[$i + 2] & "\xC0") === "\x80" |
| 4253 | 4253 | ) { |
| 4254 | - $ret[] = $str[$i] . $str[$i + 1] . $str[$i + 2]; |
|
| 4254 | + $ret[] = $str[$i].$str[$i + 1].$str[$i + 2]; |
|
| 4255 | 4255 | |
| 4256 | 4256 | $i += 2; |
| 4257 | 4257 | } |
@@ -4269,7 +4269,7 @@ discard block |
||
| 4269 | 4269 | && |
| 4270 | 4270 | ($str[$i + 3] & "\xC0") === "\x80" |
| 4271 | 4271 | ) { |
| 4272 | - $ret[] = $str[$i] . $str[$i + 1] . $str[$i + 2] . $str[$i + 3]; |
|
| 4272 | + $ret[] = $str[$i].$str[$i + 1].$str[$i + 2].$str[$i + 3]; |
|
| 4273 | 4273 | |
| 4274 | 4274 | $i += 3; |
| 4275 | 4275 | } |
@@ -4282,7 +4282,7 @@ discard block |
||
| 4282 | 4282 | $ret = array_chunk($ret, $length); |
| 4283 | 4283 | |
| 4284 | 4284 | return array_map( |
| 4285 | - function ($item) { |
|
| 4285 | + function($item) { |
|
| 4286 | 4286 | return implode('', $item); |
| 4287 | 4287 | }, $ret |
| 4288 | 4288 | ); |
@@ -4389,7 +4389,7 @@ discard block |
||
| 4389 | 4389 | foreach (self::$ICONV_ENCODING as $encodingTmp) { |
| 4390 | 4390 | # INFO: //IGNORE and //TRANSLIT still throw notice |
| 4391 | 4391 | /** @noinspection PhpUsageOfSilenceOperatorInspection */ |
| 4392 | - if (md5(@\iconv($encodingTmp, $encodingTmp . '//IGNORE', $str)) === $md5) { |
|
| 4392 | + if (md5(@\iconv($encodingTmp, $encodingTmp.'//IGNORE', $str)) === $md5) { |
|
| 4393 | 4393 | return $encodingTmp; |
| 4394 | 4394 | } |
| 4395 | 4395 | } |
@@ -4484,7 +4484,7 @@ discard block |
||
| 4484 | 4484 | if ('' === $s .= '') { |
| 4485 | 4485 | $s = '/^(?<=.)$/'; |
| 4486 | 4486 | } else { |
| 4487 | - $s = '/' . preg_quote($s, '/') . '/ui'; |
|
| 4487 | + $s = '/'.preg_quote($s, '/').'/ui'; |
|
| 4488 | 4488 | } |
| 4489 | 4489 | } |
| 4490 | 4490 | |
@@ -4542,7 +4542,7 @@ discard block |
||
| 4542 | 4542 | } |
| 4543 | 4543 | |
| 4544 | 4544 | if (self::substr($str, $length - 1, 1) === ' ') { |
| 4545 | - return (string)self::substr($str, 0, $length - 1) . $strAddOn; |
|
| 4545 | + return (string)self::substr($str, 0, $length - 1).$strAddOn; |
|
| 4546 | 4546 | } |
| 4547 | 4547 | |
| 4548 | 4548 | $str = (string)self::substr($str, 0, $length); |
@@ -4551,9 +4551,9 @@ discard block |
||
| 4551 | 4551 | $new_str = implode(' ', $array); |
| 4552 | 4552 | |
| 4553 | 4553 | if ($new_str === '') { |
| 4554 | - $str = (string)self::substr($str, 0, $length - 1) . $strAddOn; |
|
| 4554 | + $str = (string)self::substr($str, 0, $length - 1).$strAddOn; |
|
| 4555 | 4555 | } else { |
| 4556 | - $str = $new_str . $strAddOn; |
|
| 4556 | + $str = $new_str.$strAddOn; |
|
| 4557 | 4557 | } |
| 4558 | 4558 | |
| 4559 | 4559 | return $str; |
@@ -4608,7 +4608,7 @@ discard block |
||
| 4608 | 4608 | $pre = ''; |
| 4609 | 4609 | } |
| 4610 | 4610 | |
| 4611 | - return $pre . $str . $post; |
|
| 4611 | + return $pre.$str.$post; |
|
| 4612 | 4612 | } |
| 4613 | 4613 | |
| 4614 | 4614 | return $str; |
@@ -4758,7 +4758,7 @@ discard block |
||
| 4758 | 4758 | } |
| 4759 | 4759 | |
| 4760 | 4760 | /** @noinspection PhpInternalEntityUsedInspection */ |
| 4761 | - preg_match_all('/' . Grapheme::GRAPHEME_CLUSTER_RX . '/u', $str, $a); |
|
| 4761 | + preg_match_all('/'.Grapheme::GRAPHEME_CLUSTER_RX.'/u', $str, $a); |
|
| 4762 | 4762 | $a = $a[0]; |
| 4763 | 4763 | |
| 4764 | 4764 | if ($len === 1) { |
@@ -4994,7 +4994,7 @@ discard block |
||
| 4994 | 4994 | public static function strcmp($str1, $str2) |
| 4995 | 4995 | { |
| 4996 | 4996 | /** @noinspection PhpUndefinedClassInspection */ |
| 4997 | - return $str1 . '' === $str2 . '' ? 0 : strcmp( |
|
| 4997 | + return $str1.'' === $str2.'' ? 0 : strcmp( |
|
| 4998 | 4998 | \Normalizer::normalize($str1, \Normalizer::NFD), |
| 4999 | 4999 | \Normalizer::normalize($str2, \Normalizer::NFD) |
| 5000 | 5000 | ); |
@@ -5029,7 +5029,7 @@ discard block |
||
| 5029 | 5029 | return null; |
| 5030 | 5030 | } |
| 5031 | 5031 | |
| 5032 | - if (preg_match('/^(.*?)' . self::rxClass($charList) . '/us', $str, $length)) { |
|
| 5032 | + if (preg_match('/^(.*?)'.self::rxClass($charList).'/us', $str, $length)) { |
|
| 5033 | 5033 | /** @noinspection OffsetOperationsInspection */ |
| 5034 | 5034 | return self::strlen($length[1]); |
| 5035 | 5035 | } |
@@ -5236,7 +5236,7 @@ discard block |
||
| 5236 | 5236 | && |
| 5237 | 5237 | self::$SUPPORT['mbstring'] === false |
| 5238 | 5238 | ) { |
| 5239 | - trigger_error('UTF8::stristr() without mbstring cannot handle "' . $encoding . '" encoding', E_USER_WARNING); |
|
| 5239 | + trigger_error('UTF8::stristr() without mbstring cannot handle "'.$encoding.'" encoding', E_USER_WARNING); |
|
| 5240 | 5240 | } |
| 5241 | 5241 | |
| 5242 | 5242 | if (self::$SUPPORT['mbstring'] === true) { |
@@ -5253,7 +5253,7 @@ discard block |
||
| 5253 | 5253 | return \grapheme_stristr($haystack, $needle, $before_needle); |
| 5254 | 5254 | } |
| 5255 | 5255 | |
| 5256 | - preg_match('/^(.*?)' . preg_quote($needle, '/') . '/usi', $haystack, $match); |
|
| 5256 | + preg_match('/^(.*?)'.preg_quote($needle, '/').'/usi', $haystack, $match); |
|
| 5257 | 5257 | |
| 5258 | 5258 | if (!isset($match[1])) { |
| 5259 | 5259 | return false; |
@@ -5327,7 +5327,7 @@ discard block |
||
| 5327 | 5327 | && |
| 5328 | 5328 | self::$SUPPORT['iconv'] === false |
| 5329 | 5329 | ) { |
| 5330 | - trigger_error('UTF8::strlen() without mbstring / iconv cannot handle "' . $encoding . '" encoding', E_USER_WARNING); |
|
| 5330 | + trigger_error('UTF8::strlen() without mbstring / iconv cannot handle "'.$encoding.'" encoding', E_USER_WARNING); |
|
| 5331 | 5331 | } |
| 5332 | 5332 | |
| 5333 | 5333 | if ( |
@@ -5402,7 +5402,7 @@ discard block |
||
| 5402 | 5402 | */ |
| 5403 | 5403 | public static function strnatcmp($str1, $str2) |
| 5404 | 5404 | { |
| 5405 | - return $str1 . '' === $str2 . '' ? 0 : strnatcmp(self::strtonatfold($str1), self::strtonatfold($str2)); |
|
| 5405 | + return $str1.'' === $str2.'' ? 0 : strnatcmp(self::strtonatfold($str1), self::strtonatfold($str2)); |
|
| 5406 | 5406 | } |
| 5407 | 5407 | |
| 5408 | 5408 | /** |
@@ -5463,7 +5463,7 @@ discard block |
||
| 5463 | 5463 | return false; |
| 5464 | 5464 | } |
| 5465 | 5465 | |
| 5466 | - if (preg_match('/' . self::rxClass($char_list) . '/us', $haystack, $m)) { |
|
| 5466 | + if (preg_match('/'.self::rxClass($char_list).'/us', $haystack, $m)) { |
|
| 5467 | 5467 | return substr($haystack, strpos($haystack, $m[0])); |
| 5468 | 5468 | } |
| 5469 | 5469 | |
@@ -5540,7 +5540,7 @@ discard block |
||
| 5540 | 5540 | && |
| 5541 | 5541 | self::$SUPPORT['mbstring'] === false |
| 5542 | 5542 | ) { |
| 5543 | - trigger_error('UTF8::strpos() without mbstring / iconv cannot handle "' . $encoding . '" encoding', E_USER_WARNING); |
|
| 5543 | + trigger_error('UTF8::strpos() without mbstring / iconv cannot handle "'.$encoding.'" encoding', E_USER_WARNING); |
|
| 5544 | 5544 | } |
| 5545 | 5545 | |
| 5546 | 5546 | if ( |
@@ -5763,7 +5763,7 @@ discard block |
||
| 5763 | 5763 | && |
| 5764 | 5764 | self::$SUPPORT['mbstring'] === false |
| 5765 | 5765 | ) { |
| 5766 | - trigger_error('UTF8::strripos() without mbstring cannot handle "' . $encoding . '" encoding', E_USER_WARNING); |
|
| 5766 | + trigger_error('UTF8::strripos() without mbstring cannot handle "'.$encoding.'" encoding', E_USER_WARNING); |
|
| 5767 | 5767 | } |
| 5768 | 5768 | |
| 5769 | 5769 | if (self::$SUPPORT['mbstring'] === true) { |
@@ -5846,7 +5846,7 @@ discard block |
||
| 5846 | 5846 | && |
| 5847 | 5847 | self::$SUPPORT['mbstring'] === false |
| 5848 | 5848 | ) { |
| 5849 | - trigger_error('UTF8::strrpos() without mbstring cannot handle "' . $encoding . '" encoding', E_USER_WARNING); |
|
| 5849 | + trigger_error('UTF8::strrpos() without mbstring cannot handle "'.$encoding.'" encoding', E_USER_WARNING); |
|
| 5850 | 5850 | } |
| 5851 | 5851 | |
| 5852 | 5852 | if (self::$SUPPORT['mbstring'] === true) { |
@@ -5914,7 +5914,7 @@ discard block |
||
| 5914 | 5914 | return 0; |
| 5915 | 5915 | } |
| 5916 | 5916 | |
| 5917 | - return preg_match('/^' . self::rxClass($mask) . '+/u', $str, $str) ? self::strlen($str[0]) : 0; |
|
| 5917 | + return preg_match('/^'.self::rxClass($mask).'+/u', $str, $str) ? self::strlen($str[0]) : 0; |
|
| 5918 | 5918 | } |
| 5919 | 5919 | |
| 5920 | 5920 | /** |
@@ -5960,7 +5960,7 @@ discard block |
||
| 5960 | 5960 | && |
| 5961 | 5961 | self::$SUPPORT['mbstring'] === false |
| 5962 | 5962 | ) { |
| 5963 | - trigger_error('UTF8::strstr() without mbstring cannot handle "' . $encoding . '" encoding', E_USER_WARNING); |
|
| 5963 | + trigger_error('UTF8::strstr() without mbstring cannot handle "'.$encoding.'" encoding', E_USER_WARNING); |
|
| 5964 | 5964 | } |
| 5965 | 5965 | |
| 5966 | 5966 | if (self::$SUPPORT['mbstring'] === true) { |
@@ -5977,7 +5977,7 @@ discard block |
||
| 5977 | 5977 | return \grapheme_strstr($haystack, $needle, $before_needle); |
| 5978 | 5978 | } |
| 5979 | 5979 | |
| 5980 | - preg_match('/^(.*?)' . preg_quote($needle, '/') . '/us', $haystack, $match); |
|
| 5980 | + preg_match('/^(.*?)'.preg_quote($needle, '/').'/us', $haystack, $match); |
|
| 5981 | 5981 | |
| 5982 | 5982 | if (!isset($match[1])) { |
| 5983 | 5983 | return false; |
@@ -6084,9 +6084,9 @@ discard block |
||
| 6084 | 6084 | Bootup::is_php('5.4') === true |
| 6085 | 6085 | ) { |
| 6086 | 6086 | |
| 6087 | - $langCode = $lang . '-Lower'; |
|
| 6087 | + $langCode = $lang.'-Lower'; |
|
| 6088 | 6088 | if (!in_array($langCode, self::$SUPPORT['intl__transliterator_list_ids'], true)) { |
| 6089 | - trigger_error('UTF8::strtolower() without intl for special language: ' . $lang, E_USER_WARNING); |
|
| 6089 | + trigger_error('UTF8::strtolower() without intl for special language: '.$lang, E_USER_WARNING); |
|
| 6090 | 6090 | |
| 6091 | 6091 | $langCode = 'Any-Lower'; |
| 6092 | 6092 | } |
@@ -6094,7 +6094,7 @@ discard block |
||
| 6094 | 6094 | return transliterator_transliterate($langCode, $str); |
| 6095 | 6095 | } |
| 6096 | 6096 | |
| 6097 | - trigger_error('UTF8::strtolower() without intl + PHP >= 5.4 cannot handle the "lang"-parameter: ' . $lang, E_USER_WARNING); |
|
| 6097 | + trigger_error('UTF8::strtolower() without intl + PHP >= 5.4 cannot handle the "lang"-parameter: '.$lang, E_USER_WARNING); |
|
| 6098 | 6098 | } |
| 6099 | 6099 | |
| 6100 | 6100 | return \mb_strtolower($str, $encoding); |
@@ -6154,9 +6154,9 @@ discard block |
||
| 6154 | 6154 | Bootup::is_php('5.4') === true |
| 6155 | 6155 | ) { |
| 6156 | 6156 | |
| 6157 | - $langCode = $lang . '-Upper'; |
|
| 6157 | + $langCode = $lang.'-Upper'; |
|
| 6158 | 6158 | if (!in_array($langCode, self::$SUPPORT['intl__transliterator_list_ids'], true)) { |
| 6159 | - trigger_error('UTF8::strtoupper() without intl for special language: ' . $lang, E_USER_WARNING); |
|
| 6159 | + trigger_error('UTF8::strtoupper() without intl for special language: '.$lang, E_USER_WARNING); |
|
| 6160 | 6160 | |
| 6161 | 6161 | $langCode = 'Any-Upper'; |
| 6162 | 6162 | } |
@@ -6164,7 +6164,7 @@ discard block |
||
| 6164 | 6164 | return transliterator_transliterate($langCode, $str); |
| 6165 | 6165 | } |
| 6166 | 6166 | |
| 6167 | - trigger_error('UTF8::strtolower() without intl + PHP >= 5.4 cannot handle the "lang"-parameter: ' . $lang, E_USER_WARNING); |
|
| 6167 | + trigger_error('UTF8::strtolower() without intl + PHP >= 5.4 cannot handle the "lang"-parameter: '.$lang, E_USER_WARNING); |
|
| 6168 | 6168 | } |
| 6169 | 6169 | |
| 6170 | 6170 | return \mb_strtoupper($str, $encoding); |
@@ -6269,7 +6269,7 @@ discard block |
||
| 6269 | 6269 | |
| 6270 | 6270 | $return = array(); |
| 6271 | 6271 | foreach ($array as $key => $value) { |
| 6272 | - if ($case === CASE_LOWER) { |
|
| 6272 | + if ($case === CASE_LOWER) { |
|
| 6273 | 6273 | $key = self::strtolower($key); |
| 6274 | 6274 | } else { |
| 6275 | 6275 | $key = self::strtoupper($key); |
@@ -6353,7 +6353,7 @@ discard block |
||
| 6353 | 6353 | && |
| 6354 | 6354 | self::$SUPPORT['mbstring'] === false |
| 6355 | 6355 | ) { |
| 6356 | - trigger_error('UTF8::substr() without mbstring cannot handle "' . $encoding . '" encoding', E_USER_WARNING); |
|
| 6356 | + trigger_error('UTF8::substr() without mbstring cannot handle "'.$encoding.'" encoding', E_USER_WARNING); |
|
| 6357 | 6357 | } |
| 6358 | 6358 | |
| 6359 | 6359 | if (self::$SUPPORT['mbstring'] === true) { |
@@ -6510,14 +6510,14 @@ discard block |
||
| 6510 | 6510 | && |
| 6511 | 6511 | self::$SUPPORT['mbstring'] === false |
| 6512 | 6512 | ) { |
| 6513 | - trigger_error('UTF8::substr_count() without mbstring cannot handle "' . $encoding . '" encoding', E_USER_WARNING); |
|
| 6513 | + trigger_error('UTF8::substr_count() without mbstring cannot handle "'.$encoding.'" encoding', E_USER_WARNING); |
|
| 6514 | 6514 | } |
| 6515 | 6515 | |
| 6516 | 6516 | if (self::$SUPPORT['mbstring'] === true) { |
| 6517 | 6517 | return \mb_substr_count($haystack, $needle, $encoding); |
| 6518 | 6518 | } |
| 6519 | 6519 | |
| 6520 | - preg_match_all('/' . preg_quote($needle, '/') . '/us', $haystack, $matches, PREG_SET_ORDER); |
|
| 6520 | + preg_match_all('/'.preg_quote($needle, '/').'/us', $haystack, $matches, PREG_SET_ORDER); |
|
| 6521 | 6521 | |
| 6522 | 6522 | return count($matches); |
| 6523 | 6523 | } |
@@ -6779,7 +6779,7 @@ discard block |
||
| 6779 | 6779 | |
| 6780 | 6780 | $strSwappedCase = preg_replace_callback( |
| 6781 | 6781 | '/[\S]/u', |
| 6782 | - function ($match) use ($encoding) { |
|
| 6782 | + function($match) use ($encoding) { |
|
| 6783 | 6783 | $marchToUpper = UTF8::strtoupper($match[0], $encoding); |
| 6784 | 6784 | |
| 6785 | 6785 | if ($match[0] === $marchToUpper) { |
@@ -7118,13 +7118,13 @@ discard block |
||
| 7118 | 7118 | $c2 = $i + 1 >= $max ? "\x00" : $str[$i + 1]; |
| 7119 | 7119 | |
| 7120 | 7120 | if ($c2 >= "\x80" && $c2 <= "\xBF") { // yeah, almost sure it's UTF8 already |
| 7121 | - $buf .= $c1 . $c2; |
|
| 7121 | + $buf .= $c1.$c2; |
|
| 7122 | 7122 | $i++; |
| 7123 | 7123 | } else { // not valid UTF8 - convert it |
| 7124 | 7124 | $cc1tmp = ord($c1) / 64; |
| 7125 | 7125 | $cc1 = self::chr_and_parse_int($cc1tmp) | "\xC0"; |
| 7126 | 7126 | $cc2 = ($c1 & "\x3F") | "\x80"; |
| 7127 | - $buf .= $cc1 . $cc2; |
|
| 7127 | + $buf .= $cc1.$cc2; |
|
| 7128 | 7128 | } |
| 7129 | 7129 | |
| 7130 | 7130 | } elseif ($c1 >= "\xE0" && $c1 <= "\xEF") { // looks like 3 bytes UTF8 |
@@ -7133,13 +7133,13 @@ discard block |
||
| 7133 | 7133 | $c3 = $i + 2 >= $max ? "\x00" : $str[$i + 2]; |
| 7134 | 7134 | |
| 7135 | 7135 | if ($c2 >= "\x80" && $c2 <= "\xBF" && $c3 >= "\x80" && $c3 <= "\xBF") { // yeah, almost sure it's UTF8 already |
| 7136 | - $buf .= $c1 . $c2 . $c3; |
|
| 7136 | + $buf .= $c1.$c2.$c3; |
|
| 7137 | 7137 | $i += 2; |
| 7138 | 7138 | } else { // not valid UTF8 - convert it |
| 7139 | 7139 | $cc1tmp = ord($c1) / 64; |
| 7140 | 7140 | $cc1 = self::chr_and_parse_int($cc1tmp) | "\xC0"; |
| 7141 | 7141 | $cc2 = ($c1 & "\x3F") | "\x80"; |
| 7142 | - $buf .= $cc1 . $cc2; |
|
| 7142 | + $buf .= $cc1.$cc2; |
|
| 7143 | 7143 | } |
| 7144 | 7144 | |
| 7145 | 7145 | } elseif ($c1 >= "\xF0" && $c1 <= "\xF7") { // looks like 4 bytes UTF8 |
@@ -7149,20 +7149,20 @@ discard block |
||
| 7149 | 7149 | $c4 = $i + 3 >= $max ? "\x00" : $str[$i + 3]; |
| 7150 | 7150 | |
| 7151 | 7151 | if ($c2 >= "\x80" && $c2 <= "\xBF" && $c3 >= "\x80" && $c3 <= "\xBF" && $c4 >= "\x80" && $c4 <= "\xBF") { // yeah, almost sure it's UTF8 already |
| 7152 | - $buf .= $c1 . $c2 . $c3 . $c4; |
|
| 7152 | + $buf .= $c1.$c2.$c3.$c4; |
|
| 7153 | 7153 | $i += 3; |
| 7154 | 7154 | } else { // not valid UTF8 - convert it |
| 7155 | 7155 | $cc1tmp = ord($c1) / 64; |
| 7156 | 7156 | $cc1 = self::chr_and_parse_int($cc1tmp) | "\xC0"; |
| 7157 | 7157 | $cc2 = ($c1 & "\x3F") | "\x80"; |
| 7158 | - $buf .= $cc1 . $cc2; |
|
| 7158 | + $buf .= $cc1.$cc2; |
|
| 7159 | 7159 | } |
| 7160 | 7160 | |
| 7161 | 7161 | } else { // doesn't look like UTF8, but should be converted |
| 7162 | 7162 | $cc1tmp = ord($c1) / 64; |
| 7163 | 7163 | $cc1 = self::chr_and_parse_int($cc1tmp) | "\xC0"; |
| 7164 | 7164 | $cc2 = ($c1 & "\x3F") | "\x80"; |
| 7165 | - $buf .= $cc1 . $cc2; |
|
| 7165 | + $buf .= $cc1.$cc2; |
|
| 7166 | 7166 | } |
| 7167 | 7167 | |
| 7168 | 7168 | } elseif (($c1 & "\xC0") === "\x80") { // needs conversion |
@@ -7173,7 +7173,7 @@ discard block |
||
| 7173 | 7173 | } else { |
| 7174 | 7174 | $cc1 = self::chr_and_parse_int($ordC1 / 64) | "\xC0"; |
| 7175 | 7175 | $cc2 = ($c1 & "\x3F") | "\x80"; |
| 7176 | - $buf .= $cc1 . $cc2; |
|
| 7176 | + $buf .= $cc1.$cc2; |
|
| 7177 | 7177 | } |
| 7178 | 7178 | |
| 7179 | 7179 | } else { // it doesn't need conversion |
@@ -7184,7 +7184,7 @@ discard block |
||
| 7184 | 7184 | // decode unicode escape sequences |
| 7185 | 7185 | $buf = preg_replace_callback( |
| 7186 | 7186 | '/\\\\u([0-9a-f]{4})/i', |
| 7187 | - function ($match) { |
|
| 7187 | + function($match) { |
|
| 7188 | 7188 | return \mb_convert_encoding(pack('H*', $match[1]), 'UTF-8', 'UCS-2BE'); |
| 7189 | 7189 | }, |
| 7190 | 7190 | $buf |
@@ -7249,7 +7249,7 @@ discard block |
||
| 7249 | 7249 | $cleanUtf8 |
| 7250 | 7250 | ); |
| 7251 | 7251 | |
| 7252 | - return $strPartOne . $strPartTwo; |
|
| 7252 | + return $strPartOne.$strPartTwo; |
|
| 7253 | 7253 | } |
| 7254 | 7254 | |
| 7255 | 7255 | /** |
@@ -7762,7 +7762,7 @@ discard block |
||
| 7762 | 7762 | return ''; |
| 7763 | 7763 | } |
| 7764 | 7764 | |
| 7765 | - preg_match('/^\s*+(?:\S++\s*+){1,' . $limit . '}/u', $str, $matches); |
|
| 7765 | + preg_match('/^\s*+(?:\S++\s*+){1,'.$limit.'}/u', $str, $matches); |
|
| 7766 | 7766 | |
| 7767 | 7767 | if ( |
| 7768 | 7768 | !isset($matches[0]) |
@@ -7772,7 +7772,7 @@ discard block |
||
| 7772 | 7772 | return $str; |
| 7773 | 7773 | } |
| 7774 | 7774 | |
| 7775 | - return self::rtrim($matches[0]) . $strAddOn; |
|
| 7775 | + return self::rtrim($matches[0]).$strAddOn; |
|
| 7776 | 7776 | } |
| 7777 | 7777 | |
| 7778 | 7778 | /** |
@@ -7840,7 +7840,7 @@ discard block |
||
| 7840 | 7840 | $strReturn .= $break; |
| 7841 | 7841 | } |
| 7842 | 7842 | |
| 7843 | - return $strReturn . implode('', $chars); |
|
| 7843 | + return $strReturn.implode('', $chars); |
|
| 7844 | 7844 | } |
| 7845 | 7845 | |
| 7846 | 7846 | /** |