@@ -264,7 +264,7 @@ discard block |
||
| 264 | 264 | public static function add_bom_to_string(string $str): string |
| 265 | 265 | { |
| 266 | 266 | if (self::string_has_bom($str) === false) { |
| 267 | - $str = self::bom() . $str; |
|
| 267 | + $str = self::bom().$str; |
|
| 268 | 268 | } |
| 269 | 269 | |
| 270 | 270 | return $str; |
@@ -531,10 +531,10 @@ discard block |
||
| 531 | 531 | && |
| 532 | 532 | self::$SUPPORT['mbstring'] === false |
| 533 | 533 | ) { |
| 534 | - \trigger_error('UTF8::chr() without mbstring cannot handle "' . $encoding . '" encoding', E_USER_WARNING); |
|
| 534 | + \trigger_error('UTF8::chr() without mbstring cannot handle "'.$encoding.'" encoding', E_USER_WARNING); |
|
| 535 | 535 | } |
| 536 | 536 | |
| 537 | - $cacheKey = $code_point . $encoding; |
|
| 537 | + $cacheKey = $code_point.$encoding; |
|
| 538 | 538 | if (isset($CHAR_CACHE[$cacheKey]) === true) { |
| 539 | 539 | return $CHAR_CACHE[$cacheKey]; |
| 540 | 540 | } |
@@ -579,16 +579,16 @@ discard block |
||
| 579 | 579 | if ($code_point <= 0x7F) { |
| 580 | 580 | $chr = self::$CHR[$code_point]; |
| 581 | 581 | } elseif ($code_point <= 0x7FF) { |
| 582 | - $chr = self::$CHR[($code_point >> 6) + 0xC0] . |
|
| 582 | + $chr = self::$CHR[($code_point >> 6) + 0xC0]. |
|
| 583 | 583 | self::$CHR[($code_point & 0x3F) + 0x80]; |
| 584 | 584 | } elseif ($code_point <= 0xFFFF) { |
| 585 | - $chr = self::$CHR[($code_point >> 12) + 0xE0] . |
|
| 586 | - self::$CHR[(($code_point >> 6) & 0x3F) + 0x80] . |
|
| 585 | + $chr = self::$CHR[($code_point >> 12) + 0xE0]. |
|
| 586 | + self::$CHR[(($code_point >> 6) & 0x3F) + 0x80]. |
|
| 587 | 587 | self::$CHR[($code_point & 0x3F) + 0x80]; |
| 588 | 588 | } else { |
| 589 | - $chr = self::$CHR[($code_point >> 18) + 0xF0] . |
|
| 590 | - self::$CHR[(($code_point >> 12) & 0x3F) + 0x80] . |
|
| 591 | - self::$CHR[(($code_point >> 6) & 0x3F) + 0x80] . |
|
| 589 | + $chr = self::$CHR[($code_point >> 18) + 0xF0]. |
|
| 590 | + self::$CHR[(($code_point >> 12) & 0x3F) + 0x80]. |
|
| 591 | + self::$CHR[(($code_point >> 6) & 0x3F) + 0x80]. |
|
| 592 | 592 | self::$CHR[($code_point & 0x3F) + 0x80]; |
| 593 | 593 | } |
| 594 | 594 | |
@@ -640,7 +640,7 @@ discard block |
||
| 640 | 640 | |
| 641 | 641 | if (self::$SUPPORT['mbstring_func_overload'] === true) { |
| 642 | 642 | return \array_map( |
| 643 | - function ($data) { |
|
| 643 | + function($data) { |
|
| 644 | 644 | return UTF8::strlen_in_byte($data); |
| 645 | 645 | }, |
| 646 | 646 | $strSplit |
@@ -955,7 +955,7 @@ discard block |
||
| 955 | 955 | */ |
| 956 | 956 | public static function decimal_to_chr($int): string |
| 957 | 957 | { |
| 958 | - return self::html_entity_decode('&#' . $int . ';', ENT_QUOTES | ENT_HTML5); |
|
| 958 | + return self::html_entity_decode('&#'.$int.';', ENT_QUOTES | ENT_HTML5); |
|
| 959 | 959 | } |
| 960 | 960 | |
| 961 | 961 | /** |
@@ -1111,7 +1111,7 @@ discard block |
||
| 1111 | 1111 | && |
| 1112 | 1112 | self::$SUPPORT['mbstring'] === false |
| 1113 | 1113 | ) { |
| 1114 | - \trigger_error('UTF8::encode() without mbstring cannot handle "' . $toEncoding . '" encoding', E_USER_WARNING); |
|
| 1114 | + \trigger_error('UTF8::encode() without mbstring cannot handle "'.$toEncoding.'" encoding', E_USER_WARNING); |
|
| 1115 | 1115 | } |
| 1116 | 1116 | |
| 1117 | 1117 | if (!isset(self::$SUPPORT['already_checked_via_portable_utf8'])) { |
@@ -1227,7 +1227,7 @@ discard block |
||
| 1227 | 1227 | return ''; |
| 1228 | 1228 | } |
| 1229 | 1229 | |
| 1230 | - return \rtrim($strSub, $trimChars) . $replacerForSkippedText; |
|
| 1230 | + return \rtrim($strSub, $trimChars).$replacerForSkippedText; |
|
| 1231 | 1231 | } |
| 1232 | 1232 | |
| 1233 | 1233 | return $str; |
@@ -1263,14 +1263,14 @@ discard block |
||
| 1263 | 1263 | if (!$pos_end || $pos_end <= 0) { |
| 1264 | 1264 | $strSub = self::substr($str, $pos_start, self::strlen($str), $encoding); |
| 1265 | 1265 | if ($strSub !== false) { |
| 1266 | - $extract = $replacerForSkippedText . \ltrim($strSub, $trimChars); |
|
| 1266 | + $extract = $replacerForSkippedText.\ltrim($strSub, $trimChars); |
|
| 1267 | 1267 | } else { |
| 1268 | 1268 | $extract = ''; |
| 1269 | 1269 | } |
| 1270 | 1270 | } else { |
| 1271 | 1271 | $strSub = self::substr($str, $pos_start, $pos_end, $encoding); |
| 1272 | 1272 | if ($strSub !== false) { |
| 1273 | - $extract = $replacerForSkippedText . \trim($strSub, $trimChars) . $replacerForSkippedText; |
|
| 1273 | + $extract = $replacerForSkippedText.\trim($strSub, $trimChars).$replacerForSkippedText; |
|
| 1274 | 1274 | } else { |
| 1275 | 1275 | $extract = ''; |
| 1276 | 1276 | } |
@@ -1293,7 +1293,7 @@ discard block |
||
| 1293 | 1293 | if ($pos_end) { |
| 1294 | 1294 | $strSub = self::substr($str, 0, $pos_end, $encoding); |
| 1295 | 1295 | if ($strSub !== false) { |
| 1296 | - $extract = \rtrim($strSub, $trimChars) . $replacerForSkippedText; |
|
| 1296 | + $extract = \rtrim($strSub, $trimChars).$replacerForSkippedText; |
|
| 1297 | 1297 | } else { |
| 1298 | 1298 | $extract = ''; |
| 1299 | 1299 | } |
@@ -1415,7 +1415,7 @@ discard block |
||
| 1415 | 1415 | { |
| 1416 | 1416 | $file_content = \file_get_contents($file_path); |
| 1417 | 1417 | if ($file_content === false) { |
| 1418 | - throw new \RuntimeException('file_get_contents() returned false for:' . $file_path); |
|
| 1418 | + throw new \RuntimeException('file_get_contents() returned false for:'.$file_path); |
|
| 1419 | 1419 | } |
| 1420 | 1420 | |
| 1421 | 1421 | return self::string_has_bom($file_content); |
@@ -1475,7 +1475,7 @@ discard block |
||
| 1475 | 1475 | ) { |
| 1476 | 1476 | // Prevent leading combining chars |
| 1477 | 1477 | // for NFC-safe concatenations. |
| 1478 | - $var = $leading_combining . $var; |
|
| 1478 | + $var = $leading_combining.$var; |
|
| 1479 | 1479 | } |
| 1480 | 1480 | } |
| 1481 | 1481 | |
@@ -1970,7 +1970,7 @@ discard block |
||
| 1970 | 1970 | */ |
| 1971 | 1971 | private static function getData(string $file) |
| 1972 | 1972 | { |
| 1973 | - $file = __DIR__ . '/data/' . $file . '.php'; |
|
| 1973 | + $file = __DIR__.'/data/'.$file.'.php'; |
|
| 1974 | 1974 | if (\file_exists($file)) { |
| 1975 | 1975 | /** @noinspection PhpIncludeInspection */ |
| 1976 | 1976 | return require $file; |
@@ -2032,7 +2032,7 @@ discard block |
||
| 2032 | 2032 | } |
| 2033 | 2033 | |
| 2034 | 2034 | $str_info = \unpack('C2chars', $str_info); |
| 2035 | - $type_code = (int)($str_info['chars1'] . $str_info['chars2']); |
|
| 2035 | + $type_code = (int)($str_info['chars1'].$str_info['chars2']); |
|
| 2036 | 2036 | |
| 2037 | 2037 | // DEBUG |
| 2038 | 2038 | //var_dump($type_code); |
@@ -2145,16 +2145,16 @@ discard block |
||
| 2145 | 2145 | */ |
| 2146 | 2146 | public static function get_unique_string($entropyExtra = '', bool $md5 = true): string |
| 2147 | 2147 | { |
| 2148 | - $uniqueHelper = \mt_rand() . |
|
| 2149 | - \session_id() . |
|
| 2150 | - ($_SERVER['REMOTE_ADDR'] ?? '') . |
|
| 2151 | - ($_SERVER['SERVER_ADDR'] ?? '') . |
|
| 2148 | + $uniqueHelper = \mt_rand(). |
|
| 2149 | + \session_id(). |
|
| 2150 | + ($_SERVER['REMOTE_ADDR'] ?? ''). |
|
| 2151 | + ($_SERVER['SERVER_ADDR'] ?? ''). |
|
| 2152 | 2152 | $entropyExtra; |
| 2153 | 2153 | |
| 2154 | 2154 | $uniqueString = \uniqid($uniqueHelper, true); |
| 2155 | 2155 | |
| 2156 | 2156 | if ($md5) { |
| 2157 | - $uniqueString = \md5($uniqueString . $uniqueHelper); |
|
| 2157 | + $uniqueString = \md5($uniqueString.$uniqueHelper); |
|
| 2158 | 2158 | } |
| 2159 | 2159 | |
| 2160 | 2160 | return $uniqueString; |
@@ -2299,7 +2299,7 @@ discard block |
||
| 2299 | 2299 | return \implode( |
| 2300 | 2300 | '', |
| 2301 | 2301 | \array_map( |
| 2302 | - function ($chr) use ($keepAsciiChars, $encoding) { |
|
| 2302 | + function($chr) use ($keepAsciiChars, $encoding) { |
|
| 2303 | 2303 | return UTF8::single_chr_html_encode($chr, $keepAsciiChars, $encoding); |
| 2304 | 2304 | }, |
| 2305 | 2305 | self::split($str) |
@@ -2415,7 +2415,7 @@ discard block |
||
| 2415 | 2415 | && |
| 2416 | 2416 | self::$SUPPORT['mbstring'] === false |
| 2417 | 2417 | ) { |
| 2418 | - \trigger_error('UTF8::html_entity_decode() without mbstring cannot handle "' . $encoding . '" encoding', E_USER_WARNING); |
|
| 2418 | + \trigger_error('UTF8::html_entity_decode() without mbstring cannot handle "'.$encoding.'" encoding', E_USER_WARNING); |
|
| 2419 | 2419 | } |
| 2420 | 2420 | |
| 2421 | 2421 | if (!isset(self::$SUPPORT['already_checked_via_portable_utf8'])) { |
@@ -2438,7 +2438,7 @@ discard block |
||
| 2438 | 2438 | |
| 2439 | 2439 | $str = (string)\preg_replace_callback( |
| 2440 | 2440 | "/&#\d{2,6};/", |
| 2441 | - function ($matches) use ($encoding) { |
|
| 2441 | + function($matches) use ($encoding) { |
|
| 2442 | 2442 | // always fallback via symfony polyfill |
| 2443 | 2443 | $returnTmp = \mb_convert_encoding($matches[0], $encoding, 'HTML-ENTITIES'); |
| 2444 | 2444 | |
@@ -2781,9 +2781,9 @@ discard block |
||
| 2781 | 2781 | { |
| 2782 | 2782 | $hex = \dechex($int); |
| 2783 | 2783 | |
| 2784 | - $hex = (\strlen($hex) < 4 ? \substr('0000' . $hex, -4) : $hex); |
|
| 2784 | + $hex = (\strlen($hex) < 4 ? \substr('0000'.$hex, -4) : $hex); |
|
| 2785 | 2785 | |
| 2786 | - return $pfix . $hex . ''; |
|
| 2786 | + return $pfix.$hex.''; |
|
| 2787 | 2787 | } |
| 2788 | 2788 | |
| 2789 | 2789 | /** |
@@ -3720,7 +3720,7 @@ discard block |
||
| 3720 | 3720 | $cleanUtf8 |
| 3721 | 3721 | ); |
| 3722 | 3722 | |
| 3723 | - return $strPartOne . $strPartTwo; |
|
| 3723 | + return $strPartOne.$strPartTwo; |
|
| 3724 | 3724 | } |
| 3725 | 3725 | |
| 3726 | 3726 | /** |
@@ -4203,7 +4203,7 @@ discard block |
||
| 4203 | 4203 | } |
| 4204 | 4204 | } |
| 4205 | 4205 | |
| 4206 | - $cacheKey = $chr_orig . $encoding; |
|
| 4206 | + $cacheKey = $chr_orig.$encoding; |
|
| 4207 | 4207 | if (isset($CHAR_CACHE[$cacheKey]) === true) { |
| 4208 | 4208 | return $CHAR_CACHE[$cacheKey]; |
| 4209 | 4209 | } |
@@ -4456,7 +4456,7 @@ discard block |
||
| 4456 | 4456 | } |
| 4457 | 4457 | |
| 4458 | 4458 | $str = (string)\preg_replace( |
| 4459 | - $delimiter . $pattern . $delimiter . 'u' . $options, |
|
| 4459 | + $delimiter.$pattern.$delimiter.'u'.$options, |
|
| 4460 | 4460 | $replacement, |
| 4461 | 4461 | $str |
| 4462 | 4462 | ); |
@@ -4527,7 +4527,7 @@ discard block |
||
| 4527 | 4527 | if (\is_array($what) === true) { |
| 4528 | 4528 | /** @noinspection ForeachSourceInspection */ |
| 4529 | 4529 | foreach ($what as $item) { |
| 4530 | - $str = (string)\preg_replace('/(' . \preg_quote($item, '/') . ')+/', $item, $str); |
|
| 4530 | + $str = (string)\preg_replace('/('.\preg_quote($item, '/').')+/', $item, $str); |
|
| 4531 | 4531 | } |
| 4532 | 4532 | } |
| 4533 | 4533 | |
@@ -4775,7 +4775,7 @@ discard block |
||
| 4775 | 4775 | { |
| 4776 | 4776 | static $RX_CLASSS_CACHE = []; |
| 4777 | 4777 | |
| 4778 | - $cacheKey = $s . $class; |
|
| 4778 | + $cacheKey = $s.$class; |
|
| 4779 | 4779 | |
| 4780 | 4780 | if (isset($RX_CLASSS_CACHE[$cacheKey])) { |
| 4781 | 4781 | return $RX_CLASSS_CACHE[$cacheKey]; |
@@ -4787,7 +4787,7 @@ discard block |
||
| 4787 | 4787 | /** @noinspection SuspiciousLoopInspection */ |
| 4788 | 4788 | foreach (self::str_split($s) as $s) { |
| 4789 | 4789 | if ('-' === $s) { |
| 4790 | - $class[0] = '-' . $class[0]; |
|
| 4790 | + $class[0] = '-'.$class[0]; |
|
| 4791 | 4791 | } elseif (!isset($s[2])) { |
| 4792 | 4792 | $class[0] .= \preg_quote($s, '/'); |
| 4793 | 4793 | } elseif (1 === self::strlen($s)) { |
@@ -4798,13 +4798,13 @@ discard block |
||
| 4798 | 4798 | } |
| 4799 | 4799 | |
| 4800 | 4800 | if ($class[0]) { |
| 4801 | - $class[0] = '[' . $class[0] . ']'; |
|
| 4801 | + $class[0] = '['.$class[0].']'; |
|
| 4802 | 4802 | } |
| 4803 | 4803 | |
| 4804 | 4804 | if (1 === \count($class)) { |
| 4805 | 4805 | $return = $class[0]; |
| 4806 | 4806 | } else { |
| 4807 | - $return = '(?:' . \implode('|', $class) . ')'; |
|
| 4807 | + $return = '(?:'.\implode('|', $class).')'; |
|
| 4808 | 4808 | } |
| 4809 | 4809 | |
| 4810 | 4810 | $RX_CLASSS_CACHE[$cacheKey] = $return; |
@@ -4823,7 +4823,7 @@ discard block |
||
| 4823 | 4823 | |
| 4824 | 4824 | echo '<pre>'; |
| 4825 | 4825 | foreach (self::$SUPPORT as $key => $value) { |
| 4826 | - echo $key . ' - ' . \print_r($value, true) . "\n<br>"; |
|
| 4826 | + echo $key.' - '.\print_r($value, true)."\n<br>"; |
|
| 4827 | 4827 | } |
| 4828 | 4828 | echo '</pre>'; |
| 4829 | 4829 | } |
@@ -4855,7 +4855,7 @@ discard block |
||
| 4855 | 4855 | $encoding = self::normalize_encoding($encoding, 'UTF-8'); |
| 4856 | 4856 | } |
| 4857 | 4857 | |
| 4858 | - return '&#' . self::ord($char, $encoding) . ';'; |
|
| 4858 | + return '&#'.self::ord($char, $encoding).';'; |
|
| 4859 | 4859 | } |
| 4860 | 4860 | |
| 4861 | 4861 | /** |
@@ -4942,7 +4942,7 @@ discard block |
||
| 4942 | 4942 | ) { |
| 4943 | 4943 | |
| 4944 | 4944 | if (($str[$i + 1] & "\xC0") === "\x80") { |
| 4945 | - $ret[] = $str[$i] . $str[$i + 1]; |
|
| 4945 | + $ret[] = $str[$i].$str[$i + 1]; |
|
| 4946 | 4946 | |
| 4947 | 4947 | $i++; |
| 4948 | 4948 | } |
@@ -4958,7 +4958,7 @@ discard block |
||
| 4958 | 4958 | && |
| 4959 | 4959 | ($str[$i + 2] & "\xC0") === "\x80" |
| 4960 | 4960 | ) { |
| 4961 | - $ret[] = $str[$i] . $str[$i + 1] . $str[$i + 2]; |
|
| 4961 | + $ret[] = $str[$i].$str[$i + 1].$str[$i + 2]; |
|
| 4962 | 4962 | |
| 4963 | 4963 | $i += 2; |
| 4964 | 4964 | } |
@@ -4976,7 +4976,7 @@ discard block |
||
| 4976 | 4976 | && |
| 4977 | 4977 | ($str[$i + 3] & "\xC0") === "\x80" |
| 4978 | 4978 | ) { |
| 4979 | - $ret[] = $str[$i] . $str[$i + 1] . $str[$i + 2] . $str[$i + 3]; |
|
| 4979 | + $ret[] = $str[$i].$str[$i + 1].$str[$i + 2].$str[$i + 3]; |
|
| 4980 | 4980 | |
| 4981 | 4981 | $i += 3; |
| 4982 | 4982 | } |
@@ -4989,7 +4989,7 @@ discard block |
||
| 4989 | 4989 | $ret = \array_chunk($ret, $length); |
| 4990 | 4990 | |
| 4991 | 4991 | return \array_map( |
| 4992 | - function ($item) { |
|
| 4992 | + function($item) { |
|
| 4993 | 4993 | return \implode('', $item); |
| 4994 | 4994 | }, $ret |
| 4995 | 4995 | ); |
@@ -5019,7 +5019,7 @@ discard block |
||
| 5019 | 5019 | |
| 5020 | 5020 | $str = (string)\preg_replace_callback( |
| 5021 | 5021 | '/[-_\s]+(.)?/u', |
| 5022 | - function ($match) use ($encoding) { |
|
| 5022 | + function($match) use ($encoding) { |
|
| 5023 | 5023 | if (isset($match[1])) { |
| 5024 | 5024 | return UTF8::strtoupper($match[1], $encoding); |
| 5025 | 5025 | } |
@@ -5031,7 +5031,7 @@ discard block |
||
| 5031 | 5031 | |
| 5032 | 5032 | $str = (string)\preg_replace_callback( |
| 5033 | 5033 | '/[\d]+(.)?/u', |
| 5034 | - function ($match) use ($encoding) { |
|
| 5034 | + function($match) use ($encoding) { |
|
| 5035 | 5035 | return UTF8::strtoupper($match[0], $encoding); |
| 5036 | 5036 | }, |
| 5037 | 5037 | $str |
@@ -5398,7 +5398,7 @@ discard block |
||
| 5398 | 5398 | foreach (self::$ENCODINGS as $encodingTmp) { |
| 5399 | 5399 | # INFO: //IGNORE but still throw notice |
| 5400 | 5400 | /** @noinspection PhpUsageOfSilenceOperatorInspection */ |
| 5401 | - if ((string)@\iconv($encodingTmp, $encodingTmp . '//IGNORE', $str) === $str) { |
|
| 5401 | + if ((string)@\iconv($encodingTmp, $encodingTmp.'//IGNORE', $str) === $str) { |
|
| 5402 | 5402 | return $encodingTmp; |
| 5403 | 5403 | } |
| 5404 | 5404 | } |
@@ -5460,7 +5460,7 @@ discard block |
||
| 5460 | 5460 | public static function str_ensure_left(string $str, string $substring): string |
| 5461 | 5461 | { |
| 5462 | 5462 | if (!self::str_starts_with($str, $substring)) { |
| 5463 | - $str = $substring . $str; |
|
| 5463 | + $str = $substring.$str; |
|
| 5464 | 5464 | } |
| 5465 | 5465 | |
| 5466 | 5466 | return $str; |
@@ -5669,7 +5669,7 @@ discard block |
||
| 5669 | 5669 | $start = self::substr($str, 0, $index, $encoding); |
| 5670 | 5670 | $end = self::substr($str, $index, $len, $encoding); |
| 5671 | 5671 | |
| 5672 | - return $start . $substring . $end; |
|
| 5672 | + return $start.$substring.$end; |
|
| 5673 | 5673 | } |
| 5674 | 5674 | |
| 5675 | 5675 | /** |
@@ -5706,7 +5706,7 @@ discard block |
||
| 5706 | 5706 | if ('' === $s .= '') { |
| 5707 | 5707 | $s = '/^(?<=.)$/'; |
| 5708 | 5708 | } else { |
| 5709 | - $s = '/' . \preg_quote($s, '/') . '/ui'; |
|
| 5709 | + $s = '/'.\preg_quote($s, '/').'/ui'; |
|
| 5710 | 5710 | } |
| 5711 | 5711 | } |
| 5712 | 5712 | |
@@ -5989,7 +5989,7 @@ discard block |
||
| 5989 | 5989 | return $str; |
| 5990 | 5990 | } |
| 5991 | 5991 | |
| 5992 | - return self::substr($str, 0, $length - self::strlen($strAddOn), $encoding) . $strAddOn; |
|
| 5992 | + return self::substr($str, 0, $length - self::strlen($strAddOn), $encoding).$strAddOn; |
|
| 5993 | 5993 | } |
| 5994 | 5994 | |
| 5995 | 5995 | /** |
@@ -6017,7 +6017,7 @@ discard block |
||
| 6017 | 6017 | } |
| 6018 | 6018 | |
| 6019 | 6019 | if (self::substr($str, $length - 1, 1, $encoding) === ' ') { |
| 6020 | - return self::substr($str, 0, $length - 1, $encoding) . $strAddOn; |
|
| 6020 | + return self::substr($str, 0, $length - 1, $encoding).$strAddOn; |
|
| 6021 | 6021 | } |
| 6022 | 6022 | |
| 6023 | 6023 | $str = (string)self::substr($str, 0, $length, $encoding); |
@@ -6026,9 +6026,9 @@ discard block |
||
| 6026 | 6026 | $new_str = \implode(' ', $array); |
| 6027 | 6027 | |
| 6028 | 6028 | if ($new_str === '') { |
| 6029 | - $str = self::substr($str, 0, $length - 1, $encoding) . $strAddOn; |
|
| 6029 | + $str = self::substr($str, 0, $length - 1, $encoding).$strAddOn; |
|
| 6030 | 6030 | } else { |
| 6031 | - $str = $new_str . $strAddOn; |
|
| 6031 | + $str = $new_str.$strAddOn; |
|
| 6032 | 6032 | } |
| 6033 | 6033 | |
| 6034 | 6034 | return $str; |
@@ -6131,7 +6131,7 @@ discard block |
||
| 6131 | 6131 | $char = self::substr($str, -$i, 1, $encoding); |
| 6132 | 6132 | |
| 6133 | 6133 | if ($char == self::substr($otherStr, -$i, 1, $encoding)) { |
| 6134 | - $longestCommonSuffix = $char . $longestCommonSuffix; |
|
| 6134 | + $longestCommonSuffix = $char.$longestCommonSuffix; |
|
| 6135 | 6135 | } else { |
| 6136 | 6136 | break; |
| 6137 | 6137 | } |
@@ -6150,7 +6150,7 @@ discard block |
||
| 6150 | 6150 | */ |
| 6151 | 6151 | public static function str_matches_pattern(string $str, string $pattern): bool |
| 6152 | 6152 | { |
| 6153 | - if (\preg_match('/' . $pattern . '/u', $str)) { |
|
| 6153 | + if (\preg_match('/'.$pattern.'/u', $str)) { |
|
| 6154 | 6154 | return true; |
| 6155 | 6155 | } |
| 6156 | 6156 | |
@@ -6240,7 +6240,7 @@ discard block |
||
| 6240 | 6240 | $pad_type = STR_PAD_BOTH; |
| 6241 | 6241 | } else { |
| 6242 | 6242 | throw new \InvalidArgumentException( |
| 6243 | - 'Pad expects $padType to be "STR_PAD_*" or ' . "to be one of 'left', 'right' or 'both'" |
|
| 6243 | + 'Pad expects $padType to be "STR_PAD_*" or '."to be one of 'left', 'right' or 'both'" |
|
| 6244 | 6244 | ); |
| 6245 | 6245 | } |
| 6246 | 6246 | } |
@@ -6277,7 +6277,7 @@ discard block |
||
| 6277 | 6277 | $pre = ''; |
| 6278 | 6278 | } |
| 6279 | 6279 | |
| 6280 | - return $pre . $str . $post; |
|
| 6280 | + return $pre.$str.$post; |
|
| 6281 | 6281 | } |
| 6282 | 6282 | |
| 6283 | 6283 | return $str; |
@@ -6405,7 +6405,7 @@ discard block |
||
| 6405 | 6405 | { |
| 6406 | 6406 | return self::regex_replace( |
| 6407 | 6407 | $str, |
| 6408 | - '^' . \preg_quote($search, '/'), |
|
| 6408 | + '^'.\preg_quote($search, '/'), |
|
| 6409 | 6409 | self::str_replace('\\', '\\\\', $replacement) |
| 6410 | 6410 | ); |
| 6411 | 6411 | } |
@@ -6423,7 +6423,7 @@ discard block |
||
| 6423 | 6423 | { |
| 6424 | 6424 | return self::regex_replace( |
| 6425 | 6425 | $str, |
| 6426 | - \preg_quote($search, '/') . '$', |
|
| 6426 | + \preg_quote($search, '/').'$', |
|
| 6427 | 6427 | self::str_replace('\\', '\\\\', $replacement) |
| 6428 | 6428 | ); |
| 6429 | 6429 | } |
@@ -6534,24 +6534,24 @@ discard block |
||
| 6534 | 6534 | |
| 6535 | 6535 | $str = (string)\preg_replace_callback( |
| 6536 | 6536 | '/([\d|A-Z])/u', |
| 6537 | - function ($matches) use ($encoding) { |
|
| 6537 | + function($matches) use ($encoding) { |
|
| 6538 | 6538 | $match = $matches[1]; |
| 6539 | 6539 | $matchInt = (int)$match; |
| 6540 | 6540 | |
| 6541 | 6541 | if ((string)$matchInt == $match) { |
| 6542 | - return '_' . $match . '_'; |
|
| 6542 | + return '_'.$match.'_'; |
|
| 6543 | 6543 | } |
| 6544 | 6544 | |
| 6545 | - return '_' . UTF8::strtolower($match, $encoding); |
|
| 6545 | + return '_'.UTF8::strtolower($match, $encoding); |
|
| 6546 | 6546 | }, |
| 6547 | 6547 | $str |
| 6548 | 6548 | ); |
| 6549 | 6549 | |
| 6550 | 6550 | $str = (string)\preg_replace( |
| 6551 | 6551 | [ |
| 6552 | - '/\s+/', // convert spaces to "_" |
|
| 6553 | - '/^\s+|\s+$/', // trim leading & trailing spaces |
|
| 6554 | - '/_+/', // remove double "_" |
|
| 6552 | + '/\s+/', // convert spaces to "_" |
|
| 6553 | + '/^\s+|\s+$/', // trim leading & trailing spaces |
|
| 6554 | + '/_+/', // remove double "_" |
|
| 6555 | 6555 | ], |
| 6556 | 6556 | [ |
| 6557 | 6557 | '_', |
@@ -6639,7 +6639,7 @@ discard block |
||
| 6639 | 6639 | $limit = -1; |
| 6640 | 6640 | } |
| 6641 | 6641 | |
| 6642 | - $array = \preg_split('/' . \preg_quote($pattern, '/') . '/u', $str, $limit); |
|
| 6642 | + $array = \preg_split('/'.\preg_quote($pattern, '/').'/u', $str, $limit); |
|
| 6643 | 6643 | |
| 6644 | 6644 | if ($array === false) { |
| 6645 | 6645 | return []; |
@@ -6921,7 +6921,7 @@ discard block |
||
| 6921 | 6921 | |
| 6922 | 6922 | $str = (string)\preg_replace_callback( |
| 6923 | 6923 | '/([\S]+)/u', |
| 6924 | - function ($match) use ($encoding, $ignore) { |
|
| 6924 | + function($match) use ($encoding, $ignore) { |
|
| 6925 | 6925 | if ($ignore && \in_array($match[0], $ignore, true)) { |
| 6926 | 6926 | return $match[0]; |
| 6927 | 6927 | } |
@@ -6990,16 +6990,16 @@ discard block |
||
| 6990 | 6990 | $str = (string)\preg_replace_callback( |
| 6991 | 6991 | '~\b (_*) (?: # 1. Leading underscore and |
| 6992 | 6992 | ( (?<=[ ][/\\\\]) [[:alpha:]]+ [-_[:alpha:]/\\\\]+ | # 2. file path or |
| 6993 | - [-_[:alpha:]]+ [@.:] [-_[:alpha:]@.:/]+ ' . $apostropheRx . ' ) # URL, domain, or email |
|
| 6993 | + [-_[:alpha:]]+ [@.:] [-_[:alpha:]@.:/]+ ' . $apostropheRx.' ) # URL, domain, or email |
|
| 6994 | 6994 | | |
| 6995 | - ( (?i: ' . $smallWordsRx . ' ) ' . $apostropheRx . ' ) # 3. or small word (case-insensitive) |
|
| 6995 | + ( (?i: ' . $smallWordsRx.' ) '.$apostropheRx.' ) # 3. or small word (case-insensitive) |
|
| 6996 | 6996 | | |
| 6997 | - ( [[:alpha:]] [[:lower:]\'’()\[\]{}]* ' . $apostropheRx . ' ) # 4. or word w/o internal caps |
|
| 6997 | + ( [[:alpha:]] [[:lower:]\'’()\[\]{}]* ' . $apostropheRx.' ) # 4. or word w/o internal caps |
|
| 6998 | 6998 | | |
| 6999 | - ( [[:alpha:]] [[:alpha:]\'’()\[\]{}]* ' . $apostropheRx . ' ) # 5. or some other word |
|
| 6999 | + ( [[:alpha:]] [[:alpha:]\'’()\[\]{}]* ' . $apostropheRx.' ) # 5. or some other word |
|
| 7000 | 7000 | ) (_*) \b # 6. With trailing underscore |
| 7001 | 7001 | ~ux', |
| 7002 | - function ($matches) use ($encoding) { |
|
| 7002 | + function($matches) use ($encoding) { |
|
| 7003 | 7003 | // Preserve leading underscore |
| 7004 | 7004 | $str = $matches[1]; |
| 7005 | 7005 | if ($matches[2]) { |
@@ -7028,21 +7028,21 @@ discard block |
||
| 7028 | 7028 | '~( \A [[:punct:]]* # start of title... |
| 7029 | 7029 | | [:.;?!][ ]+ # or of subsentence... |
| 7030 | 7030 | | [ ][\'"“‘(\[][ ]* ) # or of inserted subphrase... |
| 7031 | - ( ' . $smallWordsRx . ' ) \b # ...followed by small word |
|
| 7031 | + ( ' . $smallWordsRx.' ) \b # ...followed by small word |
|
| 7032 | 7032 | ~uxi', |
| 7033 | - function ($matches) use ($encoding) { |
|
| 7034 | - return $matches[1] . static::str_upper_first($matches[2], $encoding); |
|
| 7033 | + function($matches) use ($encoding) { |
|
| 7034 | + return $matches[1].static::str_upper_first($matches[2], $encoding); |
|
| 7035 | 7035 | }, |
| 7036 | 7036 | $str |
| 7037 | 7037 | ); |
| 7038 | 7038 | |
| 7039 | 7039 | // ...and end of title |
| 7040 | 7040 | $str = (string)\preg_replace_callback( |
| 7041 | - '~\b ( ' . $smallWordsRx . ' ) # small word... |
|
| 7041 | + '~\b ( '.$smallWordsRx.' ) # small word... |
|
| 7042 | 7042 | (?= [[:punct:]]* \Z # ...at the end of the title... |
| 7043 | 7043 | | [\'"’”)\]] [ ] ) # ...or of an inserted subphrase? |
| 7044 | 7044 | ~uxi', |
| 7045 | - function ($matches) use ($encoding) { |
|
| 7045 | + function($matches) use ($encoding) { |
|
| 7046 | 7046 | return static::str_upper_first($matches[1], $encoding); |
| 7047 | 7047 | }, |
| 7048 | 7048 | $str |
@@ -7053,10 +7053,10 @@ discard block |
||
| 7053 | 7053 | $str = (string)\preg_replace_callback( |
| 7054 | 7054 | '~\b |
| 7055 | 7055 | (?<! -) # Negative lookbehind for a hyphen; we do not want to match man-in-the-middle but do want (in-flight) |
| 7056 | - ( ' . $smallWordsRx . ' ) |
|
| 7056 | + ( ' . $smallWordsRx.' ) |
|
| 7057 | 7057 | (?= -[[:alpha:]]+) # lookahead for "-someword" |
| 7058 | 7058 | ~uxi', |
| 7059 | - function ($matches) use ($encoding) { |
|
| 7059 | + function($matches) use ($encoding) { |
|
| 7060 | 7060 | return static::str_upper_first($matches[1], $encoding); |
| 7061 | 7061 | }, |
| 7062 | 7062 | $str |
@@ -7067,11 +7067,11 @@ discard block |
||
| 7067 | 7067 | '~\b |
| 7068 | 7068 | (?<!…) # Negative lookbehind for a hyphen; we do not want to match man-in-the-middle but do want (stand-in) |
| 7069 | 7069 | ( [[:alpha:]]+- ) # $1 = first word and hyphen, should already be properly capped |
| 7070 | - ( ' . $smallWordsRx . ' ) # ...followed by small word |
|
| 7070 | + ( ' . $smallWordsRx.' ) # ...followed by small word |
|
| 7071 | 7071 | (?! - ) # Negative lookahead for another - |
| 7072 | 7072 | ~uxi', |
| 7073 | - function ($matches) use ($encoding) { |
|
| 7074 | - return $matches[1] . static::str_upper_first($matches[2], $encoding); |
|
| 7073 | + function($matches) use ($encoding) { |
|
| 7074 | + return $matches[1].static::str_upper_first($matches[2], $encoding); |
|
| 7075 | 7075 | }, |
| 7076 | 7076 | $str |
| 7077 | 7077 | ); |
@@ -7221,7 +7221,7 @@ discard block |
||
| 7221 | 7221 | |
| 7222 | 7222 | $truncated = self::substr($str, 0, $length, $encoding); |
| 7223 | 7223 | |
| 7224 | - return $truncated . $substring; |
|
| 7224 | + return $truncated.$substring; |
|
| 7225 | 7225 | } |
| 7226 | 7226 | |
| 7227 | 7227 | /** |
@@ -7263,7 +7263,7 @@ discard block |
||
| 7263 | 7263 | } |
| 7264 | 7264 | } |
| 7265 | 7265 | |
| 7266 | - $str = $truncated . $substring; |
|
| 7266 | + $str = $truncated.$substring; |
|
| 7267 | 7267 | |
| 7268 | 7268 | return $str; |
| 7269 | 7269 | } |
@@ -7412,7 +7412,7 @@ discard block |
||
| 7412 | 7412 | public static function strcmp(string $str1, string $str2): int |
| 7413 | 7413 | { |
| 7414 | 7414 | /** @noinspection PhpUndefinedClassInspection */ |
| 7415 | - return $str1 . '' === $str2 . '' ? 0 : \strcmp( |
|
| 7415 | + return $str1.'' === $str2.'' ? 0 : \strcmp( |
|
| 7416 | 7416 | \Normalizer::normalize($str1, \Normalizer::NFD), |
| 7417 | 7417 | \Normalizer::normalize($str2, \Normalizer::NFD) |
| 7418 | 7418 | ); |
@@ -7446,7 +7446,7 @@ discard block |
||
| 7446 | 7446 | return null; |
| 7447 | 7447 | } |
| 7448 | 7448 | |
| 7449 | - if (\preg_match('/^(.*?)' . self::rxClass($charList) . '/us', $str, $length)) { |
|
| 7449 | + if (\preg_match('/^(.*?)'.self::rxClass($charList).'/us', $str, $length)) { |
|
| 7450 | 7450 | return self::strlen($length[1]); |
| 7451 | 7451 | } |
| 7452 | 7452 | |
@@ -7683,7 +7683,7 @@ discard block |
||
| 7683 | 7683 | && |
| 7684 | 7684 | self::$SUPPORT['mbstring'] === false |
| 7685 | 7685 | ) { |
| 7686 | - \trigger_error('UTF8::stristr() without mbstring cannot handle "' . $encoding . '" encoding', E_USER_WARNING); |
|
| 7686 | + \trigger_error('UTF8::stristr() without mbstring cannot handle "'.$encoding.'" encoding', E_USER_WARNING); |
|
| 7687 | 7687 | } |
| 7688 | 7688 | |
| 7689 | 7689 | if (self::$SUPPORT['mbstring'] === true) { |
@@ -7705,7 +7705,7 @@ discard block |
||
| 7705 | 7705 | return \stristr($haystack, $needle, $before_needle); |
| 7706 | 7706 | } |
| 7707 | 7707 | |
| 7708 | - \preg_match('/^(.*?)' . \preg_quote($needle, '/') . '/usi', $haystack, $match); |
|
| 7708 | + \preg_match('/^(.*?)'.\preg_quote($needle, '/').'/usi', $haystack, $match); |
|
| 7709 | 7709 | |
| 7710 | 7710 | if (!isset($match[1])) { |
| 7711 | 7711 | return false; |
@@ -7772,7 +7772,7 @@ discard block |
||
| 7772 | 7772 | && |
| 7773 | 7773 | self::$SUPPORT['iconv'] === false |
| 7774 | 7774 | ) { |
| 7775 | - \trigger_error('UTF8::strlen() without mbstring / iconv cannot handle "' . $encoding . '" encoding', E_USER_WARNING); |
|
| 7775 | + \trigger_error('UTF8::strlen() without mbstring / iconv cannot handle "'.$encoding.'" encoding', E_USER_WARNING); |
|
| 7776 | 7776 | } |
| 7777 | 7777 | |
| 7778 | 7778 | // |
@@ -7898,7 +7898,7 @@ discard block |
||
| 7898 | 7898 | */ |
| 7899 | 7899 | public static function strnatcmp(string $str1, string $str2): int |
| 7900 | 7900 | { |
| 7901 | - return $str1 . '' === $str2 . '' ? 0 : \strnatcmp(self::strtonatfold($str1), self::strtonatfold($str2)); |
|
| 7901 | + return $str1.'' === $str2.'' ? 0 : \strnatcmp(self::strtonatfold($str1), self::strtonatfold($str2)); |
|
| 7902 | 7902 | } |
| 7903 | 7903 | |
| 7904 | 7904 | /** |
@@ -7963,7 +7963,7 @@ discard block |
||
| 7963 | 7963 | return false; |
| 7964 | 7964 | } |
| 7965 | 7965 | |
| 7966 | - if (\preg_match('/' . self::rxClass($char_list) . '/us', $haystack, $m)) { |
|
| 7966 | + if (\preg_match('/'.self::rxClass($char_list).'/us', $haystack, $m)) { |
|
| 7967 | 7967 | return \substr($haystack, (int)\strpos($haystack, $m[0])); |
| 7968 | 7968 | } |
| 7969 | 7969 | |
@@ -8035,7 +8035,7 @@ discard block |
||
| 8035 | 8035 | && |
| 8036 | 8036 | self::$SUPPORT['mbstring'] === false |
| 8037 | 8037 | ) { |
| 8038 | - \trigger_error('UTF8::strpos() without mbstring / iconv cannot handle "' . $encoding . '" encoding', E_USER_WARNING); |
|
| 8038 | + \trigger_error('UTF8::strpos() without mbstring / iconv cannot handle "'.$encoding.'" encoding', E_USER_WARNING); |
|
| 8039 | 8039 | } |
| 8040 | 8040 | |
| 8041 | 8041 | // |
@@ -8201,7 +8201,7 @@ discard block |
||
| 8201 | 8201 | && |
| 8202 | 8202 | self::$SUPPORT['mbstring'] === false |
| 8203 | 8203 | ) { |
| 8204 | - \trigger_error('UTF8::strrchr() without mbstring cannot handle "' . $encoding . '" encoding', E_USER_WARNING); |
|
| 8204 | + \trigger_error('UTF8::strrchr() without mbstring cannot handle "'.$encoding.'" encoding', E_USER_WARNING); |
|
| 8205 | 8205 | } |
| 8206 | 8206 | |
| 8207 | 8207 | if (self::$SUPPORT['mbstring'] === true) { |
@@ -8422,7 +8422,7 @@ discard block |
||
| 8422 | 8422 | && |
| 8423 | 8423 | self::$SUPPORT['mbstring'] === false |
| 8424 | 8424 | ) { |
| 8425 | - \trigger_error('UTF8::strripos() without mbstring cannot handle "' . $encoding . '" encoding', E_USER_WARNING); |
|
| 8425 | + \trigger_error('UTF8::strripos() without mbstring cannot handle "'.$encoding.'" encoding', E_USER_WARNING); |
|
| 8426 | 8426 | } |
| 8427 | 8427 | |
| 8428 | 8428 | // |
@@ -8569,7 +8569,7 @@ discard block |
||
| 8569 | 8569 | && |
| 8570 | 8570 | self::$SUPPORT['mbstring'] === false |
| 8571 | 8571 | ) { |
| 8572 | - \trigger_error('UTF8::strrpos() without mbstring cannot handle "' . $encoding . '" encoding', E_USER_WARNING); |
|
| 8572 | + \trigger_error('UTF8::strrpos() without mbstring cannot handle "'.$encoding.'" encoding', E_USER_WARNING); |
|
| 8573 | 8573 | } |
| 8574 | 8574 | |
| 8575 | 8575 | // |
@@ -8700,7 +8700,7 @@ discard block |
||
| 8700 | 8700 | return 0; |
| 8701 | 8701 | } |
| 8702 | 8702 | |
| 8703 | - return \preg_match('/^' . self::rxClass($mask) . '+/u', $str, $str) ? self::strlen($str[0]) : 0; |
|
| 8703 | + return \preg_match('/^'.self::rxClass($mask).'+/u', $str, $str) ? self::strlen($str[0]) : 0; |
|
| 8704 | 8704 | } |
| 8705 | 8705 | |
| 8706 | 8706 | /** |
@@ -8756,7 +8756,7 @@ discard block |
||
| 8756 | 8756 | && |
| 8757 | 8757 | self::$SUPPORT['mbstring'] === false |
| 8758 | 8758 | ) { |
| 8759 | - \trigger_error('UTF8::strstr() without mbstring cannot handle "' . $encoding . '" encoding', E_USER_WARNING); |
|
| 8759 | + \trigger_error('UTF8::strstr() without mbstring cannot handle "'.$encoding.'" encoding', E_USER_WARNING); |
|
| 8760 | 8760 | } |
| 8761 | 8761 | |
| 8762 | 8762 | // |
@@ -8794,7 +8794,7 @@ discard block |
||
| 8794 | 8794 | // fallback via vanilla php |
| 8795 | 8795 | // |
| 8796 | 8796 | |
| 8797 | - \preg_match('/^(.*?)' . \preg_quote($needle, '/') . '/us', $haystack, $match); |
|
| 8797 | + \preg_match('/^(.*?)'.\preg_quote($needle, '/').'/us', $haystack, $match); |
|
| 8798 | 8798 | |
| 8799 | 8799 | if (!isset($match[1])) { |
| 8800 | 8800 | return false; |
@@ -8932,9 +8932,9 @@ discard block |
||
| 8932 | 8932 | |
| 8933 | 8933 | if (self::$SUPPORT['intl'] === true) { |
| 8934 | 8934 | |
| 8935 | - $langCode = $lang . '-Lower'; |
|
| 8935 | + $langCode = $lang.'-Lower'; |
|
| 8936 | 8936 | if (!\in_array($langCode, self::$SUPPORT['intl__transliterator_list_ids'], true)) { |
| 8937 | - \trigger_error('UTF8::strtolower() cannot handle special language: ' . $lang, E_USER_WARNING); |
|
| 8937 | + \trigger_error('UTF8::strtolower() cannot handle special language: '.$lang, E_USER_WARNING); |
|
| 8938 | 8938 | |
| 8939 | 8939 | $langCode = 'Any-Lower'; |
| 8940 | 8940 | } |
@@ -8943,7 +8943,7 @@ discard block |
||
| 8943 | 8943 | return transliterator_transliterate($langCode, $str); |
| 8944 | 8944 | } |
| 8945 | 8945 | |
| 8946 | - \trigger_error('UTF8::strtolower() without intl cannot handle the "lang" parameter: ' . $lang, E_USER_WARNING); |
|
| 8946 | + \trigger_error('UTF8::strtolower() without intl cannot handle the "lang" parameter: '.$lang, E_USER_WARNING); |
|
| 8947 | 8947 | } |
| 8948 | 8948 | |
| 8949 | 8949 | // always fallback via symfony polyfill |
@@ -9008,9 +9008,9 @@ discard block |
||
| 9008 | 9008 | |
| 9009 | 9009 | if (self::$SUPPORT['intl'] === true) { |
| 9010 | 9010 | |
| 9011 | - $langCode = $lang . '-Upper'; |
|
| 9011 | + $langCode = $lang.'-Upper'; |
|
| 9012 | 9012 | if (!\in_array($langCode, self::$SUPPORT['intl__transliterator_list_ids'], true)) { |
| 9013 | - \trigger_error('UTF8::strtoupper() without intl for special language: ' . $lang, E_USER_WARNING); |
|
| 9013 | + \trigger_error('UTF8::strtoupper() without intl for special language: '.$lang, E_USER_WARNING); |
|
| 9014 | 9014 | |
| 9015 | 9015 | $langCode = 'Any-Upper'; |
| 9016 | 9016 | } |
@@ -9019,7 +9019,7 @@ discard block |
||
| 9019 | 9019 | return transliterator_transliterate($langCode, $str); |
| 9020 | 9020 | } |
| 9021 | 9021 | |
| 9022 | - \trigger_error('UTF8::strtolower() without intl + PHP >= 5.4 cannot handle the "lang"-parameter: ' . $lang, E_USER_WARNING); |
|
| 9022 | + \trigger_error('UTF8::strtolower() without intl + PHP >= 5.4 cannot handle the "lang"-parameter: '.$lang, E_USER_WARNING); |
|
| 9023 | 9023 | } |
| 9024 | 9024 | |
| 9025 | 9025 | // always fallback via symfony polyfill |
@@ -9226,7 +9226,7 @@ discard block |
||
| 9226 | 9226 | && |
| 9227 | 9227 | self::$SUPPORT['mbstring'] === false |
| 9228 | 9228 | ) { |
| 9229 | - \trigger_error('UTF8::substr() without mbstring cannot handle "' . $encoding . '" encoding', E_USER_WARNING); |
|
| 9229 | + \trigger_error('UTF8::substr() without mbstring cannot handle "'.$encoding.'" encoding', E_USER_WARNING); |
|
| 9230 | 9230 | } |
| 9231 | 9231 | |
| 9232 | 9232 | // |
@@ -9406,14 +9406,14 @@ discard block |
||
| 9406 | 9406 | && |
| 9407 | 9407 | self::$SUPPORT['mbstring'] === false |
| 9408 | 9408 | ) { |
| 9409 | - \trigger_error('UTF8::substr_count() without mbstring cannot handle "' . $encoding . '" encoding', E_USER_WARNING); |
|
| 9409 | + \trigger_error('UTF8::substr_count() without mbstring cannot handle "'.$encoding.'" encoding', E_USER_WARNING); |
|
| 9410 | 9410 | } |
| 9411 | 9411 | |
| 9412 | 9412 | if (self::$SUPPORT['mbstring'] === true) { |
| 9413 | 9413 | return \mb_substr_count($haystack, $needle, $encoding); |
| 9414 | 9414 | } |
| 9415 | 9415 | |
| 9416 | - \preg_match_all('/' . \preg_quote($needle, '/') . '/us', $haystack, $matches, PREG_SET_ORDER); |
|
| 9416 | + \preg_match_all('/'.\preg_quote($needle, '/').'/us', $haystack, $matches, PREG_SET_ORDER); |
|
| 9417 | 9417 | |
| 9418 | 9418 | return \count($matches); |
| 9419 | 9419 | } |
@@ -9738,8 +9738,7 @@ discard block |
||
| 9738 | 9738 | |
| 9739 | 9739 | if (self::is_ascii($str)) { |
| 9740 | 9740 | return ($length === null) ? |
| 9741 | - \substr_replace($str, $replacement, $offset) : |
|
| 9742 | - \substr_replace($str, $replacement, $offset, $length); |
|
| 9741 | + \substr_replace($str, $replacement, $offset) : \substr_replace($str, $replacement, $offset, $length); |
|
| 9743 | 9742 | } |
| 9744 | 9743 | |
| 9745 | 9744 | if (!isset(self::$SUPPORT['already_checked_via_portable_utf8'])) { |
@@ -9765,7 +9764,7 @@ discard block |
||
| 9765 | 9764 | $length = $string_length - $offset; |
| 9766 | 9765 | } |
| 9767 | 9766 | |
| 9768 | - return self::substr($str, 0, $offset, $encoding) . $replacement . self::substr($str, $offset + $length, $string_length - $offset - $length, $encoding); |
|
| 9767 | + return self::substr($str, 0, $offset, $encoding).$replacement.self::substr($str, $offset + $length, $string_length - $offset - $length, $encoding); |
|
| 9769 | 9768 | } |
| 9770 | 9769 | |
| 9771 | 9770 | \preg_match_all('/./us', $str, $smatches); |
@@ -10184,9 +10183,9 @@ discard block |
||
| 10184 | 10183 | |
| 10185 | 10184 | $string = (string)\preg_replace( |
| 10186 | 10185 | [ |
| 10187 | - '/[^' . $fallback_char_escaped . '\.\-a-zA-Z0-9\s]/', // 1) remove un-needed chars |
|
| 10188 | - '/[\s]+/', // 2) convert spaces to $fallback_char |
|
| 10189 | - '/[' . $fallback_char_escaped . ']+/', // 3) remove double $fallback_char's |
|
| 10186 | + '/[^'.$fallback_char_escaped.'\.\-a-zA-Z0-9\s]/', // 1) remove un-needed chars |
|
| 10187 | + '/[\s]+/', // 2) convert spaces to $fallback_char |
|
| 10188 | + '/['.$fallback_char_escaped.']+/', // 3) remove double $fallback_char's |
|
| 10190 | 10189 | ], |
| 10191 | 10190 | [ |
| 10192 | 10191 | '', |
@@ -10287,7 +10286,7 @@ discard block |
||
| 10287 | 10286 | $c2 = $i + 1 >= $max ? "\x00" : $str[$i + 1]; |
| 10288 | 10287 | |
| 10289 | 10288 | if ($c2 >= "\x80" && $c2 <= "\xBF") { // yeah, almost sure it's UTF8 already |
| 10290 | - $buf .= $c1 . $c2; |
|
| 10289 | + $buf .= $c1.$c2; |
|
| 10291 | 10290 | $i++; |
| 10292 | 10291 | } else { // not valid UTF8 - convert it |
| 10293 | 10292 | $buf .= self::to_utf8_convert_helper($c1); |
@@ -10299,7 +10298,7 @@ discard block |
||
| 10299 | 10298 | $c3 = $i + 2 >= $max ? "\x00" : $str[$i + 2]; |
| 10300 | 10299 | |
| 10301 | 10300 | if ($c2 >= "\x80" && $c2 <= "\xBF" && $c3 >= "\x80" && $c3 <= "\xBF") { // yeah, almost sure it's UTF8 already |
| 10302 | - $buf .= $c1 . $c2 . $c3; |
|
| 10301 | + $buf .= $c1.$c2.$c3; |
|
| 10303 | 10302 | $i += 2; |
| 10304 | 10303 | } else { // not valid UTF8 - convert it |
| 10305 | 10304 | $buf .= self::to_utf8_convert_helper($c1); |
@@ -10312,7 +10311,7 @@ discard block |
||
| 10312 | 10311 | $c4 = $i + 3 >= $max ? "\x00" : $str[$i + 3]; |
| 10313 | 10312 | |
| 10314 | 10313 | if ($c2 >= "\x80" && $c2 <= "\xBF" && $c3 >= "\x80" && $c3 <= "\xBF" && $c4 >= "\x80" && $c4 <= "\xBF") { // yeah, almost sure it's UTF8 already |
| 10315 | - $buf .= $c1 . $c2 . $c3 . $c4; |
|
| 10314 | + $buf .= $c1.$c2.$c3.$c4; |
|
| 10316 | 10315 | $i += 3; |
| 10317 | 10316 | } else { // not valid UTF8 - convert it |
| 10318 | 10317 | $buf .= self::to_utf8_convert_helper($c1); |
@@ -10334,7 +10333,7 @@ discard block |
||
| 10334 | 10333 | // decode unicode escape sequences |
| 10335 | 10334 | $buf = \preg_replace_callback( |
| 10336 | 10335 | '/\\\\u([0-9a-f]{4})/i', |
| 10337 | - function ($match) { |
|
| 10336 | + function($match) { |
|
| 10338 | 10337 | // always fallback via symfony polyfill |
| 10339 | 10338 | return \mb_convert_encoding(pack('H*', $match[1]), 'UTF-8', 'UCS-2BE'); |
| 10340 | 10339 | }, |
@@ -10377,7 +10376,7 @@ discard block |
||
| 10377 | 10376 | } else { |
| 10378 | 10377 | $cc1 = self::$CHR[$ordC1 / 64] | "\xC0"; |
| 10379 | 10378 | $cc2 = ((string)$input & "\x3F") | "\x80"; |
| 10380 | - $buf .= $cc1 . $cc2; |
|
| 10379 | + $buf .= $cc1.$cc2; |
|
| 10381 | 10380 | } |
| 10382 | 10381 | |
| 10383 | 10382 | return $buf; |
@@ -10441,7 +10440,7 @@ discard block |
||
| 10441 | 10440 | $cleanUtf8 |
| 10442 | 10441 | ); |
| 10443 | 10442 | |
| 10444 | - return $strPartOne . $strPartTwo; |
|
| 10443 | + return $strPartOne.$strPartTwo; |
|
| 10445 | 10444 | } |
| 10446 | 10445 | |
| 10447 | 10446 | /** |
@@ -10486,7 +10485,7 @@ discard block |
||
| 10486 | 10485 | $str = self::clean($str); |
| 10487 | 10486 | } |
| 10488 | 10487 | |
| 10489 | - $usePhpDefaultFunctions = !(bool)($charlist . \implode('', $exceptions)); |
|
| 10488 | + $usePhpDefaultFunctions = !(bool)($charlist.\implode('', $exceptions)); |
|
| 10490 | 10489 | |
| 10491 | 10490 | if ( |
| 10492 | 10491 | $usePhpDefaultFunctions === true |
@@ -10990,7 +10989,7 @@ discard block |
||
| 10990 | 10989 | return ''; |
| 10991 | 10990 | } |
| 10992 | 10991 | |
| 10993 | - \preg_match('/^\s*+(?:\S++\s*+){1,' . $limit . '}/u', $str, $matches); |
|
| 10992 | + \preg_match('/^\s*+(?:\S++\s*+){1,'.$limit.'}/u', $str, $matches); |
|
| 10994 | 10993 | |
| 10995 | 10994 | if ( |
| 10996 | 10995 | !isset($matches[0]) |
@@ -11000,7 +10999,7 @@ discard block |
||
| 11000 | 10999 | return $str; |
| 11001 | 11000 | } |
| 11002 | 11001 | |
| 11003 | - return self::rtrim($matches[0]) . $strAddOn; |
|
| 11002 | + return self::rtrim($matches[0]).$strAddOn; |
|
| 11004 | 11003 | } |
| 11005 | 11004 | |
| 11006 | 11005 | /** |
@@ -11071,7 +11070,7 @@ discard block |
||
| 11071 | 11070 | $strReturn .= $break; |
| 11072 | 11071 | } |
| 11073 | 11072 | |
| 11074 | - return $strReturn . \implode('', $chars); |
|
| 11073 | + return $strReturn.\implode('', $chars); |
|
| 11075 | 11074 | } |
| 11076 | 11075 | |
| 11077 | 11076 | /** |