@@ -855,7 +855,7 @@ discard block |
||
855 | 855 | public static function add_bom_to_string($str) |
856 | 856 | { |
857 | 857 | if (self::string_has_bom($str) === false) { |
858 | - $str = self::bom() . $str; |
|
858 | + $str = self::bom().$str; |
|
859 | 859 | } |
860 | 860 | |
861 | 861 | return $str; |
@@ -980,10 +980,10 @@ discard block |
||
980 | 980 | && |
981 | 981 | self::$SUPPORT['mbstring'] === false |
982 | 982 | ) { |
983 | - trigger_error('UTF8::chr() without mbstring cannot handle "' . $encoding . '" encoding', E_USER_WARNING); |
|
983 | + trigger_error('UTF8::chr() without mbstring cannot handle "'.$encoding.'" encoding', E_USER_WARNING); |
|
984 | 984 | } |
985 | 985 | |
986 | - $cacheKey = $code_point . $encoding; |
|
986 | + $cacheKey = $code_point.$encoding; |
|
987 | 987 | if (isset($CHAR_CACHE[$cacheKey]) === true) { |
988 | 988 | return $CHAR_CACHE[$cacheKey]; |
989 | 989 | } |
@@ -1008,16 +1008,16 @@ discard block |
||
1008 | 1008 | if ($code_point <= 0x7F) { |
1009 | 1009 | $str = self::chr_and_parse_int($code_point); |
1010 | 1010 | } elseif ($code_point <= 0x7FF) { |
1011 | - $str = self::chr_and_parse_int(($code_point >> 6) + 0xC0) . |
|
1011 | + $str = self::chr_and_parse_int(($code_point >> 6) + 0xC0). |
|
1012 | 1012 | self::chr_and_parse_int(($code_point & 0x3F) + 0x80); |
1013 | 1013 | } elseif ($code_point <= 0xFFFF) { |
1014 | - $str = self::chr_and_parse_int(($code_point >> 12) + 0xE0) . |
|
1015 | - self::chr_and_parse_int((($code_point >> 6) & 0x3F) + 0x80) . |
|
1014 | + $str = self::chr_and_parse_int(($code_point >> 12) + 0xE0). |
|
1015 | + self::chr_and_parse_int((($code_point >> 6) & 0x3F) + 0x80). |
|
1016 | 1016 | self::chr_and_parse_int(($code_point & 0x3F) + 0x80); |
1017 | 1017 | } else { |
1018 | - $str = self::chr_and_parse_int(($code_point >> 18) + 0xF0) . |
|
1019 | - self::chr_and_parse_int((($code_point >> 12) & 0x3F) + 0x80) . |
|
1020 | - self::chr_and_parse_int((($code_point >> 6) & 0x3F) + 0x80) . |
|
1018 | + $str = self::chr_and_parse_int(($code_point >> 18) + 0xF0). |
|
1019 | + self::chr_and_parse_int((($code_point >> 12) & 0x3F) + 0x80). |
|
1020 | + self::chr_and_parse_int((($code_point >> 6) & 0x3F) + 0x80). |
|
1021 | 1021 | self::chr_and_parse_int(($code_point & 0x3F) + 0x80); |
1022 | 1022 | } |
1023 | 1023 | |
@@ -1077,7 +1077,7 @@ discard block |
||
1077 | 1077 | } |
1078 | 1078 | |
1079 | 1079 | return array_map( |
1080 | - function ($data) { |
|
1080 | + function($data) { |
|
1081 | 1081 | return UTF8::strlen($data, '8BIT'); |
1082 | 1082 | }, |
1083 | 1083 | self::split($str) |
@@ -1319,7 +1319,7 @@ discard block |
||
1319 | 1319 | $flags = ENT_QUOTES; |
1320 | 1320 | } |
1321 | 1321 | |
1322 | - return self::html_entity_decode('&#' . $int . ';', $flags); |
|
1322 | + return self::html_entity_decode('&#'.$int.';', $flags); |
|
1323 | 1323 | } |
1324 | 1324 | |
1325 | 1325 | /** |
@@ -1397,7 +1397,7 @@ discard block |
||
1397 | 1397 | && |
1398 | 1398 | self::$SUPPORT['mbstring'] === false |
1399 | 1399 | ) { |
1400 | - trigger_error('UTF8::encode() without mbstring cannot handle "' . $encoding . '" encoding', E_USER_WARNING); |
|
1400 | + trigger_error('UTF8::encode() without mbstring cannot handle "'.$encoding.'" encoding', E_USER_WARNING); |
|
1401 | 1401 | } |
1402 | 1402 | |
1403 | 1403 | $strEncoded = \mb_convert_encoding( |
@@ -1606,7 +1606,7 @@ discard block |
||
1606 | 1606 | ) { |
1607 | 1607 | // Prevent leading combining chars |
1608 | 1608 | // for NFC-safe concatenations. |
1609 | - $var = $leading_combining . $var; |
|
1609 | + $var = $leading_combining.$var; |
|
1610 | 1610 | } |
1611 | 1611 | } |
1612 | 1612 | |
@@ -2030,7 +2030,7 @@ discard block |
||
2030 | 2030 | */ |
2031 | 2031 | private static function getData($file) |
2032 | 2032 | { |
2033 | - $file = __DIR__ . '/data/' . $file . '.php'; |
|
2033 | + $file = __DIR__.'/data/'.$file.'.php'; |
|
2034 | 2034 | if (file_exists($file)) { |
2035 | 2035 | /** @noinspection PhpIncludeInspection */ |
2036 | 2036 | return require $file; |
@@ -2175,7 +2175,7 @@ discard block |
||
2175 | 2175 | return implode( |
2176 | 2176 | '', |
2177 | 2177 | array_map( |
2178 | - function ($data) use ($keepAsciiChars, $encoding) { |
|
2178 | + function($data) use ($keepAsciiChars, $encoding) { |
|
2179 | 2179 | return UTF8::single_chr_html_encode($data, $keepAsciiChars, $encoding); |
2180 | 2180 | }, |
2181 | 2181 | self::split($str) |
@@ -2296,7 +2296,7 @@ discard block |
||
2296 | 2296 | && |
2297 | 2297 | self::$SUPPORT['mbstring'] === false |
2298 | 2298 | ) { |
2299 | - trigger_error('UTF8::html_entity_decode() without mbstring cannot handle "' . $encoding . '" encoding', E_USER_WARNING); |
|
2299 | + trigger_error('UTF8::html_entity_decode() without mbstring cannot handle "'.$encoding.'" encoding', E_USER_WARNING); |
|
2300 | 2300 | } |
2301 | 2301 | |
2302 | 2302 | do { |
@@ -2304,7 +2304,7 @@ discard block |
||
2304 | 2304 | |
2305 | 2305 | $str = preg_replace_callback( |
2306 | 2306 | "/&#\d{2,6};/", |
2307 | - function ($matches) use ($encoding) { |
|
2307 | + function($matches) use ($encoding) { |
|
2308 | 2308 | $returnTmp = \mb_convert_encoding($matches[0], $encoding, 'HTML-ENTITIES'); |
2309 | 2309 | |
2310 | 2310 | if ($returnTmp !== '"' && $returnTmp !== "'") { |
@@ -2638,9 +2638,9 @@ discard block |
||
2638 | 2638 | if ((int)$int === $int) { |
2639 | 2639 | $hex = dechex($int); |
2640 | 2640 | |
2641 | - $hex = (strlen($hex) < 4 ? substr('0000' . $hex, -4) : $hex); |
|
2641 | + $hex = (strlen($hex) < 4 ? substr('0000'.$hex, -4) : $hex); |
|
2642 | 2642 | |
2643 | - return $pfix . $hex; |
|
2643 | + return $pfix.$hex; |
|
2644 | 2644 | } |
2645 | 2645 | |
2646 | 2646 | return ''; |
@@ -3381,7 +3381,7 @@ discard block |
||
3381 | 3381 | $cleanUtf8 |
3382 | 3382 | ); |
3383 | 3383 | |
3384 | - return $strPartOne . $strPartTwo; |
|
3384 | + return $strPartOne.$strPartTwo; |
|
3385 | 3385 | } |
3386 | 3386 | |
3387 | 3387 | /** |
@@ -3471,7 +3471,7 @@ discard block |
||
3471 | 3471 | return preg_replace('/^[\pZ\pC]+/u', '', $str); |
3472 | 3472 | } |
3473 | 3473 | |
3474 | - return preg_replace('/^' . self::rxClass($chars) . '+/u', '', $str); |
|
3474 | + return preg_replace('/^'.self::rxClass($chars).'+/u', '', $str); |
|
3475 | 3475 | } |
3476 | 3476 | |
3477 | 3477 | /** |
@@ -3827,7 +3827,7 @@ discard block |
||
3827 | 3827 | } |
3828 | 3828 | } |
3829 | 3829 | |
3830 | - $cacheKey = $chr_orig . $encoding; |
|
3830 | + $cacheKey = $chr_orig.$encoding; |
|
3831 | 3831 | if (isset($CHAR_CACHE[$cacheKey]) === true) { |
3832 | 3832 | return $CHAR_CACHE[$cacheKey]; |
3833 | 3833 | } |
@@ -4061,7 +4061,7 @@ discard block |
||
4061 | 4061 | if (is_array($what) === true) { |
4062 | 4062 | /** @noinspection ForeachSourceInspection */ |
4063 | 4063 | foreach ($what as $item) { |
4064 | - $str = preg_replace('/(' . preg_quote($item, '/') . ')+/', $item, $str); |
|
4064 | + $str = preg_replace('/('.preg_quote($item, '/').')+/', $item, $str); |
|
4065 | 4065 | } |
4066 | 4066 | } |
4067 | 4067 | |
@@ -4169,7 +4169,7 @@ discard block |
||
4169 | 4169 | return preg_replace('/[\pZ\pC]+$/u', '', $str); |
4170 | 4170 | } |
4171 | 4171 | |
4172 | - return preg_replace('/' . self::rxClass($chars) . '+$/u', '', $str); |
|
4172 | + return preg_replace('/'.self::rxClass($chars).'+$/u', '', $str); |
|
4173 | 4173 | } |
4174 | 4174 | |
4175 | 4175 | /** |
@@ -4184,7 +4184,7 @@ discard block |
||
4184 | 4184 | { |
4185 | 4185 | static $RX_CLASSS_CACHE = array(); |
4186 | 4186 | |
4187 | - $cacheKey = $s . $class; |
|
4187 | + $cacheKey = $s.$class; |
|
4188 | 4188 | |
4189 | 4189 | if (isset($RX_CLASSS_CACHE[$cacheKey])) { |
4190 | 4190 | return $RX_CLASSS_CACHE[$cacheKey]; |
@@ -4196,7 +4196,7 @@ discard block |
||
4196 | 4196 | /** @noinspection SuspiciousLoopInspection */ |
4197 | 4197 | foreach (self::str_split($s) as $s) { |
4198 | 4198 | if ('-' === $s) { |
4199 | - $class[0] = '-' . $class[0]; |
|
4199 | + $class[0] = '-'.$class[0]; |
|
4200 | 4200 | } elseif (!isset($s[2])) { |
4201 | 4201 | $class[0] .= preg_quote($s, '/'); |
4202 | 4202 | } elseif (1 === self::strlen($s)) { |
@@ -4207,13 +4207,13 @@ discard block |
||
4207 | 4207 | } |
4208 | 4208 | |
4209 | 4209 | if ($class[0]) { |
4210 | - $class[0] = '[' . $class[0] . ']'; |
|
4210 | + $class[0] = '['.$class[0].']'; |
|
4211 | 4211 | } |
4212 | 4212 | |
4213 | 4213 | if (1 === count($class)) { |
4214 | 4214 | $return = $class[0]; |
4215 | 4215 | } else { |
4216 | - $return = '(?:' . implode('|', $class) . ')'; |
|
4216 | + $return = '(?:'.implode('|', $class).')'; |
|
4217 | 4217 | } |
4218 | 4218 | |
4219 | 4219 | $RX_CLASSS_CACHE[$cacheKey] = $return; |
@@ -4231,7 +4231,7 @@ discard block |
||
4231 | 4231 | } |
4232 | 4232 | |
4233 | 4233 | foreach (self::$SUPPORT as $utf8Support) { |
4234 | - echo $utf8Support . "\n<br>"; |
|
4234 | + echo $utf8Support."\n<br>"; |
|
4235 | 4235 | } |
4236 | 4236 | } |
4237 | 4237 | |
@@ -4264,7 +4264,7 @@ discard block |
||
4264 | 4264 | $encoding = self::normalize_encoding($encoding, 'UTF-8'); |
4265 | 4265 | } |
4266 | 4266 | |
4267 | - return '&#' . self::ord($char, $encoding) . ';'; |
|
4267 | + return '&#'.self::ord($char, $encoding).';'; |
|
4268 | 4268 | } |
4269 | 4269 | |
4270 | 4270 | /** |
@@ -4331,7 +4331,7 @@ discard block |
||
4331 | 4331 | ) { |
4332 | 4332 | |
4333 | 4333 | if (($str[$i + 1] & "\xC0") === "\x80") { |
4334 | - $ret[] = $str[$i] . $str[$i + 1]; |
|
4334 | + $ret[] = $str[$i].$str[$i + 1]; |
|
4335 | 4335 | |
4336 | 4336 | $i++; |
4337 | 4337 | } |
@@ -4347,7 +4347,7 @@ discard block |
||
4347 | 4347 | && |
4348 | 4348 | ($str[$i + 2] & "\xC0") === "\x80" |
4349 | 4349 | ) { |
4350 | - $ret[] = $str[$i] . $str[$i + 1] . $str[$i + 2]; |
|
4350 | + $ret[] = $str[$i].$str[$i + 1].$str[$i + 2]; |
|
4351 | 4351 | |
4352 | 4352 | $i += 2; |
4353 | 4353 | } |
@@ -4365,7 +4365,7 @@ discard block |
||
4365 | 4365 | && |
4366 | 4366 | ($str[$i + 3] & "\xC0") === "\x80" |
4367 | 4367 | ) { |
4368 | - $ret[] = $str[$i] . $str[$i + 1] . $str[$i + 2] . $str[$i + 3]; |
|
4368 | + $ret[] = $str[$i].$str[$i + 1].$str[$i + 2].$str[$i + 3]; |
|
4369 | 4369 | |
4370 | 4370 | $i += 3; |
4371 | 4371 | } |
@@ -4378,7 +4378,7 @@ discard block |
||
4378 | 4378 | $ret = array_chunk($ret, $length); |
4379 | 4379 | |
4380 | 4380 | return array_map( |
4381 | - function ($item) { |
|
4381 | + function($item) { |
|
4382 | 4382 | return implode('', $item); |
4383 | 4383 | }, $ret |
4384 | 4384 | ); |
@@ -4484,7 +4484,7 @@ discard block |
||
4484 | 4484 | foreach (self::$ICONV_ENCODING as $encodingTmp) { |
4485 | 4485 | # INFO: //IGNORE and //TRANSLIT still throw notice |
4486 | 4486 | /** @noinspection PhpUsageOfSilenceOperatorInspection */ |
4487 | - if (md5(@\iconv($encodingTmp, $encodingTmp . '//IGNORE', $str)) === $md5) { |
|
4487 | + if (md5(@\iconv($encodingTmp, $encodingTmp.'//IGNORE', $str)) === $md5) { |
|
4488 | 4488 | return $encodingTmp; |
4489 | 4489 | } |
4490 | 4490 | } |
@@ -4579,7 +4579,7 @@ discard block |
||
4579 | 4579 | if ('' === $s .= '') { |
4580 | 4580 | $s = '/^(?<=.)$/'; |
4581 | 4581 | } else { |
4582 | - $s = '/' . preg_quote($s, '/') . '/ui'; |
|
4582 | + $s = '/'.preg_quote($s, '/').'/ui'; |
|
4583 | 4583 | } |
4584 | 4584 | } |
4585 | 4585 | |
@@ -4637,7 +4637,7 @@ discard block |
||
4637 | 4637 | } |
4638 | 4638 | |
4639 | 4639 | if (self::substr($str, $length - 1, 1) === ' ') { |
4640 | - return (string)self::substr($str, 0, $length - 1) . $strAddOn; |
|
4640 | + return (string)self::substr($str, 0, $length - 1).$strAddOn; |
|
4641 | 4641 | } |
4642 | 4642 | |
4643 | 4643 | $str = (string)self::substr($str, 0, $length); |
@@ -4646,9 +4646,9 @@ discard block |
||
4646 | 4646 | $new_str = implode(' ', $array); |
4647 | 4647 | |
4648 | 4648 | if ($new_str === '') { |
4649 | - $str = (string)self::substr($str, 0, $length - 1) . $strAddOn; |
|
4649 | + $str = (string)self::substr($str, 0, $length - 1).$strAddOn; |
|
4650 | 4650 | } else { |
4651 | - $str = $new_str . $strAddOn; |
|
4651 | + $str = $new_str.$strAddOn; |
|
4652 | 4652 | } |
4653 | 4653 | |
4654 | 4654 | return $str; |
@@ -4703,7 +4703,7 @@ discard block |
||
4703 | 4703 | $pre = ''; |
4704 | 4704 | } |
4705 | 4705 | |
4706 | - return $pre . $str . $post; |
|
4706 | + return $pre.$str.$post; |
|
4707 | 4707 | } |
4708 | 4708 | |
4709 | 4709 | return $str; |
@@ -4853,7 +4853,7 @@ discard block |
||
4853 | 4853 | } |
4854 | 4854 | |
4855 | 4855 | /** @noinspection PhpInternalEntityUsedInspection */ |
4856 | - preg_match_all('/' . self::GRAPHEME_CLUSTER_RX . '/u', $str, $a); |
|
4856 | + preg_match_all('/'.self::GRAPHEME_CLUSTER_RX.'/u', $str, $a); |
|
4857 | 4857 | $a = $a[0]; |
4858 | 4858 | |
4859 | 4859 | if ($len === 1) { |
@@ -5089,7 +5089,7 @@ discard block |
||
5089 | 5089 | public static function strcmp($str1, $str2) |
5090 | 5090 | { |
5091 | 5091 | /** @noinspection PhpUndefinedClassInspection */ |
5092 | - return $str1 . '' === $str2 . '' ? 0 : strcmp( |
|
5092 | + return $str1.'' === $str2.'' ? 0 : strcmp( |
|
5093 | 5093 | \Normalizer::normalize($str1, \Normalizer::NFD), |
5094 | 5094 | \Normalizer::normalize($str2, \Normalizer::NFD) |
5095 | 5095 | ); |
@@ -5124,7 +5124,7 @@ discard block |
||
5124 | 5124 | return null; |
5125 | 5125 | } |
5126 | 5126 | |
5127 | - if (preg_match('/^(.*?)' . self::rxClass($charList) . '/us', $str, $length)) { |
|
5127 | + if (preg_match('/^(.*?)'.self::rxClass($charList).'/us', $str, $length)) { |
|
5128 | 5128 | /** @noinspection OffsetOperationsInspection */ |
5129 | 5129 | return self::strlen($length[1]); |
5130 | 5130 | } |
@@ -5335,7 +5335,7 @@ discard block |
||
5335 | 5335 | && |
5336 | 5336 | self::$SUPPORT['mbstring'] === false |
5337 | 5337 | ) { |
5338 | - trigger_error('UTF8::stristr() without mbstring cannot handle "' . $encoding . '" encoding', E_USER_WARNING); |
|
5338 | + trigger_error('UTF8::stristr() without mbstring cannot handle "'.$encoding.'" encoding', E_USER_WARNING); |
|
5339 | 5339 | } |
5340 | 5340 | |
5341 | 5341 | if (self::$SUPPORT['mbstring'] === true) { |
@@ -5356,7 +5356,7 @@ discard block |
||
5356 | 5356 | return stristr($haystack, $needle, $before_needle); |
5357 | 5357 | } |
5358 | 5358 | |
5359 | - preg_match('/^(.*?)' . preg_quote($needle, '/') . '/usi', $haystack, $match); |
|
5359 | + preg_match('/^(.*?)'.preg_quote($needle, '/').'/usi', $haystack, $match); |
|
5360 | 5360 | |
5361 | 5361 | if (!isset($match[1])) { |
5362 | 5362 | return false; |
@@ -5431,7 +5431,7 @@ discard block |
||
5431 | 5431 | && |
5432 | 5432 | self::$SUPPORT['iconv'] === false |
5433 | 5433 | ) { |
5434 | - trigger_error('UTF8::strlen() without mbstring / iconv cannot handle "' . $encoding . '" encoding', E_USER_WARNING); |
|
5434 | + trigger_error('UTF8::strlen() without mbstring / iconv cannot handle "'.$encoding.'" encoding', E_USER_WARNING); |
|
5435 | 5435 | } |
5436 | 5436 | |
5437 | 5437 | if ( |
@@ -5510,7 +5510,7 @@ discard block |
||
5510 | 5510 | */ |
5511 | 5511 | public static function strnatcmp($str1, $str2) |
5512 | 5512 | { |
5513 | - return $str1 . '' === $str2 . '' ? 0 : strnatcmp(self::strtonatfold($str1), self::strtonatfold($str2)); |
|
5513 | + return $str1.'' === $str2.'' ? 0 : strnatcmp(self::strtonatfold($str1), self::strtonatfold($str2)); |
|
5514 | 5514 | } |
5515 | 5515 | |
5516 | 5516 | /** |
@@ -5571,7 +5571,7 @@ discard block |
||
5571 | 5571 | return false; |
5572 | 5572 | } |
5573 | 5573 | |
5574 | - if (preg_match('/' . self::rxClass($char_list) . '/us', $haystack, $m)) { |
|
5574 | + if (preg_match('/'.self::rxClass($char_list).'/us', $haystack, $m)) { |
|
5575 | 5575 | return substr($haystack, strpos($haystack, $m[0])); |
5576 | 5576 | } |
5577 | 5577 | |
@@ -5648,7 +5648,7 @@ discard block |
||
5648 | 5648 | && |
5649 | 5649 | self::$SUPPORT['mbstring'] === false |
5650 | 5650 | ) { |
5651 | - trigger_error('UTF8::strpos() without mbstring / iconv cannot handle "' . $encoding . '" encoding', E_USER_WARNING); |
|
5651 | + trigger_error('UTF8::strpos() without mbstring / iconv cannot handle "'.$encoding.'" encoding', E_USER_WARNING); |
|
5652 | 5652 | } |
5653 | 5653 | |
5654 | 5654 | if ( |
@@ -5880,7 +5880,7 @@ discard block |
||
5880 | 5880 | && |
5881 | 5881 | self::$SUPPORT['mbstring'] === false |
5882 | 5882 | ) { |
5883 | - trigger_error('UTF8::strripos() without mbstring cannot handle "' . $encoding . '" encoding', E_USER_WARNING); |
|
5883 | + trigger_error('UTF8::strripos() without mbstring cannot handle "'.$encoding.'" encoding', E_USER_WARNING); |
|
5884 | 5884 | } |
5885 | 5885 | |
5886 | 5886 | if (self::$SUPPORT['mbstring'] === true) { |
@@ -5963,7 +5963,7 @@ discard block |
||
5963 | 5963 | && |
5964 | 5964 | self::$SUPPORT['mbstring'] === false |
5965 | 5965 | ) { |
5966 | - trigger_error('UTF8::strrpos() without mbstring cannot handle "' . $encoding . '" encoding', E_USER_WARNING); |
|
5966 | + trigger_error('UTF8::strrpos() without mbstring cannot handle "'.$encoding.'" encoding', E_USER_WARNING); |
|
5967 | 5967 | } |
5968 | 5968 | |
5969 | 5969 | if (self::$SUPPORT['mbstring'] === true) { |
@@ -6031,7 +6031,7 @@ discard block |
||
6031 | 6031 | return 0; |
6032 | 6032 | } |
6033 | 6033 | |
6034 | - return preg_match('/^' . self::rxClass($mask) . '+/u', $str, $str) ? self::strlen($str[0]) : 0; |
|
6034 | + return preg_match('/^'.self::rxClass($mask).'+/u', $str, $str) ? self::strlen($str[0]) : 0; |
|
6035 | 6035 | } |
6036 | 6036 | |
6037 | 6037 | /** |
@@ -6077,7 +6077,7 @@ discard block |
||
6077 | 6077 | && |
6078 | 6078 | self::$SUPPORT['mbstring'] === false |
6079 | 6079 | ) { |
6080 | - trigger_error('UTF8::strstr() without mbstring cannot handle "' . $encoding . '" encoding', E_USER_WARNING); |
|
6080 | + trigger_error('UTF8::strstr() without mbstring cannot handle "'.$encoding.'" encoding', E_USER_WARNING); |
|
6081 | 6081 | } |
6082 | 6082 | |
6083 | 6083 | if (self::$SUPPORT['mbstring'] === true) { |
@@ -6094,7 +6094,7 @@ discard block |
||
6094 | 6094 | return \grapheme_strstr($haystack, $needle, $before_needle); |
6095 | 6095 | } |
6096 | 6096 | |
6097 | - preg_match('/^(.*?)' . preg_quote($needle, '/') . '/us', $haystack, $match); |
|
6097 | + preg_match('/^(.*?)'.preg_quote($needle, '/').'/us', $haystack, $match); |
|
6098 | 6098 | |
6099 | 6099 | if (!isset($match[1])) { |
6100 | 6100 | return false; |
@@ -6201,9 +6201,9 @@ discard block |
||
6201 | 6201 | Bootup::is_php('5.4') === true |
6202 | 6202 | ) { |
6203 | 6203 | |
6204 | - $langCode = $lang . '-Lower'; |
|
6204 | + $langCode = $lang.'-Lower'; |
|
6205 | 6205 | if (!in_array($langCode, self::$SUPPORT['intl__transliterator_list_ids'], true)) { |
6206 | - trigger_error('UTF8::strtolower() without intl for special language: ' . $lang, E_USER_WARNING); |
|
6206 | + trigger_error('UTF8::strtolower() without intl for special language: '.$lang, E_USER_WARNING); |
|
6207 | 6207 | |
6208 | 6208 | $langCode = 'Any-Lower'; |
6209 | 6209 | } |
@@ -6211,7 +6211,7 @@ discard block |
||
6211 | 6211 | return transliterator_transliterate($langCode, $str); |
6212 | 6212 | } |
6213 | 6213 | |
6214 | - trigger_error('UTF8::strtolower() without intl + PHP >= 5.4 cannot handle the "lang"-parameter: ' . $lang, E_USER_WARNING); |
|
6214 | + trigger_error('UTF8::strtolower() without intl + PHP >= 5.4 cannot handle the "lang"-parameter: '.$lang, E_USER_WARNING); |
|
6215 | 6215 | } |
6216 | 6216 | |
6217 | 6217 | return \mb_strtolower($str, $encoding); |
@@ -6271,9 +6271,9 @@ discard block |
||
6271 | 6271 | Bootup::is_php('5.4') === true |
6272 | 6272 | ) { |
6273 | 6273 | |
6274 | - $langCode = $lang . '-Upper'; |
|
6274 | + $langCode = $lang.'-Upper'; |
|
6275 | 6275 | if (!in_array($langCode, self::$SUPPORT['intl__transliterator_list_ids'], true)) { |
6276 | - trigger_error('UTF8::strtoupper() without intl for special language: ' . $lang, E_USER_WARNING); |
|
6276 | + trigger_error('UTF8::strtoupper() without intl for special language: '.$lang, E_USER_WARNING); |
|
6277 | 6277 | |
6278 | 6278 | $langCode = 'Any-Upper'; |
6279 | 6279 | } |
@@ -6281,7 +6281,7 @@ discard block |
||
6281 | 6281 | return transliterator_transliterate($langCode, $str); |
6282 | 6282 | } |
6283 | 6283 | |
6284 | - trigger_error('UTF8::strtolower() without intl + PHP >= 5.4 cannot handle the "lang"-parameter: ' . $lang, E_USER_WARNING); |
|
6284 | + trigger_error('UTF8::strtolower() without intl + PHP >= 5.4 cannot handle the "lang"-parameter: '.$lang, E_USER_WARNING); |
|
6285 | 6285 | } |
6286 | 6286 | |
6287 | 6287 | return \mb_strtoupper($str, $encoding); |
@@ -6386,7 +6386,7 @@ discard block |
||
6386 | 6386 | |
6387 | 6387 | $return = array(); |
6388 | 6388 | foreach ($array as $key => $value) { |
6389 | - if ($case === CASE_LOWER) { |
|
6389 | + if ($case === CASE_LOWER) { |
|
6390 | 6390 | $key = self::strtolower($key); |
6391 | 6391 | } else { |
6392 | 6392 | $key = self::strtoupper($key); |
@@ -6481,7 +6481,7 @@ discard block |
||
6481 | 6481 | && |
6482 | 6482 | self::$SUPPORT['mbstring'] === false |
6483 | 6483 | ) { |
6484 | - trigger_error('UTF8::substr() without mbstring cannot handle "' . $encoding . '" encoding', E_USER_WARNING); |
|
6484 | + trigger_error('UTF8::substr() without mbstring cannot handle "'.$encoding.'" encoding', E_USER_WARNING); |
|
6485 | 6485 | } |
6486 | 6486 | |
6487 | 6487 | if (self::$SUPPORT['mbstring'] === true) { |
@@ -6508,8 +6508,7 @@ discard block |
||
6508 | 6508 | |
6509 | 6509 | if (self::is_ascii($str)) { |
6510 | 6510 | return ($length === null) ? |
6511 | - substr($str, $offset) : |
|
6512 | - substr($str, $offset, $length); |
|
6511 | + substr($str, $offset) : substr($str, $offset, $length); |
|
6513 | 6512 | } |
6514 | 6513 | |
6515 | 6514 | // fallback via vanilla php |
@@ -6644,14 +6643,14 @@ discard block |
||
6644 | 6643 | && |
6645 | 6644 | self::$SUPPORT['mbstring'] === false |
6646 | 6645 | ) { |
6647 | - trigger_error('UTF8::substr_count() without mbstring cannot handle "' . $encoding . '" encoding', E_USER_WARNING); |
|
6646 | + trigger_error('UTF8::substr_count() without mbstring cannot handle "'.$encoding.'" encoding', E_USER_WARNING); |
|
6648 | 6647 | } |
6649 | 6648 | |
6650 | 6649 | if (self::$SUPPORT['mbstring'] === true) { |
6651 | 6650 | return \mb_substr_count($haystack, $needle, $encoding); |
6652 | 6651 | } |
6653 | 6652 | |
6654 | - preg_match_all('/' . preg_quote($needle, '/') . '/us', $haystack, $matches, PREG_SET_ORDER); |
|
6653 | + preg_match_all('/'.preg_quote($needle, '/').'/us', $haystack, $matches, PREG_SET_ORDER); |
|
6655 | 6654 | |
6656 | 6655 | return count($matches); |
6657 | 6656 | } |
@@ -6841,8 +6840,7 @@ discard block |
||
6841 | 6840 | |
6842 | 6841 | if (self::is_ascii($str)) { |
6843 | 6842 | return ($length === null) ? |
6844 | - substr_replace($str, $replacement, $offset) : |
|
6845 | - substr_replace($str, $replacement, $offset, $length); |
|
6843 | + substr_replace($str, $replacement, $offset) : substr_replace($str, $replacement, $offset, $length); |
|
6846 | 6844 | } |
6847 | 6845 | |
6848 | 6846 | preg_match_all('/./us', $str, $smatches); |
@@ -6918,7 +6916,7 @@ discard block |
||
6918 | 6916 | |
6919 | 6917 | $strSwappedCase = preg_replace_callback( |
6920 | 6918 | '/[\S]/u', |
6921 | - function ($match) use ($encoding) { |
|
6919 | + function($match) use ($encoding) { |
|
6922 | 6920 | $marchToUpper = UTF8::strtoupper($match[0], $encoding); |
6923 | 6921 | |
6924 | 6922 | if ($match[0] === $marchToUpper) { |
@@ -7261,7 +7259,7 @@ discard block |
||
7261 | 7259 | $c2 = $i + 1 >= $max ? "\x00" : $str[$i + 1]; |
7262 | 7260 | |
7263 | 7261 | if ($c2 >= "\x80" && $c2 <= "\xBF") { // yeah, almost sure it's UTF8 already |
7264 | - $buf .= $c1 . $c2; |
|
7262 | + $buf .= $c1.$c2; |
|
7265 | 7263 | $i++; |
7266 | 7264 | } else { // not valid UTF8 - convert it |
7267 | 7265 | $buf .= self::to_utf8_convert($c1); |
@@ -7273,7 +7271,7 @@ discard block |
||
7273 | 7271 | $c3 = $i + 2 >= $max ? "\x00" : $str[$i + 2]; |
7274 | 7272 | |
7275 | 7273 | if ($c2 >= "\x80" && $c2 <= "\xBF" && $c3 >= "\x80" && $c3 <= "\xBF") { // yeah, almost sure it's UTF8 already |
7276 | - $buf .= $c1 . $c2 . $c3; |
|
7274 | + $buf .= $c1.$c2.$c3; |
|
7277 | 7275 | $i += 2; |
7278 | 7276 | } else { // not valid UTF8 - convert it |
7279 | 7277 | $buf .= self::to_utf8_convert($c1); |
@@ -7286,7 +7284,7 @@ discard block |
||
7286 | 7284 | $c4 = $i + 3 >= $max ? "\x00" : $str[$i + 3]; |
7287 | 7285 | |
7288 | 7286 | if ($c2 >= "\x80" && $c2 <= "\xBF" && $c3 >= "\x80" && $c3 <= "\xBF" && $c4 >= "\x80" && $c4 <= "\xBF") { // yeah, almost sure it's UTF8 already |
7289 | - $buf .= $c1 . $c2 . $c3 . $c4; |
|
7287 | + $buf .= $c1.$c2.$c3.$c4; |
|
7290 | 7288 | $i += 3; |
7291 | 7289 | } else { // not valid UTF8 - convert it |
7292 | 7290 | $buf .= self::to_utf8_convert($c1); |
@@ -7308,7 +7306,7 @@ discard block |
||
7308 | 7306 | // decode unicode escape sequences |
7309 | 7307 | $buf = preg_replace_callback( |
7310 | 7308 | '/\\\\u([0-9a-f]{4})/i', |
7311 | - function ($match) { |
|
7309 | + function($match) { |
|
7312 | 7310 | return \mb_convert_encoding(pack('H*', $match[1]), 'UTF-8', 'UCS-2BE'); |
7313 | 7311 | }, |
7314 | 7312 | $buf |
@@ -7337,7 +7335,7 @@ discard block |
||
7337 | 7335 | } else { |
7338 | 7336 | $cc1 = self::chr_and_parse_int($ordC1 / 64) | "\xC0"; |
7339 | 7337 | $cc2 = ($int & "\x3F") | "\x80"; |
7340 | - $buf .= $cc1 . $cc2; |
|
7338 | + $buf .= $cc1.$cc2; |
|
7341 | 7339 | } |
7342 | 7340 | |
7343 | 7341 | return $buf; |
@@ -7400,7 +7398,7 @@ discard block |
||
7400 | 7398 | $cleanUtf8 |
7401 | 7399 | ); |
7402 | 7400 | |
7403 | - return $strPartOne . $strPartTwo; |
|
7401 | + return $strPartOne.$strPartTwo; |
|
7404 | 7402 | } |
7405 | 7403 | |
7406 | 7404 | /** |
@@ -7445,7 +7443,7 @@ discard block |
||
7445 | 7443 | $str = self::clean($str); |
7446 | 7444 | } |
7447 | 7445 | |
7448 | - $usePhpDefaultFunctions = !(bool)($charlist . implode('', $exceptions)); |
|
7446 | + $usePhpDefaultFunctions = !(bool)($charlist.implode('', $exceptions)); |
|
7449 | 7447 | |
7450 | 7448 | if ( |
7451 | 7449 | $usePhpDefaultFunctions === true |
@@ -7932,7 +7930,7 @@ discard block |
||
7932 | 7930 | return ''; |
7933 | 7931 | } |
7934 | 7932 | |
7935 | - preg_match('/^\s*+(?:\S++\s*+){1,' . $limit . '}/u', $str, $matches); |
|
7933 | + preg_match('/^\s*+(?:\S++\s*+){1,'.$limit.'}/u', $str, $matches); |
|
7936 | 7934 | |
7937 | 7935 | if ( |
7938 | 7936 | !isset($matches[0]) |
@@ -7942,7 +7940,7 @@ discard block |
||
7942 | 7940 | return $str; |
7943 | 7941 | } |
7944 | 7942 | |
7945 | - return self::rtrim($matches[0]) . $strAddOn; |
|
7943 | + return self::rtrim($matches[0]).$strAddOn; |
|
7946 | 7944 | } |
7947 | 7945 | |
7948 | 7946 | /** |
@@ -8010,7 +8008,7 @@ discard block |
||
8010 | 8008 | $strReturn .= $break; |
8011 | 8009 | } |
8012 | 8010 | |
8013 | - return $strReturn . implode('', $chars); |
|
8011 | + return $strReturn.implode('', $chars); |
|
8014 | 8012 | } |
8015 | 8013 | |
8016 | 8014 | /** |