@@ -509,16 +509,16 @@ discard block |
||
509 | 509 | $chr = self::$CHR[$code_point]; |
510 | 510 | } elseif ($code_point <= 0x7FF) { |
511 | 511 | $chr = self::$CHR[($code_point >> 6) + 0xC0] . |
512 | - self::$CHR[($code_point & 0x3F) + 0x80]; |
|
512 | + self::$CHR[($code_point & 0x3F) + 0x80]; |
|
513 | 513 | } elseif ($code_point <= 0xFFFF) { |
514 | 514 | $chr = self::$CHR[($code_point >> 12) + 0xE0] . |
515 | - self::$CHR[(($code_point >> 6) & 0x3F) + 0x80] . |
|
516 | - self::$CHR[($code_point & 0x3F) + 0x80]; |
|
515 | + self::$CHR[(($code_point >> 6) & 0x3F) + 0x80] . |
|
516 | + self::$CHR[($code_point & 0x3F) + 0x80]; |
|
517 | 517 | } else { |
518 | 518 | $chr = self::$CHR[($code_point >> 18) + 0xF0] . |
519 | - self::$CHR[(($code_point >> 12) & 0x3F) + 0x80] . |
|
520 | - self::$CHR[(($code_point >> 6) & 0x3F) + 0x80] . |
|
521 | - self::$CHR[($code_point & 0x3F) + 0x80]; |
|
519 | + self::$CHR[(($code_point >> 12) & 0x3F) + 0x80] . |
|
520 | + self::$CHR[(($code_point >> 6) & 0x3F) + 0x80] . |
|
521 | + self::$CHR[($code_point & 0x3F) + 0x80]; |
|
522 | 522 | } |
523 | 523 | |
524 | 524 | if ($encoding !== 'UTF-8') { |
@@ -1012,9 +1012,9 @@ discard block |
||
1012 | 1012 | |
1013 | 1013 | if ($pos) { |
1014 | 1014 | return \rtrim( |
1015 | - self::substr($text, 0, $pos, $encoding), |
|
1016 | - $trimChars |
|
1017 | - ) . $replacerForSkippedText; |
|
1015 | + self::substr($text, 0, $pos, $encoding), |
|
1016 | + $trimChars |
|
1017 | + ) . $replacerForSkippedText; |
|
1018 | 1018 | } |
1019 | 1019 | |
1020 | 1020 | return $text; |
@@ -1053,9 +1053,9 @@ discard block |
||
1053 | 1053 | } |
1054 | 1054 | |
1055 | 1055 | $pos_end = \min( |
1056 | - self::strpos($text, ' ', $l, $encoding), |
|
1057 | - self::strpos($text, '.', $l, $encoding) |
|
1058 | - ) - $pos_start; |
|
1056 | + self::strpos($text, ' ', $l, $encoding), |
|
1057 | + self::strpos($text, '.', $l, $encoding) |
|
1058 | + ) - $pos_start; |
|
1059 | 1059 | |
1060 | 1060 | if (!$pos_end || $pos_end <= 0) { |
1061 | 1061 | $extract = $replacerForSkippedText . \ltrim( |
@@ -1095,9 +1095,9 @@ discard block |
||
1095 | 1095 | |
1096 | 1096 | if ($pos_end) { |
1097 | 1097 | $extract = \rtrim( |
1098 | - self::substr($text, 0, $pos_end, $encoding), |
|
1099 | - $trimChars |
|
1100 | - ) . $replacerForSkippedText; |
|
1098 | + self::substr($text, 0, $pos_end, $encoding), |
|
1099 | + $trimChars |
|
1100 | + ) . $replacerForSkippedText; |
|
1101 | 1101 | } else { |
1102 | 1102 | $extract = $text; |
1103 | 1103 | } |
@@ -2808,10 +2808,10 @@ discard block |
||
2808 | 2808 | |
2809 | 2809 | /** @noinspection PhpComposerExtensionStubsInspection */ |
2810 | 2810 | return ( |
2811 | - \is_object($json) === true |
|
2811 | + \is_object($json) === true |
|
2812 | 2812 | || |
2813 | 2813 | \is_array($json) === true |
2814 | - ) |
|
2814 | + ) |
|
2815 | 2815 | && |
2816 | 2816 | \json_last_error() === JSON_ERROR_NONE; |
2817 | 2817 | } |
@@ -243,7 +243,7 @@ discard block |
||
243 | 243 | public static function add_bom_to_string(string $str): string |
244 | 244 | { |
245 | 245 | if (self::string_has_bom($str) === false) { |
246 | - $str = self::bom() . $str; |
|
246 | + $str = self::bom().$str; |
|
247 | 247 | } |
248 | 248 | |
249 | 249 | return $str; |
@@ -467,10 +467,10 @@ discard block |
||
467 | 467 | && |
468 | 468 | self::$SUPPORT['mbstring'] === false |
469 | 469 | ) { |
470 | - \trigger_error('UTF8::chr() without mbstring cannot handle "' . $encoding . '" encoding', E_USER_WARNING); |
|
470 | + \trigger_error('UTF8::chr() without mbstring cannot handle "'.$encoding.'" encoding', E_USER_WARNING); |
|
471 | 471 | } |
472 | 472 | |
473 | - $cacheKey = $code_point . $encoding; |
|
473 | + $cacheKey = $code_point.$encoding; |
|
474 | 474 | if (isset($CHAR_CACHE[$cacheKey]) === true) { |
475 | 475 | return $CHAR_CACHE[$cacheKey]; |
476 | 476 | } |
@@ -508,16 +508,16 @@ discard block |
||
508 | 508 | if ($code_point <= 0x7F) { |
509 | 509 | $chr = self::$CHR[$code_point]; |
510 | 510 | } elseif ($code_point <= 0x7FF) { |
511 | - $chr = self::$CHR[($code_point >> 6) + 0xC0] . |
|
511 | + $chr = self::$CHR[($code_point >> 6) + 0xC0]. |
|
512 | 512 | self::$CHR[($code_point & 0x3F) + 0x80]; |
513 | 513 | } elseif ($code_point <= 0xFFFF) { |
514 | - $chr = self::$CHR[($code_point >> 12) + 0xE0] . |
|
515 | - self::$CHR[(($code_point >> 6) & 0x3F) + 0x80] . |
|
514 | + $chr = self::$CHR[($code_point >> 12) + 0xE0]. |
|
515 | + self::$CHR[(($code_point >> 6) & 0x3F) + 0x80]. |
|
516 | 516 | self::$CHR[($code_point & 0x3F) + 0x80]; |
517 | 517 | } else { |
518 | - $chr = self::$CHR[($code_point >> 18) + 0xF0] . |
|
519 | - self::$CHR[(($code_point >> 12) & 0x3F) + 0x80] . |
|
520 | - self::$CHR[(($code_point >> 6) & 0x3F) + 0x80] . |
|
518 | + $chr = self::$CHR[($code_point >> 18) + 0xF0]. |
|
519 | + self::$CHR[(($code_point >> 12) & 0x3F) + 0x80]. |
|
520 | + self::$CHR[(($code_point >> 6) & 0x3F) + 0x80]. |
|
521 | 521 | self::$CHR[($code_point & 0x3F) + 0x80]; |
522 | 522 | } |
523 | 523 | |
@@ -565,7 +565,7 @@ discard block |
||
565 | 565 | |
566 | 566 | if (self::$SUPPORT['mbstring_func_overload'] === true) { |
567 | 567 | return \array_map( |
568 | - function ($data) { |
|
568 | + function($data) { |
|
569 | 569 | return UTF8::strlen($data, 'CP850'); // 8-BIT |
570 | 570 | }, |
571 | 571 | $strSplit |
@@ -849,7 +849,7 @@ discard block |
||
849 | 849 | */ |
850 | 850 | public static function decimal_to_chr($int): string |
851 | 851 | { |
852 | - return self::html_entity_decode('&#' . $int . ';', ENT_QUOTES | ENT_HTML5); |
|
852 | + return self::html_entity_decode('&#'.$int.';', ENT_QUOTES | ENT_HTML5); |
|
853 | 853 | } |
854 | 854 | |
855 | 855 | /** |
@@ -952,7 +952,7 @@ discard block |
||
952 | 952 | && |
953 | 953 | self::$SUPPORT['mbstring'] === false |
954 | 954 | ) { |
955 | - \trigger_error('UTF8::encode() without mbstring cannot handle "' . $encoding . '" encoding', E_USER_WARNING); |
|
955 | + \trigger_error('UTF8::encode() without mbstring cannot handle "'.$encoding.'" encoding', E_USER_WARNING); |
|
956 | 956 | } |
957 | 957 | |
958 | 958 | $strEncoded = \mb_convert_encoding( |
@@ -1014,7 +1014,7 @@ discard block |
||
1014 | 1014 | return \rtrim( |
1015 | 1015 | self::substr($text, 0, $pos, $encoding), |
1016 | 1016 | $trimChars |
1017 | - ) . $replacerForSkippedText; |
|
1017 | + ).$replacerForSkippedText; |
|
1018 | 1018 | } |
1019 | 1019 | |
1020 | 1020 | return $text; |
@@ -1058,7 +1058,7 @@ discard block |
||
1058 | 1058 | ) - $pos_start; |
1059 | 1059 | |
1060 | 1060 | if (!$pos_end || $pos_end <= 0) { |
1061 | - $extract = $replacerForSkippedText . \ltrim( |
|
1061 | + $extract = $replacerForSkippedText.\ltrim( |
|
1062 | 1062 | self::substr( |
1063 | 1063 | $text, |
1064 | 1064 | $pos_start, |
@@ -1068,7 +1068,7 @@ discard block |
||
1068 | 1068 | $trimChars |
1069 | 1069 | ); |
1070 | 1070 | } else { |
1071 | - $extract = $replacerForSkippedText . \trim( |
|
1071 | + $extract = $replacerForSkippedText.\trim( |
|
1072 | 1072 | self::substr( |
1073 | 1073 | $text, |
1074 | 1074 | $pos_start, |
@@ -1076,7 +1076,7 @@ discard block |
||
1076 | 1076 | $encoding |
1077 | 1077 | ), |
1078 | 1078 | $trimChars |
1079 | - ) . $replacerForSkippedText; |
|
1079 | + ).$replacerForSkippedText; |
|
1080 | 1080 | } |
1081 | 1081 | |
1082 | 1082 | } else { |
@@ -1097,7 +1097,7 @@ discard block |
||
1097 | 1097 | $extract = \rtrim( |
1098 | 1098 | self::substr($text, 0, $pos_end, $encoding), |
1099 | 1099 | $trimChars |
1100 | - ) . $replacerForSkippedText; |
|
1100 | + ).$replacerForSkippedText; |
|
1101 | 1101 | } else { |
1102 | 1102 | $extract = $text; |
1103 | 1103 | } |
@@ -1281,7 +1281,7 @@ discard block |
||
1281 | 1281 | ) { |
1282 | 1282 | // Prevent leading combining chars |
1283 | 1283 | // for NFC-safe concatenations. |
1284 | - $var = $leading_combining . $var; |
|
1284 | + $var = $leading_combining.$var; |
|
1285 | 1285 | } |
1286 | 1286 | } |
1287 | 1287 | |
@@ -1722,7 +1722,7 @@ discard block |
||
1722 | 1722 | */ |
1723 | 1723 | private static function getData(string $file) |
1724 | 1724 | { |
1725 | - $file = __DIR__ . '/data/' . $file . '.php'; |
|
1725 | + $file = __DIR__.'/data/'.$file.'.php'; |
|
1726 | 1726 | if (\file_exists($file)) { |
1727 | 1727 | /** @noinspection PhpIncludeInspection */ |
1728 | 1728 | return require $file; |
@@ -1799,16 +1799,16 @@ discard block |
||
1799 | 1799 | */ |
1800 | 1800 | public static function get_unique_string($entropyExtra = '', bool $md5 = true): string |
1801 | 1801 | { |
1802 | - $uniqueHelper = \mt_rand() . |
|
1803 | - \session_id() . |
|
1804 | - ($_SERVER['REMOTE_ADDR'] ?? '') . |
|
1805 | - ($_SERVER['SERVER_ADDR'] ?? '') . |
|
1802 | + $uniqueHelper = \mt_rand(). |
|
1803 | + \session_id(). |
|
1804 | + ($_SERVER['REMOTE_ADDR'] ?? ''). |
|
1805 | + ($_SERVER['SERVER_ADDR'] ?? ''). |
|
1806 | 1806 | $entropyExtra; |
1807 | 1807 | |
1808 | 1808 | $uniqueString = \uniqid($uniqueHelper, true); |
1809 | 1809 | |
1810 | 1810 | if ($md5) { |
1811 | - $uniqueString = \md5($uniqueString . $uniqueHelper); |
|
1811 | + $uniqueString = \md5($uniqueString.$uniqueHelper); |
|
1812 | 1812 | } |
1813 | 1813 | |
1814 | 1814 | return $uniqueString; |
@@ -1943,7 +1943,7 @@ discard block |
||
1943 | 1943 | return \implode( |
1944 | 1944 | '', |
1945 | 1945 | \array_map( |
1946 | - function ($data) use ($keepAsciiChars, $encoding) { |
|
1946 | + function($data) use ($keepAsciiChars, $encoding) { |
|
1947 | 1947 | return UTF8::single_chr_html_encode($data, $keepAsciiChars, $encoding); |
1948 | 1948 | }, |
1949 | 1949 | self::split($str) |
@@ -2059,7 +2059,7 @@ discard block |
||
2059 | 2059 | && |
2060 | 2060 | self::$SUPPORT['mbstring'] === false |
2061 | 2061 | ) { |
2062 | - \trigger_error('UTF8::html_entity_decode() without mbstring cannot handle "' . $encoding . '" encoding', E_USER_WARNING); |
|
2062 | + \trigger_error('UTF8::html_entity_decode() without mbstring cannot handle "'.$encoding.'" encoding', E_USER_WARNING); |
|
2063 | 2063 | } |
2064 | 2064 | |
2065 | 2065 | do { |
@@ -2067,7 +2067,7 @@ discard block |
||
2067 | 2067 | |
2068 | 2068 | $str = (string)\preg_replace_callback( |
2069 | 2069 | "/&#\d{2,6};/", |
2070 | - function ($matches) use ($encoding) { |
|
2070 | + function($matches) use ($encoding) { |
|
2071 | 2071 | $returnTmp = \mb_convert_encoding($matches[0], $encoding, 'HTML-ENTITIES'); |
2072 | 2072 | |
2073 | 2073 | if ($returnTmp !== '"' && $returnTmp !== "'") { |
@@ -2371,9 +2371,9 @@ discard block |
||
2371 | 2371 | { |
2372 | 2372 | $hex = \dechex($int); |
2373 | 2373 | |
2374 | - $hex = (\strlen($hex) < 4 ? \substr('0000' . $hex, -4) : $hex); |
|
2374 | + $hex = (\strlen($hex) < 4 ? \substr('0000'.$hex, -4) : $hex); |
|
2375 | 2375 | |
2376 | - return $pfix . $hex; |
|
2376 | + return $pfix.$hex; |
|
2377 | 2377 | } |
2378 | 2378 | |
2379 | 2379 | /** |
@@ -3304,7 +3304,7 @@ discard block |
||
3304 | 3304 | $cleanUtf8 |
3305 | 3305 | ); |
3306 | 3306 | |
3307 | - return $strPartOne . $strPartTwo; |
|
3307 | + return $strPartOne.$strPartTwo; |
|
3308 | 3308 | } |
3309 | 3309 | |
3310 | 3310 | /** |
@@ -3473,7 +3473,7 @@ discard block |
||
3473 | 3473 | $char = self::substr($str, -$i, 1, $encoding); |
3474 | 3474 | |
3475 | 3475 | if ($char == self::substr($otherStr, -$i, 1, $encoding)) { |
3476 | - $longestCommonSuffix = $char . $longestCommonSuffix; |
|
3476 | + $longestCommonSuffix = $char.$longestCommonSuffix; |
|
3477 | 3477 | } else { |
3478 | 3478 | break; |
3479 | 3479 | } |
@@ -3517,7 +3517,7 @@ discard block |
||
3517 | 3517 | */ |
3518 | 3518 | public static function matchesPattern(string $str, string $pattern): bool |
3519 | 3519 | { |
3520 | - if (\preg_match('/' . $pattern . '/u', $str)) { |
|
3520 | + if (\preg_match('/'.$pattern.'/u', $str)) { |
|
3521 | 3521 | return true; |
3522 | 3522 | } |
3523 | 3523 | |
@@ -3841,7 +3841,7 @@ discard block |
||
3841 | 3841 | } |
3842 | 3842 | } |
3843 | 3843 | |
3844 | - $cacheKey = $chr_orig . $encoding; |
|
3844 | + $cacheKey = $chr_orig.$encoding; |
|
3845 | 3845 | if (isset($CHAR_CACHE[$cacheKey]) === true) { |
3846 | 3846 | return $CHAR_CACHE[$cacheKey]; |
3847 | 3847 | } |
@@ -4078,7 +4078,7 @@ discard block |
||
4078 | 4078 | } |
4079 | 4079 | |
4080 | 4080 | $str = (string)\preg_replace( |
4081 | - $delimiter . $pattern . $delimiter . 'u' . $options, |
|
4081 | + $delimiter.$pattern.$delimiter.'u'.$options, |
|
4082 | 4082 | $replacement, |
4083 | 4083 | $str |
4084 | 4084 | ); |
@@ -4145,7 +4145,7 @@ discard block |
||
4145 | 4145 | if (\is_array($what) === true) { |
4146 | 4146 | /** @noinspection ForeachSourceInspection */ |
4147 | 4147 | foreach ($what as $item) { |
4148 | - $str = (string)\preg_replace('/(' . \preg_quote($item, '/') . ')+/', $item, $str); |
|
4148 | + $str = (string)\preg_replace('/('.\preg_quote($item, '/').')+/', $item, $str); |
|
4149 | 4149 | } |
4150 | 4150 | } |
4151 | 4151 | |
@@ -4273,7 +4273,7 @@ discard block |
||
4273 | 4273 | { |
4274 | 4274 | static $RX_CLASSS_CACHE = []; |
4275 | 4275 | |
4276 | - $cacheKey = $s . $class; |
|
4276 | + $cacheKey = $s.$class; |
|
4277 | 4277 | |
4278 | 4278 | if (isset($RX_CLASSS_CACHE[$cacheKey])) { |
4279 | 4279 | return $RX_CLASSS_CACHE[$cacheKey]; |
@@ -4285,7 +4285,7 @@ discard block |
||
4285 | 4285 | /** @noinspection SuspiciousLoopInspection */ |
4286 | 4286 | foreach (self::str_split($s) as $s) { |
4287 | 4287 | if ('-' === $s) { |
4288 | - $class[0] = '-' . $class[0]; |
|
4288 | + $class[0] = '-'.$class[0]; |
|
4289 | 4289 | } elseif (!isset($s[2])) { |
4290 | 4290 | $class[0] .= \preg_quote($s, '/'); |
4291 | 4291 | } elseif (1 === self::strlen($s)) { |
@@ -4296,13 +4296,13 @@ discard block |
||
4296 | 4296 | } |
4297 | 4297 | |
4298 | 4298 | if ($class[0]) { |
4299 | - $class[0] = '[' . $class[0] . ']'; |
|
4299 | + $class[0] = '['.$class[0].']'; |
|
4300 | 4300 | } |
4301 | 4301 | |
4302 | 4302 | if (1 === \count($class)) { |
4303 | 4303 | $return = $class[0]; |
4304 | 4304 | } else { |
4305 | - $return = '(?:' . \implode('|', $class) . ')'; |
|
4305 | + $return = '(?:'.\implode('|', $class).')'; |
|
4306 | 4306 | } |
4307 | 4307 | |
4308 | 4308 | $RX_CLASSS_CACHE[$cacheKey] = $return; |
@@ -4321,7 +4321,7 @@ discard block |
||
4321 | 4321 | |
4322 | 4322 | echo '<pre>'; |
4323 | 4323 | foreach (self::$SUPPORT as $key => $value) { |
4324 | - echo $key . ' - ' . \print_r($value, true) . "\n<br>"; |
|
4324 | + echo $key.' - '.\print_r($value, true)."\n<br>"; |
|
4325 | 4325 | } |
4326 | 4326 | echo '</pre>'; |
4327 | 4327 | } |
@@ -4353,7 +4353,7 @@ discard block |
||
4353 | 4353 | $encoding = self::normalize_encoding($encoding, 'UTF-8'); |
4354 | 4354 | } |
4355 | 4355 | |
4356 | - return '&#' . self::ord($char, $encoding) . ';'; |
|
4356 | + return '&#'.self::ord($char, $encoding).';'; |
|
4357 | 4357 | } |
4358 | 4358 | |
4359 | 4359 | /** |
@@ -4425,7 +4425,7 @@ discard block |
||
4425 | 4425 | ) { |
4426 | 4426 | |
4427 | 4427 | if (($str[$i + 1] & "\xC0") === "\x80") { |
4428 | - $ret[] = $str[$i] . $str[$i + 1]; |
|
4428 | + $ret[] = $str[$i].$str[$i + 1]; |
|
4429 | 4429 | |
4430 | 4430 | $i++; |
4431 | 4431 | } |
@@ -4441,7 +4441,7 @@ discard block |
||
4441 | 4441 | && |
4442 | 4442 | ($str[$i + 2] & "\xC0") === "\x80" |
4443 | 4443 | ) { |
4444 | - $ret[] = $str[$i] . $str[$i + 1] . $str[$i + 2]; |
|
4444 | + $ret[] = $str[$i].$str[$i + 1].$str[$i + 2]; |
|
4445 | 4445 | |
4446 | 4446 | $i += 2; |
4447 | 4447 | } |
@@ -4459,7 +4459,7 @@ discard block |
||
4459 | 4459 | && |
4460 | 4460 | ($str[$i + 3] & "\xC0") === "\x80" |
4461 | 4461 | ) { |
4462 | - $ret[] = $str[$i] . $str[$i + 1] . $str[$i + 2] . $str[$i + 3]; |
|
4462 | + $ret[] = $str[$i].$str[$i + 1].$str[$i + 2].$str[$i + 3]; |
|
4463 | 4463 | |
4464 | 4464 | $i += 3; |
4465 | 4465 | } |
@@ -4472,7 +4472,7 @@ discard block |
||
4472 | 4472 | $ret = \array_chunk($ret, $length); |
4473 | 4473 | |
4474 | 4474 | return \array_map( |
4475 | - function ($item) { |
|
4475 | + function($item) { |
|
4476 | 4476 | return \implode('', $item); |
4477 | 4477 | }, $ret |
4478 | 4478 | ); |
@@ -4675,7 +4675,7 @@ discard block |
||
4675 | 4675 | foreach (self::$ENCODINGS as $encodingTmp) { |
4676 | 4676 | # INFO: //IGNORE and //TRANSLIT still throw notice |
4677 | 4677 | /** @noinspection PhpUsageOfSilenceOperatorInspection */ |
4678 | - if (\md5(@\iconv($encodingTmp, $encodingTmp . '//IGNORE', $str)) === $md5) { |
|
4678 | + if (\md5(@\iconv($encodingTmp, $encodingTmp.'//IGNORE', $str)) === $md5) { |
|
4679 | 4679 | return $encodingTmp; |
4680 | 4680 | } |
4681 | 4681 | } |
@@ -4737,7 +4737,7 @@ discard block |
||
4737 | 4737 | public static function str_ensure_left(string $str, string $substring): string |
4738 | 4738 | { |
4739 | 4739 | if (!self::str_starts_with($str, $substring)) { |
4740 | - $str = $substring . $str; |
|
4740 | + $str = $substring.$str; |
|
4741 | 4741 | } |
4742 | 4742 | |
4743 | 4743 | return $str; |
@@ -4827,7 +4827,7 @@ discard block |
||
4827 | 4827 | $start = self::substr($str, 0, $index, $encoding); |
4828 | 4828 | $end = self::substr($str, $index, $len, $encoding); |
4829 | 4829 | |
4830 | - return $start . $substring . $end; |
|
4830 | + return $start.$substring.$end; |
|
4831 | 4831 | } |
4832 | 4832 | |
4833 | 4833 | /** |
@@ -4864,7 +4864,7 @@ discard block |
||
4864 | 4864 | if ('' === $s .= '') { |
4865 | 4865 | $s = '/^(?<=.)$/'; |
4866 | 4866 | } else { |
4867 | - $s = '/' . \preg_quote($s, '/') . '/ui'; |
|
4867 | + $s = '/'.\preg_quote($s, '/').'/ui'; |
|
4868 | 4868 | } |
4869 | 4869 | } |
4870 | 4870 | |
@@ -4944,7 +4944,7 @@ discard block |
||
4944 | 4944 | } |
4945 | 4945 | |
4946 | 4946 | if (self::substr($str, $length - 1, 1) === ' ') { |
4947 | - return (string)self::substr($str, 0, $length - 1) . $strAddOn; |
|
4947 | + return (string)self::substr($str, 0, $length - 1).$strAddOn; |
|
4948 | 4948 | } |
4949 | 4949 | |
4950 | 4950 | $str = (string)self::substr($str, 0, $length); |
@@ -4953,9 +4953,9 @@ discard block |
||
4953 | 4953 | $new_str = \implode(' ', $array); |
4954 | 4954 | |
4955 | 4955 | if ($new_str === '') { |
4956 | - $str = (string)self::substr($str, 0, $length - 1) . $strAddOn; |
|
4956 | + $str = (string)self::substr($str, 0, $length - 1).$strAddOn; |
|
4957 | 4957 | } else { |
4958 | - $str = $new_str . $strAddOn; |
|
4958 | + $str = $new_str.$strAddOn; |
|
4959 | 4959 | } |
4960 | 4960 | |
4961 | 4961 | return $str; |
@@ -5010,7 +5010,7 @@ discard block |
||
5010 | 5010 | $pre = ''; |
5011 | 5011 | } |
5012 | 5012 | |
5013 | - return $pre . $str . $post; |
|
5013 | + return $pre.$str.$post; |
|
5014 | 5014 | } |
5015 | 5015 | |
5016 | 5016 | return $str; |
@@ -5171,7 +5171,7 @@ discard block |
||
5171 | 5171 | } |
5172 | 5172 | |
5173 | 5173 | /** @noinspection NotOptimalRegularExpressionsInspection */ |
5174 | - \preg_match_all('/' . self::GRAPHEME_CLUSTER_RX . '/u', $str, $a); |
|
5174 | + \preg_match_all('/'.self::GRAPHEME_CLUSTER_RX.'/u', $str, $a); |
|
5175 | 5175 | $a = $a[0]; |
5176 | 5176 | |
5177 | 5177 | if ($len === 1) { |
@@ -5446,7 +5446,7 @@ discard block |
||
5446 | 5446 | public static function strcmp(string $str1, string $str2): int |
5447 | 5447 | { |
5448 | 5448 | /** @noinspection PhpUndefinedClassInspection */ |
5449 | - return $str1 . '' === $str2 . '' ? 0 : \strcmp( |
|
5449 | + return $str1.'' === $str2.'' ? 0 : \strcmp( |
|
5450 | 5450 | \Normalizer::normalize($str1, \Normalizer::NFD), |
5451 | 5451 | \Normalizer::normalize($str2, \Normalizer::NFD) |
5452 | 5452 | ); |
@@ -5480,7 +5480,7 @@ discard block |
||
5480 | 5480 | return null; |
5481 | 5481 | } |
5482 | 5482 | |
5483 | - if (\preg_match('/^(.*?)' . self::rxClass($charList) . '/us', $str, $length)) { |
|
5483 | + if (\preg_match('/^(.*?)'.self::rxClass($charList).'/us', $str, $length)) { |
|
5484 | 5484 | return self::strlen($length[1]); |
5485 | 5485 | } |
5486 | 5486 | |
@@ -5690,7 +5690,7 @@ discard block |
||
5690 | 5690 | && |
5691 | 5691 | self::$SUPPORT['mbstring'] === false |
5692 | 5692 | ) { |
5693 | - \trigger_error('UTF8::stristr() without mbstring cannot handle "' . $encoding . '" encoding', E_USER_WARNING); |
|
5693 | + \trigger_error('UTF8::stristr() without mbstring cannot handle "'.$encoding.'" encoding', E_USER_WARNING); |
|
5694 | 5694 | } |
5695 | 5695 | |
5696 | 5696 | if (self::$SUPPORT['mbstring'] === true) { |
@@ -5709,7 +5709,7 @@ discard block |
||
5709 | 5709 | return \stristr($haystack, $needle, $before_needle); |
5710 | 5710 | } |
5711 | 5711 | |
5712 | - \preg_match('/^(.*?)' . \preg_quote($needle, '/') . '/usi', $haystack, $match); |
|
5712 | + \preg_match('/^(.*?)'.\preg_quote($needle, '/').'/usi', $haystack, $match); |
|
5713 | 5713 | |
5714 | 5714 | if (!isset($match[1])) { |
5715 | 5715 | return false; |
@@ -5775,7 +5775,7 @@ discard block |
||
5775 | 5775 | && |
5776 | 5776 | self::$SUPPORT['iconv'] === false |
5777 | 5777 | ) { |
5778 | - \trigger_error('UTF8::strlen() without mbstring / iconv cannot handle "' . $encoding . '" encoding', E_USER_WARNING); |
|
5778 | + \trigger_error('UTF8::strlen() without mbstring / iconv cannot handle "'.$encoding.'" encoding', E_USER_WARNING); |
|
5779 | 5779 | } |
5780 | 5780 | |
5781 | 5781 | if ( |
@@ -5879,7 +5879,7 @@ discard block |
||
5879 | 5879 | */ |
5880 | 5880 | public static function strnatcmp(string $str1, string $str2): int |
5881 | 5881 | { |
5882 | - return $str1 . '' === $str2 . '' ? 0 : \strnatcmp(self::strtonatfold($str1), self::strtonatfold($str2)); |
|
5882 | + return $str1.'' === $str2.'' ? 0 : \strnatcmp(self::strtonatfold($str1), self::strtonatfold($str2)); |
|
5883 | 5883 | } |
5884 | 5884 | |
5885 | 5885 | /** |
@@ -5937,7 +5937,7 @@ discard block |
||
5937 | 5937 | return false; |
5938 | 5938 | } |
5939 | 5939 | |
5940 | - if (\preg_match('/' . self::rxClass($char_list) . '/us', $haystack, $m)) { |
|
5940 | + if (\preg_match('/'.self::rxClass($char_list).'/us', $haystack, $m)) { |
|
5941 | 5941 | return \substr($haystack, \strpos($haystack, $m[0])); |
5942 | 5942 | } |
5943 | 5943 | |
@@ -6001,7 +6001,7 @@ discard block |
||
6001 | 6001 | && |
6002 | 6002 | self::$SUPPORT['mbstring'] === false |
6003 | 6003 | ) { |
6004 | - \trigger_error('UTF8::strpos() without mbstring / iconv cannot handle "' . $encoding . '" encoding', E_USER_WARNING); |
|
6004 | + \trigger_error('UTF8::strpos() without mbstring / iconv cannot handle "'.$encoding.'" encoding', E_USER_WARNING); |
|
6005 | 6005 | } |
6006 | 6006 | |
6007 | 6007 | if ( |
@@ -6222,7 +6222,7 @@ discard block |
||
6222 | 6222 | && |
6223 | 6223 | self::$SUPPORT['mbstring'] === false |
6224 | 6224 | ) { |
6225 | - \trigger_error('UTF8::strripos() without mbstring cannot handle "' . $encoding . '" encoding', E_USER_WARNING); |
|
6225 | + \trigger_error('UTF8::strripos() without mbstring cannot handle "'.$encoding.'" encoding', E_USER_WARNING); |
|
6226 | 6226 | } |
6227 | 6227 | |
6228 | 6228 | if (self::$SUPPORT['mbstring'] === true) { |
@@ -6289,7 +6289,7 @@ discard block |
||
6289 | 6289 | && |
6290 | 6290 | self::$SUPPORT['mbstring'] === false |
6291 | 6291 | ) { |
6292 | - \trigger_error('UTF8::strrpos() without mbstring cannot handle "' . $encoding . '" encoding', E_USER_WARNING); |
|
6292 | + \trigger_error('UTF8::strrpos() without mbstring cannot handle "'.$encoding.'" encoding', E_USER_WARNING); |
|
6293 | 6293 | } |
6294 | 6294 | |
6295 | 6295 | if (self::$SUPPORT['mbstring'] === true) { |
@@ -6354,7 +6354,7 @@ discard block |
||
6354 | 6354 | return 0; |
6355 | 6355 | } |
6356 | 6356 | |
6357 | - return \preg_match('/^' . self::rxClass($mask) . '+/u', $str, $str) ? self::strlen($str[0]) : 0; |
|
6357 | + return \preg_match('/^'.self::rxClass($mask).'+/u', $str, $str) ? self::strlen($str[0]) : 0; |
|
6358 | 6358 | } |
6359 | 6359 | |
6360 | 6360 | /** |
@@ -6397,7 +6397,7 @@ discard block |
||
6397 | 6397 | && |
6398 | 6398 | self::$SUPPORT['mbstring'] === false |
6399 | 6399 | ) { |
6400 | - \trigger_error('UTF8::strstr() without mbstring cannot handle "' . $encoding . '" encoding', E_USER_WARNING); |
|
6400 | + \trigger_error('UTF8::strstr() without mbstring cannot handle "'.$encoding.'" encoding', E_USER_WARNING); |
|
6401 | 6401 | } |
6402 | 6402 | |
6403 | 6403 | if (self::$SUPPORT['mbstring'] === true) { |
@@ -6412,7 +6412,7 @@ discard block |
||
6412 | 6412 | return \grapheme_strstr($haystack, $needle, $before_needle); |
6413 | 6413 | } |
6414 | 6414 | |
6415 | - \preg_match('/^(.*?)' . \preg_quote($needle, '/') . '/us', $haystack, $match); |
|
6415 | + \preg_match('/^(.*?)'.\preg_quote($needle, '/').'/us', $haystack, $match); |
|
6416 | 6416 | |
6417 | 6417 | if (!isset($match[1])) { |
6418 | 6418 | return false; |
@@ -6510,9 +6510,9 @@ discard block |
||
6510 | 6510 | |
6511 | 6511 | if (self::$SUPPORT['intl'] === true) { |
6512 | 6512 | |
6513 | - $langCode = $lang . '-Lower'; |
|
6513 | + $langCode = $lang.'-Lower'; |
|
6514 | 6514 | if (!\in_array($langCode, self::$SUPPORT['intl__transliterator_list_ids'], true)) { |
6515 | - \trigger_error('UTF8::strtolower() cannot handle special language: ' . $lang, E_USER_WARNING); |
|
6515 | + \trigger_error('UTF8::strtolower() cannot handle special language: '.$lang, E_USER_WARNING); |
|
6516 | 6516 | |
6517 | 6517 | $langCode = 'Any-Lower'; |
6518 | 6518 | } |
@@ -6521,7 +6521,7 @@ discard block |
||
6521 | 6521 | return transliterator_transliterate($langCode, $str); |
6522 | 6522 | } |
6523 | 6523 | |
6524 | - \trigger_error('UTF8::strtolower() without intl cannot handle the "lang" parameter: ' . $lang, E_USER_WARNING); |
|
6524 | + \trigger_error('UTF8::strtolower() without intl cannot handle the "lang" parameter: '.$lang, E_USER_WARNING); |
|
6525 | 6525 | } |
6526 | 6526 | |
6527 | 6527 | return \mb_strtolower($str, $encoding); |
@@ -6577,9 +6577,9 @@ discard block |
||
6577 | 6577 | |
6578 | 6578 | if (self::$SUPPORT['intl'] === true) { |
6579 | 6579 | |
6580 | - $langCode = $lang . '-Upper'; |
|
6580 | + $langCode = $lang.'-Upper'; |
|
6581 | 6581 | if (!\in_array($langCode, self::$SUPPORT['intl__transliterator_list_ids'], true)) { |
6582 | - \trigger_error('UTF8::strtoupper() without intl for special language: ' . $lang, E_USER_WARNING); |
|
6582 | + \trigger_error('UTF8::strtoupper() without intl for special language: '.$lang, E_USER_WARNING); |
|
6583 | 6583 | |
6584 | 6584 | $langCode = 'Any-Upper'; |
6585 | 6585 | } |
@@ -6588,7 +6588,7 @@ discard block |
||
6588 | 6588 | return transliterator_transliterate($langCode, $str); |
6589 | 6589 | } |
6590 | 6590 | |
6591 | - \trigger_error('UTF8::strtolower() without intl + PHP >= 5.4 cannot handle the "lang"-parameter: ' . $lang, E_USER_WARNING); |
|
6591 | + \trigger_error('UTF8::strtolower() without intl + PHP >= 5.4 cannot handle the "lang"-parameter: '.$lang, E_USER_WARNING); |
|
6592 | 6592 | } |
6593 | 6593 | |
6594 | 6594 | return \mb_strtoupper($str, $encoding); |
@@ -6744,7 +6744,7 @@ discard block |
||
6744 | 6744 | && |
6745 | 6745 | self::$SUPPORT['mbstring'] === false |
6746 | 6746 | ) { |
6747 | - \trigger_error('UTF8::substr() without mbstring cannot handle "' . $encoding . '" encoding', E_USER_WARNING); |
|
6747 | + \trigger_error('UTF8::substr() without mbstring cannot handle "'.$encoding.'" encoding', E_USER_WARNING); |
|
6748 | 6748 | } |
6749 | 6749 | |
6750 | 6750 | if (self::$SUPPORT['mbstring'] === true) { |
@@ -6772,8 +6772,7 @@ discard block |
||
6772 | 6772 | |
6773 | 6773 | if (self::is_ascii($str)) { |
6774 | 6774 | return ($length === null) ? |
6775 | - \substr($str, $offset) : |
|
6776 | - \substr($str, $offset, $length); |
|
6775 | + \substr($str, $offset) : \substr($str, $offset, $length); |
|
6777 | 6776 | } |
6778 | 6777 | |
6779 | 6778 | // fallback via vanilla php |
@@ -6901,14 +6900,14 @@ discard block |
||
6901 | 6900 | && |
6902 | 6901 | self::$SUPPORT['mbstring'] === false |
6903 | 6902 | ) { |
6904 | - \trigger_error('UTF8::substr_count() without mbstring cannot handle "' . $encoding . '" encoding', E_USER_WARNING); |
|
6903 | + \trigger_error('UTF8::substr_count() without mbstring cannot handle "'.$encoding.'" encoding', E_USER_WARNING); |
|
6905 | 6904 | } |
6906 | 6905 | |
6907 | 6906 | if (self::$SUPPORT['mbstring'] === true) { |
6908 | 6907 | return \mb_substr_count($haystack, $needle, $encoding); |
6909 | 6908 | } |
6910 | 6909 | |
6911 | - \preg_match_all('/' . \preg_quote($needle, '/') . '/us', $haystack, $matches, PREG_SET_ORDER); |
|
6910 | + \preg_match_all('/'.\preg_quote($needle, '/').'/us', $haystack, $matches, PREG_SET_ORDER); |
|
6912 | 6911 | |
6913 | 6912 | return \count($matches); |
6914 | 6913 | } |
@@ -7108,8 +7107,7 @@ discard block |
||
7108 | 7107 | |
7109 | 7108 | if (self::is_ascii($str)) { |
7110 | 7109 | return ($length === null) ? |
7111 | - \substr_replace($str, $replacement, $offset) : |
|
7112 | - \substr_replace($str, $replacement, $offset, $length); |
|
7110 | + \substr_replace($str, $replacement, $offset) : \substr_replace($str, $replacement, $offset, $length); |
|
7113 | 7111 | } |
7114 | 7112 | |
7115 | 7113 | \preg_match_all('/./us', $str, $smatches); |
@@ -7555,7 +7553,7 @@ discard block |
||
7555 | 7553 | $c2 = $i + 1 >= $max ? "\x00" : $str[$i + 1]; |
7556 | 7554 | |
7557 | 7555 | if ($c2 >= "\x80" && $c2 <= "\xBF") { // yeah, almost sure it's UTF8 already |
7558 | - $buf .= $c1 . $c2; |
|
7556 | + $buf .= $c1.$c2; |
|
7559 | 7557 | $i++; |
7560 | 7558 | } else { // not valid UTF8 - convert it |
7561 | 7559 | $buf .= self::to_utf8_convert($c1); |
@@ -7567,7 +7565,7 @@ discard block |
||
7567 | 7565 | $c3 = $i + 2 >= $max ? "\x00" : $str[$i + 2]; |
7568 | 7566 | |
7569 | 7567 | if ($c2 >= "\x80" && $c2 <= "\xBF" && $c3 >= "\x80" && $c3 <= "\xBF") { // yeah, almost sure it's UTF8 already |
7570 | - $buf .= $c1 . $c2 . $c3; |
|
7568 | + $buf .= $c1.$c2.$c3; |
|
7571 | 7569 | $i += 2; |
7572 | 7570 | } else { // not valid UTF8 - convert it |
7573 | 7571 | $buf .= self::to_utf8_convert($c1); |
@@ -7580,7 +7578,7 @@ discard block |
||
7580 | 7578 | $c4 = $i + 3 >= $max ? "\x00" : $str[$i + 3]; |
7581 | 7579 | |
7582 | 7580 | if ($c2 >= "\x80" && $c2 <= "\xBF" && $c3 >= "\x80" && $c3 <= "\xBF" && $c4 >= "\x80" && $c4 <= "\xBF") { // yeah, almost sure it's UTF8 already |
7583 | - $buf .= $c1 . $c2 . $c3 . $c4; |
|
7581 | + $buf .= $c1.$c2.$c3.$c4; |
|
7584 | 7582 | $i += 3; |
7585 | 7583 | } else { // not valid UTF8 - convert it |
7586 | 7584 | $buf .= self::to_utf8_convert($c1); |
@@ -7602,7 +7600,7 @@ discard block |
||
7602 | 7600 | // decode unicode escape sequences |
7603 | 7601 | $buf = \preg_replace_callback( |
7604 | 7602 | '/\\\\u([0-9a-f]{4})/i', |
7605 | - function ($match) { |
|
7603 | + function($match) { |
|
7606 | 7604 | return \mb_convert_encoding(pack('H*', $match[1]), 'UTF-8', 'UCS-2BE'); |
7607 | 7605 | }, |
7608 | 7606 | $buf |
@@ -7644,7 +7642,7 @@ discard block |
||
7644 | 7642 | } else { |
7645 | 7643 | $cc1 = self::$CHR[$ordC1 / 64] | "\xC0"; |
7646 | 7644 | $cc2 = ($int & "\x3F") | "\x80"; |
7647 | - $buf .= $cc1 . $cc2; |
|
7645 | + $buf .= $cc1.$cc2; |
|
7648 | 7646 | } |
7649 | 7647 | |
7650 | 7648 | return $buf; |
@@ -7708,7 +7706,7 @@ discard block |
||
7708 | 7706 | $cleanUtf8 |
7709 | 7707 | ); |
7710 | 7708 | |
7711 | - return $strPartOne . $strPartTwo; |
|
7709 | + return $strPartOne.$strPartTwo; |
|
7712 | 7710 | } |
7713 | 7711 | |
7714 | 7712 | /** |
@@ -7753,7 +7751,7 @@ discard block |
||
7753 | 7751 | $str = self::clean($str); |
7754 | 7752 | } |
7755 | 7753 | |
7756 | - $usePhpDefaultFunctions = !(bool)($charlist . \implode('', $exceptions)); |
|
7754 | + $usePhpDefaultFunctions = !(bool)($charlist.\implode('', $exceptions)); |
|
7757 | 7755 | |
7758 | 7756 | if ( |
7759 | 7757 | $usePhpDefaultFunctions === true |
@@ -8255,7 +8253,7 @@ discard block |
||
8255 | 8253 | return ''; |
8256 | 8254 | } |
8257 | 8255 | |
8258 | - \preg_match('/^\s*+(?:\S++\s*+){1,' . $limit . '}/u', $str, $matches); |
|
8256 | + \preg_match('/^\s*+(?:\S++\s*+){1,'.$limit.'}/u', $str, $matches); |
|
8259 | 8257 | |
8260 | 8258 | if ( |
8261 | 8259 | !isset($matches[0]) |
@@ -8265,7 +8263,7 @@ discard block |
||
8265 | 8263 | return $str; |
8266 | 8264 | } |
8267 | 8265 | |
8268 | - return self::rtrim($matches[0]) . $strAddOn; |
|
8266 | + return self::rtrim($matches[0]).$strAddOn; |
|
8269 | 8267 | } |
8270 | 8268 | |
8271 | 8269 | /** |
@@ -8330,7 +8328,7 @@ discard block |
||
8330 | 8328 | $strReturn .= $break; |
8331 | 8329 | } |
8332 | 8330 | |
8333 | - return $strReturn . \implode('', $chars); |
|
8331 | + return $strReturn.\implode('', $chars); |
|
8334 | 8332 | } |
8335 | 8333 | |
8336 | 8334 | /** |