@@ -2807,7 +2807,7 @@ discard block |
||
2807 | 2807 | /** |
2808 | 2808 | * Check if the input is binary... (is look like a hack). |
2809 | 2809 | * |
2810 | - * @param mixed $input |
|
2810 | + * @param string|false $input |
|
2811 | 2811 | * |
2812 | 2812 | * @return bool |
2813 | 2813 | */ |
@@ -5631,7 +5631,7 @@ discard block |
||
5631 | 5631 | * @link http://php.net/manual/en/function.mb-strrpos.php |
5632 | 5632 | * |
5633 | 5633 | * @param string $haystack <p>The string being checked, for the last occurrence of needle</p> |
5634 | - * @param string|int $needle <p>The string to find in haystack.<br />Or a code point as int.</p> |
|
5634 | + * @param string $needle <p>The string to find in haystack.<br />Or a code point as int.</p> |
|
5635 | 5635 | * @param int $offset [optional] <p>May be specified to begin searching an arbitrary number of characters |
5636 | 5636 | * into the string. Negative values will stop searching at an arbitrary point prior to |
5637 | 5637 | * the end of the string. |
@@ -6304,8 +6304,8 @@ discard block |
||
6304 | 6304 | * |
6305 | 6305 | * source: https://gist.github.com/stemar/8287074 |
6306 | 6306 | * |
6307 | - * @param string|string[] $str <p>The input string or an array of stings.</p> |
|
6308 | - * @param string|string[] $replacement <p>The replacement string or an array of stings.</p> |
|
6307 | + * @param string $str <p>The input string or an array of stings.</p> |
|
6308 | + * @param string $replacement <p>The replacement string or an array of stings.</p> |
|
6309 | 6309 | * @param int|int[] $start <p> |
6310 | 6310 | * If start is positive, the replacing will begin at the start'th offset |
6311 | 6311 | * into string. |
@@ -6313,7 +6313,7 @@ discard block |
||
6313 | 6313 | * If start is negative, the replacing will begin at the start'th character |
6314 | 6314 | * from the end of string. |
6315 | 6315 | * </p> |
6316 | - * @param int|int[]|void $length [optional] <p>If given and is positive, it represents the length of the |
|
6316 | + * @param integer|null $length [optional] <p>If given and is positive, it represents the length of the |
|
6317 | 6317 | * portion of string which is to be replaced. If it is negative, it |
6318 | 6318 | * represents the number of characters from the end of string at which to |
6319 | 6319 | * stop replacing. If it is not given, then it will default to strlen( |
@@ -6745,7 +6745,7 @@ discard block |
||
6745 | 6745 | * case.</li> |
6746 | 6746 | * </ul> |
6747 | 6747 | * |
6748 | - * @param string|string[] $str <p>Any string or array.</p> |
|
6748 | + * @param string|false $str <p>Any string or array.</p> |
|
6749 | 6749 | * @param bool $decodeHtmlEntityToUtf8 <p>Set to true, if you need to decode html-entities.</p> |
6750 | 6750 | * |
6751 | 6751 | * @return string|string[] <p>The UTF-8 encoded string.</p> |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types=1); |
|
3 | +declare(strict_types = 1); |
|
4 | 4 | |
5 | 5 | namespace voku\helper; |
6 | 6 | |
@@ -852,7 +852,7 @@ discard block |
||
852 | 852 | public static function add_bom_to_string($str) |
853 | 853 | { |
854 | 854 | if (self::string_has_bom($str) === false) { |
855 | - $str = self::bom() . $str; |
|
855 | + $str = self::bom().$str; |
|
856 | 856 | } |
857 | 857 | |
858 | 858 | return $str; |
@@ -995,7 +995,7 @@ discard block |
||
995 | 995 | |
996 | 996 | // use static cache, only if there is no support for "\IntlChar" |
997 | 997 | static $CHAR_CACHE = array(); |
998 | - $cacheKey = $code_point . $encoding; |
|
998 | + $cacheKey = $code_point.$encoding; |
|
999 | 999 | if (isset($CHAR_CACHE[$cacheKey]) === true) { |
1000 | 1000 | return $CHAR_CACHE[$cacheKey]; |
1001 | 1001 | } |
@@ -1003,16 +1003,16 @@ discard block |
||
1003 | 1003 | if (0x80 > $code_point %= 0x200000) { |
1004 | 1004 | $str = self::chr_and_parse_int($code_point); |
1005 | 1005 | } elseif (0x800 > $code_point) { |
1006 | - $str = self::chr_and_parse_int(0xC0 | $code_point >> 6) . |
|
1006 | + $str = self::chr_and_parse_int(0xC0 | $code_point >> 6). |
|
1007 | 1007 | self::chr_and_parse_int(0x80 | $code_point & 0x3F); |
1008 | 1008 | } elseif (0x10000 > $code_point) { |
1009 | - $str = self::chr_and_parse_int(0xE0 | $code_point >> 12) . |
|
1010 | - self::chr_and_parse_int(0x80 | $code_point >> 6 & 0x3F) . |
|
1009 | + $str = self::chr_and_parse_int(0xE0 | $code_point >> 12). |
|
1010 | + self::chr_and_parse_int(0x80 | $code_point >> 6 & 0x3F). |
|
1011 | 1011 | self::chr_and_parse_int(0x80 | $code_point & 0x3F); |
1012 | 1012 | } else { |
1013 | - $str = self::chr_and_parse_int(0xF0 | $code_point >> 18) . |
|
1014 | - self::chr_and_parse_int(0x80 | $code_point >> 12 & 0x3F) . |
|
1015 | - self::chr_and_parse_int(0x80 | $code_point >> 6 & 0x3F) . |
|
1013 | + $str = self::chr_and_parse_int(0xF0 | $code_point >> 18). |
|
1014 | + self::chr_and_parse_int(0x80 | $code_point >> 12 & 0x3F). |
|
1015 | + self::chr_and_parse_int(0x80 | $code_point >> 6 & 0x3F). |
|
1016 | 1016 | self::chr_and_parse_int(0x80 | $code_point & 0x3F); |
1017 | 1017 | } |
1018 | 1018 | |
@@ -1072,7 +1072,7 @@ discard block |
||
1072 | 1072 | } |
1073 | 1073 | |
1074 | 1074 | return array_map( |
1075 | - function ($data) { |
|
1075 | + function($data) { |
|
1076 | 1076 | return UTF8::strlen($data, '8BIT'); |
1077 | 1077 | }, |
1078 | 1078 | self::split($str) |
@@ -1314,7 +1314,7 @@ discard block |
||
1314 | 1314 | $flags = ENT_QUOTES; |
1315 | 1315 | } |
1316 | 1316 | |
1317 | - return self::html_entity_decode('&#' . $int . ';', $flags); |
|
1317 | + return self::html_entity_decode('&#'.$int.';', $flags); |
|
1318 | 1318 | } |
1319 | 1319 | |
1320 | 1320 | /** |
@@ -1391,7 +1391,7 @@ discard block |
||
1391 | 1391 | && |
1392 | 1392 | self::$SUPPORT['mbstring'] === false |
1393 | 1393 | ) { |
1394 | - trigger_error('UTF8::encode() without mbstring cannot handle "' . $encoding . '" encoding', E_USER_WARNING); |
|
1394 | + trigger_error('UTF8::encode() without mbstring cannot handle "'.$encoding.'" encoding', E_USER_WARNING); |
|
1395 | 1395 | } |
1396 | 1396 | |
1397 | 1397 | $strEncoded = \mb_convert_encoding( |
@@ -1600,7 +1600,7 @@ discard block |
||
1600 | 1600 | ) { |
1601 | 1601 | // Prevent leading combining chars |
1602 | 1602 | // for NFC-safe concatenations. |
1603 | - $var = $leading_combining . $var; |
|
1603 | + $var = $leading_combining.$var; |
|
1604 | 1604 | } |
1605 | 1605 | } |
1606 | 1606 | |
@@ -2021,7 +2021,7 @@ discard block |
||
2021 | 2021 | */ |
2022 | 2022 | private static function getData($file) |
2023 | 2023 | { |
2024 | - $file = __DIR__ . '/data/' . $file . '.php'; |
|
2024 | + $file = __DIR__.'/data/'.$file.'.php'; |
|
2025 | 2025 | if (file_exists($file)) { |
2026 | 2026 | /** @noinspection PhpIncludeInspection */ |
2027 | 2027 | return require $file; |
@@ -2140,7 +2140,7 @@ discard block |
||
2140 | 2140 | return implode( |
2141 | 2141 | '', |
2142 | 2142 | array_map( |
2143 | - function ($data) use ($keepAsciiChars, $encoding) { |
|
2143 | + function($data) use ($keepAsciiChars, $encoding) { |
|
2144 | 2144 | return UTF8::single_chr_html_encode($data, $keepAsciiChars, $encoding); |
2145 | 2145 | }, |
2146 | 2146 | self::split($str) |
@@ -2259,7 +2259,7 @@ discard block |
||
2259 | 2259 | |
2260 | 2260 | $str = preg_replace_callback( |
2261 | 2261 | "/&#\d{2,6};/", |
2262 | - function ($matches) use ($encoding) { |
|
2262 | + function($matches) use ($encoding) { |
|
2263 | 2263 | $returnTmp = \mb_convert_encoding($matches[0], $encoding, 'HTML-ENTITIES'); |
2264 | 2264 | |
2265 | 2265 | if ($returnTmp !== '"' && $returnTmp !== "'") { |
@@ -2583,9 +2583,9 @@ discard block |
||
2583 | 2583 | if ((int)$int === $int) { |
2584 | 2584 | $hex = dechex($int); |
2585 | 2585 | |
2586 | - $hex = (strlen($hex) < 4 ? substr('0000' . $hex, -4) : $hex); |
|
2586 | + $hex = (strlen($hex) < 4 ? substr('0000'.$hex, -4) : $hex); |
|
2587 | 2587 | |
2588 | - return $pfix . $hex; |
|
2588 | + return $pfix.$hex; |
|
2589 | 2589 | } |
2590 | 2590 | |
2591 | 2591 | return ''; |
@@ -3315,7 +3315,7 @@ discard block |
||
3315 | 3315 | */ |
3316 | 3316 | public static function lcfirst($str) |
3317 | 3317 | { |
3318 | - return self::strtolower(self::substr($str, 0, 1)) . self::substr($str, 1); |
|
3318 | + return self::strtolower(self::substr($str, 0, 1)).self::substr($str, 1); |
|
3319 | 3319 | } |
3320 | 3320 | |
3321 | 3321 | /** |
@@ -3339,7 +3339,7 @@ discard block |
||
3339 | 3339 | return preg_replace('/^[\pZ\pC]+/u', '', $str); |
3340 | 3340 | } |
3341 | 3341 | |
3342 | - return preg_replace('/^' . self::rxClass($chars) . '+/u', '', $str); |
|
3342 | + return preg_replace('/^'.self::rxClass($chars).'+/u', '', $str); |
|
3343 | 3343 | } |
3344 | 3344 | |
3345 | 3345 | /** |
@@ -3853,7 +3853,7 @@ discard block |
||
3853 | 3853 | if (is_array($what) === true) { |
3854 | 3854 | /** @noinspection ForeachSourceInspection */ |
3855 | 3855 | foreach ($what as $item) { |
3856 | - $str = preg_replace('/(' . preg_quote($item, '/') . ')+/', $item, $str); |
|
3856 | + $str = preg_replace('/('.preg_quote($item, '/').')+/', $item, $str); |
|
3857 | 3857 | } |
3858 | 3858 | } |
3859 | 3859 | |
@@ -3966,7 +3966,7 @@ discard block |
||
3966 | 3966 | return preg_replace('/[\pZ\pC]+$/u', '', $str); |
3967 | 3967 | } |
3968 | 3968 | |
3969 | - return preg_replace('/' . self::rxClass($chars) . '+$/u', '', $str); |
|
3969 | + return preg_replace('/'.self::rxClass($chars).'+$/u', '', $str); |
|
3970 | 3970 | } |
3971 | 3971 | |
3972 | 3972 | /** |
@@ -3981,7 +3981,7 @@ discard block |
||
3981 | 3981 | { |
3982 | 3982 | static $RX_CLASSS_CACHE = array(); |
3983 | 3983 | |
3984 | - $cacheKey = $s . $class; |
|
3984 | + $cacheKey = $s.$class; |
|
3985 | 3985 | |
3986 | 3986 | if (isset($RX_CLASSS_CACHE[$cacheKey])) { |
3987 | 3987 | return $RX_CLASSS_CACHE[$cacheKey]; |
@@ -3993,7 +3993,7 @@ discard block |
||
3993 | 3993 | /** @noinspection SuspiciousLoopInspection */ |
3994 | 3994 | foreach (self::str_split($s) as $s) { |
3995 | 3995 | if ('-' === $s) { |
3996 | - $class[0] = '-' . $class[0]; |
|
3996 | + $class[0] = '-'.$class[0]; |
|
3997 | 3997 | } elseif (!isset($s[2])) { |
3998 | 3998 | $class[0] .= preg_quote($s, '/'); |
3999 | 3999 | } elseif (1 === self::strlen($s)) { |
@@ -4004,13 +4004,13 @@ discard block |
||
4004 | 4004 | } |
4005 | 4005 | |
4006 | 4006 | if ($class[0]) { |
4007 | - $class[0] = '[' . $class[0] . ']'; |
|
4007 | + $class[0] = '['.$class[0].']'; |
|
4008 | 4008 | } |
4009 | 4009 | |
4010 | 4010 | if (1 === count($class)) { |
4011 | 4011 | $return = $class[0]; |
4012 | 4012 | } else { |
4013 | - $return = '(?:' . implode('|', $class) . ')'; |
|
4013 | + $return = '(?:'.implode('|', $class).')'; |
|
4014 | 4014 | } |
4015 | 4015 | |
4016 | 4016 | $RX_CLASSS_CACHE[$cacheKey] = $return; |
@@ -4028,7 +4028,7 @@ discard block |
||
4028 | 4028 | } |
4029 | 4029 | |
4030 | 4030 | foreach (self::$SUPPORT as $utf8Support) { |
4031 | - echo $utf8Support . "\n<br>"; |
|
4031 | + echo $utf8Support."\n<br>"; |
|
4032 | 4032 | } |
4033 | 4033 | } |
4034 | 4034 | |
@@ -4062,7 +4062,7 @@ discard block |
||
4062 | 4062 | $encoding = self::normalize_encoding($encoding, 'UTF-8'); |
4063 | 4063 | } |
4064 | 4064 | |
4065 | - return '&#' . self::ord($char, $encoding) . ';'; |
|
4065 | + return '&#'.self::ord($char, $encoding).';'; |
|
4066 | 4066 | } |
4067 | 4067 | |
4068 | 4068 | /** |
@@ -4129,7 +4129,7 @@ discard block |
||
4129 | 4129 | ) { |
4130 | 4130 | |
4131 | 4131 | if (($str[$i + 1] & "\xC0") === "\x80") { |
4132 | - $ret[] = $str[$i] . $str[$i + 1]; |
|
4132 | + $ret[] = $str[$i].$str[$i + 1]; |
|
4133 | 4133 | |
4134 | 4134 | $i++; |
4135 | 4135 | } |
@@ -4145,7 +4145,7 @@ discard block |
||
4145 | 4145 | && |
4146 | 4146 | ($str[$i + 2] & "\xC0") === "\x80" |
4147 | 4147 | ) { |
4148 | - $ret[] = $str[$i] . $str[$i + 1] . $str[$i + 2]; |
|
4148 | + $ret[] = $str[$i].$str[$i + 1].$str[$i + 2]; |
|
4149 | 4149 | |
4150 | 4150 | $i += 2; |
4151 | 4151 | } |
@@ -4163,7 +4163,7 @@ discard block |
||
4163 | 4163 | && |
4164 | 4164 | ($str[$i + 3] & "\xC0") === "\x80" |
4165 | 4165 | ) { |
4166 | - $ret[] = $str[$i] . $str[$i + 1] . $str[$i + 2] . $str[$i + 3]; |
|
4166 | + $ret[] = $str[$i].$str[$i + 1].$str[$i + 2].$str[$i + 3]; |
|
4167 | 4167 | |
4168 | 4168 | $i += 3; |
4169 | 4169 | } |
@@ -4176,7 +4176,7 @@ discard block |
||
4176 | 4176 | $ret = array_chunk($ret, $length); |
4177 | 4177 | |
4178 | 4178 | return array_map( |
4179 | - function ($item) { |
|
4179 | + function($item) { |
|
4180 | 4180 | return implode('', $item); |
4181 | 4181 | }, $ret |
4182 | 4182 | ); |
@@ -4275,7 +4275,7 @@ discard block |
||
4275 | 4275 | foreach (self::$ICONV_ENCODING as $encodingTmp) { |
4276 | 4276 | # INFO: //IGNORE and //TRANSLIT still throw notice |
4277 | 4277 | /** @noinspection PhpUsageOfSilenceOperatorInspection */ |
4278 | - if (md5(@\iconv($encodingTmp, $encodingTmp . '//IGNORE', $str)) === $md5) { |
|
4278 | + if (md5(@\iconv($encodingTmp, $encodingTmp.'//IGNORE', $str)) === $md5) { |
|
4279 | 4279 | return $encodingTmp; |
4280 | 4280 | } |
4281 | 4281 | } |
@@ -4365,7 +4365,7 @@ discard block |
||
4365 | 4365 | if ('' === $s .= '') { |
4366 | 4366 | $s = '/^(?<=.)$/'; |
4367 | 4367 | } else { |
4368 | - $s = '/' . preg_quote($s, '/') . '/ui'; |
|
4368 | + $s = '/'.preg_quote($s, '/').'/ui'; |
|
4369 | 4369 | } |
4370 | 4370 | } |
4371 | 4371 | |
@@ -4423,7 +4423,7 @@ discard block |
||
4423 | 4423 | } |
4424 | 4424 | |
4425 | 4425 | if (self::substr($str, $length - 1, 1) === ' ') { |
4426 | - return self::substr($str, 0, $length - 1) . $strAddOn; |
|
4426 | + return self::substr($str, 0, $length - 1).$strAddOn; |
|
4427 | 4427 | } |
4428 | 4428 | |
4429 | 4429 | $str = self::substr($str, 0, $length); |
@@ -4432,9 +4432,9 @@ discard block |
||
4432 | 4432 | $new_str = implode(' ', $array); |
4433 | 4433 | |
4434 | 4434 | if ($new_str === '') { |
4435 | - $str = self::substr($str, 0, $length - 1) . $strAddOn; |
|
4435 | + $str = self::substr($str, 0, $length - 1).$strAddOn; |
|
4436 | 4436 | } else { |
4437 | - $str = $new_str . $strAddOn; |
|
4437 | + $str = $new_str.$strAddOn; |
|
4438 | 4438 | } |
4439 | 4439 | |
4440 | 4440 | return $str; |
@@ -4489,7 +4489,7 @@ discard block |
||
4489 | 4489 | $pre = ''; |
4490 | 4490 | } |
4491 | 4491 | |
4492 | - return $pre . $str . $post; |
|
4492 | + return $pre.$str.$post; |
|
4493 | 4493 | } |
4494 | 4494 | |
4495 | 4495 | return $str; |
@@ -4639,7 +4639,7 @@ discard block |
||
4639 | 4639 | } |
4640 | 4640 | |
4641 | 4641 | /** @noinspection PhpInternalEntityUsedInspection */ |
4642 | - preg_match_all('/' . Grapheme::GRAPHEME_CLUSTER_RX . '/u', $str, $a); |
|
4642 | + preg_match_all('/'.Grapheme::GRAPHEME_CLUSTER_RX.'/u', $str, $a); |
|
4643 | 4643 | $a = $a[0]; |
4644 | 4644 | |
4645 | 4645 | if ($len === 1) { |
@@ -4834,7 +4834,7 @@ discard block |
||
4834 | 4834 | public static function strcmp($str1, $str2) |
4835 | 4835 | { |
4836 | 4836 | /** @noinspection PhpUndefinedClassInspection */ |
4837 | - return $str1 . '' === $str2 . '' ? 0 : strcmp( |
|
4837 | + return $str1.'' === $str2.'' ? 0 : strcmp( |
|
4838 | 4838 | \Normalizer::normalize($str1, \Normalizer::NFD), |
4839 | 4839 | \Normalizer::normalize($str2, \Normalizer::NFD) |
4840 | 4840 | ); |
@@ -4865,7 +4865,7 @@ discard block |
||
4865 | 4865 | return null; |
4866 | 4866 | } |
4867 | 4867 | |
4868 | - if (preg_match('/^(.*?)' . self::rxClass($charList) . '/us', $str, $length)) { |
|
4868 | + if (preg_match('/^(.*?)'.self::rxClass($charList).'/us', $str, $length)) { |
|
4869 | 4869 | /** @noinspection OffsetOperationsInspection */ |
4870 | 4870 | return self::strlen($length[1]); |
4871 | 4871 | } |
@@ -5080,7 +5080,7 @@ discard block |
||
5080 | 5080 | && |
5081 | 5081 | self::$SUPPORT['mbstring'] === false |
5082 | 5082 | ) { |
5083 | - trigger_error('UTF8::stristr() without mbstring cannot handle "' . $encoding . '" encoding', E_USER_WARNING); |
|
5083 | + trigger_error('UTF8::stristr() without mbstring cannot handle "'.$encoding.'" encoding', E_USER_WARNING); |
|
5084 | 5084 | } |
5085 | 5085 | |
5086 | 5086 | if (self::$SUPPORT['mbstring'] === true) { |
@@ -5097,7 +5097,7 @@ discard block |
||
5097 | 5097 | return \grapheme_stristr($haystack, $needle, $before_needle); |
5098 | 5098 | } |
5099 | 5099 | |
5100 | - preg_match('/^(.*?)' . preg_quote($needle, '/') . '/usi', $haystack, $match); |
|
5100 | + preg_match('/^(.*?)'.preg_quote($needle, '/').'/usi', $haystack, $match); |
|
5101 | 5101 | |
5102 | 5102 | if (!isset($match[1])) { |
5103 | 5103 | return false; |
@@ -5171,7 +5171,7 @@ discard block |
||
5171 | 5171 | && |
5172 | 5172 | self::$SUPPORT['iconv'] === false |
5173 | 5173 | ) { |
5174 | - trigger_error('UTF8::strlen() without mbstring / iconv cannot handle "' . $encoding . '" encoding', E_USER_WARNING); |
|
5174 | + trigger_error('UTF8::strlen() without mbstring / iconv cannot handle "'.$encoding.'" encoding', E_USER_WARNING); |
|
5175 | 5175 | } |
5176 | 5176 | |
5177 | 5177 | if ( |
@@ -5246,7 +5246,7 @@ discard block |
||
5246 | 5246 | */ |
5247 | 5247 | public static function strnatcmp($str1, $str2) |
5248 | 5248 | { |
5249 | - return $str1 . '' === $str2 . '' ? 0 : strnatcmp(self::strtonatfold($str1), self::strtonatfold($str2)); |
|
5249 | + return $str1.'' === $str2.'' ? 0 : strnatcmp(self::strtonatfold($str1), self::strtonatfold($str2)); |
|
5250 | 5250 | } |
5251 | 5251 | |
5252 | 5252 | /** |
@@ -5307,7 +5307,7 @@ discard block |
||
5307 | 5307 | return false; |
5308 | 5308 | } |
5309 | 5309 | |
5310 | - if (preg_match('/' . self::rxClass($char_list) . '/us', $haystack, $m)) { |
|
5310 | + if (preg_match('/'.self::rxClass($char_list).'/us', $haystack, $m)) { |
|
5311 | 5311 | return substr($haystack, strpos($haystack, $m[0])); |
5312 | 5312 | } else { |
5313 | 5313 | return false; |
@@ -5384,7 +5384,7 @@ discard block |
||
5384 | 5384 | && |
5385 | 5385 | self::$SUPPORT['mbstring'] === false |
5386 | 5386 | ) { |
5387 | - trigger_error('UTF8::strpos() without mbstring / iconv cannot handle "' . $encoding . '" encoding', E_USER_WARNING); |
|
5387 | + trigger_error('UTF8::strpos() without mbstring / iconv cannot handle "'.$encoding.'" encoding', E_USER_WARNING); |
|
5388 | 5388 | } |
5389 | 5389 | |
5390 | 5390 | if ( |
@@ -5603,7 +5603,7 @@ discard block |
||
5603 | 5603 | && |
5604 | 5604 | self::$SUPPORT['mbstring'] === false |
5605 | 5605 | ) { |
5606 | - trigger_error('UTF8::strripos() without mbstring cannot handle "' . $encoding . '" encoding', E_USER_WARNING); |
|
5606 | + trigger_error('UTF8::strripos() without mbstring cannot handle "'.$encoding.'" encoding', E_USER_WARNING); |
|
5607 | 5607 | } |
5608 | 5608 | |
5609 | 5609 | if (self::$SUPPORT['mbstring'] === true) { |
@@ -5686,7 +5686,7 @@ discard block |
||
5686 | 5686 | && |
5687 | 5687 | self::$SUPPORT['mbstring'] === false |
5688 | 5688 | ) { |
5689 | - trigger_error('UTF8::strrpos() without mbstring cannot handle "' . $encoding . '" encoding', E_USER_WARNING); |
|
5689 | + trigger_error('UTF8::strrpos() without mbstring cannot handle "'.$encoding.'" encoding', E_USER_WARNING); |
|
5690 | 5690 | } |
5691 | 5691 | |
5692 | 5692 | if (self::$SUPPORT['mbstring'] === true) { |
@@ -5746,7 +5746,7 @@ discard block |
||
5746 | 5746 | return 0; |
5747 | 5747 | } |
5748 | 5748 | |
5749 | - return preg_match('/^' . self::rxClass($mask) . '+/u', $str, $str) ? self::strlen($str[0]) : 0; |
|
5749 | + return preg_match('/^'.self::rxClass($mask).'+/u', $str, $str) ? self::strlen($str[0]) : 0; |
|
5750 | 5750 | } |
5751 | 5751 | |
5752 | 5752 | /** |
@@ -5792,7 +5792,7 @@ discard block |
||
5792 | 5792 | && |
5793 | 5793 | self::$SUPPORT['mbstring'] === false |
5794 | 5794 | ) { |
5795 | - trigger_error('UTF8::strstr() without mbstring cannot handle "' . $encoding . '" encoding', E_USER_WARNING); |
|
5795 | + trigger_error('UTF8::strstr() without mbstring cannot handle "'.$encoding.'" encoding', E_USER_WARNING); |
|
5796 | 5796 | } |
5797 | 5797 | |
5798 | 5798 | if (self::$SUPPORT['mbstring'] === true) { |
@@ -5809,7 +5809,7 @@ discard block |
||
5809 | 5809 | return \grapheme_strstr($haystack, $needle, $before_needle); |
5810 | 5810 | } |
5811 | 5811 | |
5812 | - preg_match('/^(.*?)' . preg_quote($needle, '/') . '/us', $haystack, $match); |
|
5812 | + preg_match('/^(.*?)'.preg_quote($needle, '/').'/us', $haystack, $match); |
|
5813 | 5813 | |
5814 | 5814 | if (!isset($match[1])) { |
5815 | 5815 | return false; |
@@ -6081,7 +6081,7 @@ discard block |
||
6081 | 6081 | && |
6082 | 6082 | self::$SUPPORT['mbstring'] === false |
6083 | 6083 | ) { |
6084 | - trigger_error('UTF8::substr() without mbstring cannot handle "' . $encoding . '" encoding', E_USER_WARNING); |
|
6084 | + trigger_error('UTF8::substr() without mbstring cannot handle "'.$encoding.'" encoding', E_USER_WARNING); |
|
6085 | 6085 | } |
6086 | 6086 | |
6087 | 6087 | if (self::$SUPPORT['mbstring'] === true) { |
@@ -6200,14 +6200,14 @@ discard block |
||
6200 | 6200 | && |
6201 | 6201 | self::$SUPPORT['mbstring'] === false |
6202 | 6202 | ) { |
6203 | - trigger_error('UTF8::substr_count() without mbstring cannot handle "' . $encoding . '" encoding', E_USER_WARNING); |
|
6203 | + trigger_error('UTF8::substr_count() without mbstring cannot handle "'.$encoding.'" encoding', E_USER_WARNING); |
|
6204 | 6204 | } |
6205 | 6205 | |
6206 | 6206 | if (self::$SUPPORT['mbstring'] === true) { |
6207 | 6207 | return \mb_substr_count($haystack, $needle, $encoding); |
6208 | 6208 | } |
6209 | 6209 | |
6210 | - preg_match_all('/' . preg_quote($needle, '/') . '/us', $haystack, $matches, PREG_SET_ORDER); |
|
6210 | + preg_match_all('/'.preg_quote($needle, '/').'/us', $haystack, $matches, PREG_SET_ORDER); |
|
6211 | 6211 | |
6212 | 6212 | return count($matches); |
6213 | 6213 | } |
@@ -6454,7 +6454,7 @@ discard block |
||
6454 | 6454 | |
6455 | 6455 | $strSwappedCase = preg_replace_callback( |
6456 | 6456 | '/[\S]/u', |
6457 | - function ($match) use ($encoding) { |
|
6457 | + function($match) use ($encoding) { |
|
6458 | 6458 | $marchToUpper = UTF8::strtoupper($match[0], $encoding); |
6459 | 6459 | |
6460 | 6460 | if ($match[0] === $marchToUpper) { |
@@ -6793,13 +6793,13 @@ discard block |
||
6793 | 6793 | $c2 = $i + 1 >= $max ? "\x00" : $str[$i + 1]; |
6794 | 6794 | |
6795 | 6795 | if ($c2 >= "\x80" && $c2 <= "\xBF") { // yeah, almost sure it's UTF8 already |
6796 | - $buf .= $c1 . $c2; |
|
6796 | + $buf .= $c1.$c2; |
|
6797 | 6797 | $i++; |
6798 | 6798 | } else { // not valid UTF8 - convert it |
6799 | 6799 | $cc1tmp = ord($c1) / 64; |
6800 | 6800 | $cc1 = self::chr_and_parse_int($cc1tmp) | "\xC0"; |
6801 | 6801 | $cc2 = ($c1 & "\x3F") | "\x80"; |
6802 | - $buf .= $cc1 . $cc2; |
|
6802 | + $buf .= $cc1.$cc2; |
|
6803 | 6803 | } |
6804 | 6804 | |
6805 | 6805 | } elseif ($c1 >= "\xE0" && $c1 <= "\xEF") { // looks like 3 bytes UTF8 |
@@ -6808,13 +6808,13 @@ discard block |
||
6808 | 6808 | $c3 = $i + 2 >= $max ? "\x00" : $str[$i + 2]; |
6809 | 6809 | |
6810 | 6810 | if ($c2 >= "\x80" && $c2 <= "\xBF" && $c3 >= "\x80" && $c3 <= "\xBF") { // yeah, almost sure it's UTF8 already |
6811 | - $buf .= $c1 . $c2 . $c3; |
|
6811 | + $buf .= $c1.$c2.$c3; |
|
6812 | 6812 | $i += 2; |
6813 | 6813 | } else { // not valid UTF8 - convert it |
6814 | 6814 | $cc1tmp = ord($c1) / 64; |
6815 | 6815 | $cc1 = self::chr_and_parse_int($cc1tmp) | "\xC0"; |
6816 | 6816 | $cc2 = ($c1 & "\x3F") | "\x80"; |
6817 | - $buf .= $cc1 . $cc2; |
|
6817 | + $buf .= $cc1.$cc2; |
|
6818 | 6818 | } |
6819 | 6819 | |
6820 | 6820 | } elseif ($c1 >= "\xF0" && $c1 <= "\xF7") { // looks like 4 bytes UTF8 |
@@ -6824,20 +6824,20 @@ discard block |
||
6824 | 6824 | $c4 = $i + 3 >= $max ? "\x00" : $str[$i + 3]; |
6825 | 6825 | |
6826 | 6826 | if ($c2 >= "\x80" && $c2 <= "\xBF" && $c3 >= "\x80" && $c3 <= "\xBF" && $c4 >= "\x80" && $c4 <= "\xBF") { // yeah, almost sure it's UTF8 already |
6827 | - $buf .= $c1 . $c2 . $c3 . $c4; |
|
6827 | + $buf .= $c1.$c2.$c3.$c4; |
|
6828 | 6828 | $i += 3; |
6829 | 6829 | } else { // not valid UTF8 - convert it |
6830 | 6830 | $cc1tmp = ord($c1) / 64; |
6831 | 6831 | $cc1 = self::chr_and_parse_int($cc1tmp) | "\xC0"; |
6832 | 6832 | $cc2 = ($c1 & "\x3F") | "\x80"; |
6833 | - $buf .= $cc1 . $cc2; |
|
6833 | + $buf .= $cc1.$cc2; |
|
6834 | 6834 | } |
6835 | 6835 | |
6836 | 6836 | } else { // doesn't look like UTF8, but should be converted |
6837 | 6837 | $cc1tmp = ord($c1) / 64; |
6838 | 6838 | $cc1 = self::chr_and_parse_int($cc1tmp) | "\xC0"; |
6839 | 6839 | $cc2 = ($c1 & "\x3F") | "\x80"; |
6840 | - $buf .= $cc1 . $cc2; |
|
6840 | + $buf .= $cc1.$cc2; |
|
6841 | 6841 | } |
6842 | 6842 | |
6843 | 6843 | } elseif (($c1 & "\xC0") === "\x80") { // needs conversion |
@@ -6848,7 +6848,7 @@ discard block |
||
6848 | 6848 | } else { |
6849 | 6849 | $cc1 = self::chr_and_parse_int($ordC1 / 64) | "\xC0"; |
6850 | 6850 | $cc2 = ($c1 & "\x3F") | "\x80"; |
6851 | - $buf .= $cc1 . $cc2; |
|
6851 | + $buf .= $cc1.$cc2; |
|
6852 | 6852 | } |
6853 | 6853 | |
6854 | 6854 | } else { // it doesn't need conversion |
@@ -6859,7 +6859,7 @@ discard block |
||
6859 | 6859 | // decode unicode escape sequences |
6860 | 6860 | $buf = preg_replace_callback( |
6861 | 6861 | '/\\\\u([0-9a-f]{4})/i', |
6862 | - function ($match) { |
|
6862 | + function($match) { |
|
6863 | 6863 | return \mb_convert_encoding(pack('H*', $match[1]), 'UTF-8', 'UCS-2BE'); |
6864 | 6864 | }, |
6865 | 6865 | $buf |
@@ -6913,7 +6913,7 @@ discard block |
||
6913 | 6913 | */ |
6914 | 6914 | public static function ucfirst($str, $encoding = 'UTF-8', $cleanUtf8 = false) |
6915 | 6915 | { |
6916 | - return self::strtoupper(self::substr($str, 0, 1, $encoding, $cleanUtf8), $encoding, $cleanUtf8) . self::substr($str, 1, null, $encoding, $cleanUtf8); |
|
6916 | + return self::strtoupper(self::substr($str, 0, 1, $encoding, $cleanUtf8), $encoding, $cleanUtf8).self::substr($str, 1, null, $encoding, $cleanUtf8); |
|
6917 | 6917 | } |
6918 | 6918 | |
6919 | 6919 | /** |
@@ -7420,7 +7420,7 @@ discard block |
||
7420 | 7420 | return ''; |
7421 | 7421 | } |
7422 | 7422 | |
7423 | - preg_match('/^\s*+(?:\S++\s*+){1,' . $words . '}/u', $str, $matches); |
|
7423 | + preg_match('/^\s*+(?:\S++\s*+){1,'.$words.'}/u', $str, $matches); |
|
7424 | 7424 | |
7425 | 7425 | if ( |
7426 | 7426 | !isset($matches[0]) |
@@ -7430,7 +7430,7 @@ discard block |
||
7430 | 7430 | return $str; |
7431 | 7431 | } |
7432 | 7432 | |
7433 | - return self::rtrim($matches[0]) . $strAddOn; |
|
7433 | + return self::rtrim($matches[0]).$strAddOn; |
|
7434 | 7434 | } |
7435 | 7435 | |
7436 | 7436 | /** |
@@ -7498,7 +7498,7 @@ discard block |
||
7498 | 7498 | $strReturn .= $break; |
7499 | 7499 | } |
7500 | 7500 | |
7501 | - return $strReturn . implode('', $chars); |
|
7501 | + return $strReturn.implode('', $chars); |
|
7502 | 7502 | } |
7503 | 7503 | |
7504 | 7504 | /** |