@@ -2816,7 +2816,7 @@ discard block |
||
2816 | 2816 | /** |
2817 | 2817 | * Check if the input is binary... (is look like a hack). |
2818 | 2818 | * |
2819 | - * @param mixed $input |
|
2819 | + * @param string $input |
|
2820 | 2820 | * |
2821 | 2821 | * @return bool |
2822 | 2822 | */ |
@@ -5718,7 +5718,7 @@ discard block |
||
5718 | 5718 | * @link http://php.net/manual/en/function.mb-strrpos.php |
5719 | 5719 | * |
5720 | 5720 | * @param string $haystack <p>The string being checked, for the last occurrence of needle</p> |
5721 | - * @param string|int $needle <p>The string to find in haystack.<br />Or a code point as int.</p> |
|
5721 | + * @param string $needle <p>The string to find in haystack.<br />Or a code point as int.</p> |
|
5722 | 5722 | * @param int $offset [optional] <p>May be specified to begin searching an arbitrary number of characters |
5723 | 5723 | * into the string. Negative values will stop searching at an arbitrary point prior to |
5724 | 5724 | * the end of the string. |
@@ -6490,8 +6490,8 @@ discard block |
||
6490 | 6490 | * |
6491 | 6491 | * source: https://gist.github.com/stemar/8287074 |
6492 | 6492 | * |
6493 | - * @param string|string[] $str <p>The input string or an array of stings.</p> |
|
6494 | - * @param string|string[] $replacement <p>The replacement string or an array of stings.</p> |
|
6493 | + * @param string $str <p>The input string or an array of stings.</p> |
|
6494 | + * @param string $replacement <p>The replacement string or an array of stings.</p> |
|
6495 | 6495 | * @param int|int[] $offset <p> |
6496 | 6496 | * If start is positive, the replacing will begin at the start'th offset |
6497 | 6497 | * into string. |
@@ -6499,7 +6499,7 @@ discard block |
||
6499 | 6499 | * If start is negative, the replacing will begin at the start'th character |
6500 | 6500 | * from the end of string. |
6501 | 6501 | * </p> |
6502 | - * @param int|int[]|void $length [optional] <p>If given and is positive, it represents the length of the |
|
6502 | + * @param integer|null $length [optional] <p>If given and is positive, it represents the length of the |
|
6503 | 6503 | * portion of string which is to be replaced. If it is negative, it |
6504 | 6504 | * represents the number of characters from the end of string at which to |
6505 | 6505 | * stop replacing. If it is not given, then it will default to strlen( |
@@ -6934,7 +6934,7 @@ discard block |
||
6934 | 6934 | * case.</li> |
6935 | 6935 | * </ul> |
6936 | 6936 | * |
6937 | - * @param string|string[] $str <p>Any string or array.</p> |
|
6937 | + * @param string|false $str <p>Any string or array.</p> |
|
6938 | 6938 | * @param bool $decodeHtmlEntityToUtf8 <p>Set to true, if you need to decode html-entities.</p> |
6939 | 6939 | * |
6940 | 6940 | * @return string|string[] <p>The UTF-8 encoded string.</p> |
@@ -850,7 +850,7 @@ discard block |
||
850 | 850 | public static function add_bom_to_string($str) |
851 | 851 | { |
852 | 852 | if (self::string_has_bom($str) === false) { |
853 | - $str = self::bom() . $str; |
|
853 | + $str = self::bom().$str; |
|
854 | 854 | } |
855 | 855 | |
856 | 856 | return $str; |
@@ -975,7 +975,7 @@ discard block |
||
975 | 975 | |
976 | 976 | // use static cache, only if there is no support for "\IntlChar" |
977 | 977 | static $CHAR_CACHE = array(); |
978 | - $cacheKey = $code_point . $encoding; |
|
978 | + $cacheKey = $code_point.$encoding; |
|
979 | 979 | if (isset($CHAR_CACHE[$cacheKey]) === true) { |
980 | 980 | return $CHAR_CACHE[$cacheKey]; |
981 | 981 | } |
@@ -983,16 +983,16 @@ discard block |
||
983 | 983 | if (0x80 > $code_point %= 0x200000) { |
984 | 984 | $str = self::chr_and_parse_int($code_point); |
985 | 985 | } elseif (0x800 > $code_point) { |
986 | - $str = self::chr_and_parse_int(0xC0 | $code_point >> 6) . |
|
986 | + $str = self::chr_and_parse_int(0xC0 | $code_point >> 6). |
|
987 | 987 | self::chr_and_parse_int(0x80 | $code_point & 0x3F); |
988 | 988 | } elseif (0x10000 > $code_point) { |
989 | - $str = self::chr_and_parse_int(0xE0 | $code_point >> 12) . |
|
990 | - self::chr_and_parse_int(0x80 | $code_point >> 6 & 0x3F) . |
|
989 | + $str = self::chr_and_parse_int(0xE0 | $code_point >> 12). |
|
990 | + self::chr_and_parse_int(0x80 | $code_point >> 6 & 0x3F). |
|
991 | 991 | self::chr_and_parse_int(0x80 | $code_point & 0x3F); |
992 | 992 | } else { |
993 | - $str = self::chr_and_parse_int(0xF0 | $code_point >> 18) . |
|
994 | - self::chr_and_parse_int(0x80 | $code_point >> 12 & 0x3F) . |
|
995 | - self::chr_and_parse_int(0x80 | $code_point >> 6 & 0x3F) . |
|
993 | + $str = self::chr_and_parse_int(0xF0 | $code_point >> 18). |
|
994 | + self::chr_and_parse_int(0x80 | $code_point >> 12 & 0x3F). |
|
995 | + self::chr_and_parse_int(0x80 | $code_point >> 6 & 0x3F). |
|
996 | 996 | self::chr_and_parse_int(0x80 | $code_point & 0x3F); |
997 | 997 | } |
998 | 998 | |
@@ -1052,7 +1052,7 @@ discard block |
||
1052 | 1052 | } |
1053 | 1053 | |
1054 | 1054 | return array_map( |
1055 | - function ($data) { |
|
1055 | + function($data) { |
|
1056 | 1056 | return UTF8::strlen($data, '8BIT'); |
1057 | 1057 | }, |
1058 | 1058 | self::split($str) |
@@ -1294,7 +1294,7 @@ discard block |
||
1294 | 1294 | $flags = ENT_QUOTES; |
1295 | 1295 | } |
1296 | 1296 | |
1297 | - return self::html_entity_decode('&#' . $int . ';', $flags); |
|
1297 | + return self::html_entity_decode('&#'.$int.';', $flags); |
|
1298 | 1298 | } |
1299 | 1299 | |
1300 | 1300 | /** |
@@ -1371,7 +1371,7 @@ discard block |
||
1371 | 1371 | && |
1372 | 1372 | self::$SUPPORT['mbstring'] === false |
1373 | 1373 | ) { |
1374 | - trigger_error('UTF8::encode() without mbstring cannot handle "' . $encoding . '" encoding', E_USER_WARNING); |
|
1374 | + trigger_error('UTF8::encode() without mbstring cannot handle "'.$encoding.'" encoding', E_USER_WARNING); |
|
1375 | 1375 | } |
1376 | 1376 | |
1377 | 1377 | $strEncoded = \mb_convert_encoding( |
@@ -1580,7 +1580,7 @@ discard block |
||
1580 | 1580 | ) { |
1581 | 1581 | // Prevent leading combining chars |
1582 | 1582 | // for NFC-safe concatenations. |
1583 | - $var = $leading_combining . $var; |
|
1583 | + $var = $leading_combining.$var; |
|
1584 | 1584 | } |
1585 | 1585 | } |
1586 | 1586 | |
@@ -2004,7 +2004,7 @@ discard block |
||
2004 | 2004 | */ |
2005 | 2005 | private static function getData($file) |
2006 | 2006 | { |
2007 | - $file = __DIR__ . '/data/' . $file . '.php'; |
|
2007 | + $file = __DIR__.'/data/'.$file.'.php'; |
|
2008 | 2008 | if (file_exists($file)) { |
2009 | 2009 | /** @noinspection PhpIncludeInspection */ |
2010 | 2010 | return require $file; |
@@ -2149,7 +2149,7 @@ discard block |
||
2149 | 2149 | return implode( |
2150 | 2150 | '', |
2151 | 2151 | array_map( |
2152 | - function ($data) use ($keepAsciiChars, $encoding) { |
|
2152 | + function($data) use ($keepAsciiChars, $encoding) { |
|
2153 | 2153 | return UTF8::single_chr_html_encode($data, $keepAsciiChars, $encoding); |
2154 | 2154 | }, |
2155 | 2155 | self::split($str) |
@@ -2268,7 +2268,7 @@ discard block |
||
2268 | 2268 | |
2269 | 2269 | $str = preg_replace_callback( |
2270 | 2270 | "/&#\d{2,6};/", |
2271 | - function ($matches) use ($encoding) { |
|
2271 | + function($matches) use ($encoding) { |
|
2272 | 2272 | $returnTmp = \mb_convert_encoding($matches[0], $encoding, 'HTML-ENTITIES'); |
2273 | 2273 | |
2274 | 2274 | if ($returnTmp !== '"' && $returnTmp !== "'") { |
@@ -2592,9 +2592,9 @@ discard block |
||
2592 | 2592 | if ((int)$int === $int) { |
2593 | 2593 | $hex = dechex($int); |
2594 | 2594 | |
2595 | - $hex = (strlen($hex) < 4 ? substr('0000' . $hex, -4) : $hex); |
|
2595 | + $hex = (strlen($hex) < 4 ? substr('0000'.$hex, -4) : $hex); |
|
2596 | 2596 | |
2597 | - return $pfix . $hex; |
|
2597 | + return $pfix.$hex; |
|
2598 | 2598 | } |
2599 | 2599 | |
2600 | 2600 | return ''; |
@@ -3322,7 +3322,7 @@ discard block |
||
3322 | 3322 | */ |
3323 | 3323 | public static function lcfirst($str) |
3324 | 3324 | { |
3325 | - return self::strtolower(self::substr($str, 0, 1)) . self::substr($str, 1); |
|
3325 | + return self::strtolower(self::substr($str, 0, 1)).self::substr($str, 1); |
|
3326 | 3326 | } |
3327 | 3327 | |
3328 | 3328 | /** |
@@ -3346,7 +3346,7 @@ discard block |
||
3346 | 3346 | return preg_replace('/^[\pZ\pC]+/u', '', $str); |
3347 | 3347 | } |
3348 | 3348 | |
3349 | - return preg_replace('/^' . self::rxClass($chars) . '+/u', '', $str); |
|
3349 | + return preg_replace('/^'.self::rxClass($chars).'+/u', '', $str); |
|
3350 | 3350 | } |
3351 | 3351 | |
3352 | 3352 | /** |
@@ -3886,7 +3886,7 @@ discard block |
||
3886 | 3886 | if (is_array($what) === true) { |
3887 | 3887 | /** @noinspection ForeachSourceInspection */ |
3888 | 3888 | foreach ($what as $item) { |
3889 | - $str = preg_replace('/(' . preg_quote($item, '/') . ')+/', $item, $str); |
|
3889 | + $str = preg_replace('/('.preg_quote($item, '/').')+/', $item, $str); |
|
3890 | 3890 | } |
3891 | 3891 | } |
3892 | 3892 | |
@@ -3999,7 +3999,7 @@ discard block |
||
3999 | 3999 | return preg_replace('/[\pZ\pC]+$/u', '', $str); |
4000 | 4000 | } |
4001 | 4001 | |
4002 | - return preg_replace('/' . self::rxClass($chars) . '+$/u', '', $str); |
|
4002 | + return preg_replace('/'.self::rxClass($chars).'+$/u', '', $str); |
|
4003 | 4003 | } |
4004 | 4004 | |
4005 | 4005 | /** |
@@ -4014,7 +4014,7 @@ discard block |
||
4014 | 4014 | { |
4015 | 4015 | static $RX_CLASSS_CACHE = array(); |
4016 | 4016 | |
4017 | - $cacheKey = $s . $class; |
|
4017 | + $cacheKey = $s.$class; |
|
4018 | 4018 | |
4019 | 4019 | if (isset($RX_CLASSS_CACHE[$cacheKey])) { |
4020 | 4020 | return $RX_CLASSS_CACHE[$cacheKey]; |
@@ -4026,7 +4026,7 @@ discard block |
||
4026 | 4026 | /** @noinspection SuspiciousLoopInspection */ |
4027 | 4027 | foreach (self::str_split($s) as $s) { |
4028 | 4028 | if ('-' === $s) { |
4029 | - $class[0] = '-' . $class[0]; |
|
4029 | + $class[0] = '-'.$class[0]; |
|
4030 | 4030 | } elseif (!isset($s[2])) { |
4031 | 4031 | $class[0] .= preg_quote($s, '/'); |
4032 | 4032 | } elseif (1 === self::strlen($s)) { |
@@ -4037,13 +4037,13 @@ discard block |
||
4037 | 4037 | } |
4038 | 4038 | |
4039 | 4039 | if ($class[0]) { |
4040 | - $class[0] = '[' . $class[0] . ']'; |
|
4040 | + $class[0] = '['.$class[0].']'; |
|
4041 | 4041 | } |
4042 | 4042 | |
4043 | 4043 | if (1 === count($class)) { |
4044 | 4044 | $return = $class[0]; |
4045 | 4045 | } else { |
4046 | - $return = '(?:' . implode('|', $class) . ')'; |
|
4046 | + $return = '(?:'.implode('|', $class).')'; |
|
4047 | 4047 | } |
4048 | 4048 | |
4049 | 4049 | $RX_CLASSS_CACHE[$cacheKey] = $return; |
@@ -4061,7 +4061,7 @@ discard block |
||
4061 | 4061 | } |
4062 | 4062 | |
4063 | 4063 | foreach (self::$SUPPORT as $utf8Support) { |
4064 | - echo $utf8Support . "\n<br>"; |
|
4064 | + echo $utf8Support."\n<br>"; |
|
4065 | 4065 | } |
4066 | 4066 | } |
4067 | 4067 | |
@@ -4095,7 +4095,7 @@ discard block |
||
4095 | 4095 | $encoding = self::normalize_encoding($encoding, 'UTF-8'); |
4096 | 4096 | } |
4097 | 4097 | |
4098 | - return '&#' . self::ord($char, $encoding) . ';'; |
|
4098 | + return '&#'.self::ord($char, $encoding).';'; |
|
4099 | 4099 | } |
4100 | 4100 | |
4101 | 4101 | /** |
@@ -4162,7 +4162,7 @@ discard block |
||
4162 | 4162 | ) { |
4163 | 4163 | |
4164 | 4164 | if (($str[$i + 1] & "\xC0") === "\x80") { |
4165 | - $ret[] = $str[$i] . $str[$i + 1]; |
|
4165 | + $ret[] = $str[$i].$str[$i + 1]; |
|
4166 | 4166 | |
4167 | 4167 | $i++; |
4168 | 4168 | } |
@@ -4178,7 +4178,7 @@ discard block |
||
4178 | 4178 | && |
4179 | 4179 | ($str[$i + 2] & "\xC0") === "\x80" |
4180 | 4180 | ) { |
4181 | - $ret[] = $str[$i] . $str[$i + 1] . $str[$i + 2]; |
|
4181 | + $ret[] = $str[$i].$str[$i + 1].$str[$i + 2]; |
|
4182 | 4182 | |
4183 | 4183 | $i += 2; |
4184 | 4184 | } |
@@ -4196,7 +4196,7 @@ discard block |
||
4196 | 4196 | && |
4197 | 4197 | ($str[$i + 3] & "\xC0") === "\x80" |
4198 | 4198 | ) { |
4199 | - $ret[] = $str[$i] . $str[$i + 1] . $str[$i + 2] . $str[$i + 3]; |
|
4199 | + $ret[] = $str[$i].$str[$i + 1].$str[$i + 2].$str[$i + 3]; |
|
4200 | 4200 | |
4201 | 4201 | $i += 3; |
4202 | 4202 | } |
@@ -4209,7 +4209,7 @@ discard block |
||
4209 | 4209 | $ret = array_chunk($ret, $length); |
4210 | 4210 | |
4211 | 4211 | return array_map( |
4212 | - function ($item) { |
|
4212 | + function($item) { |
|
4213 | 4213 | return implode('', $item); |
4214 | 4214 | }, $ret |
4215 | 4215 | ); |
@@ -4316,7 +4316,7 @@ discard block |
||
4316 | 4316 | foreach (self::$ICONV_ENCODING as $encodingTmp) { |
4317 | 4317 | # INFO: //IGNORE and //TRANSLIT still throw notice |
4318 | 4318 | /** @noinspection PhpUsageOfSilenceOperatorInspection */ |
4319 | - if (md5(@\iconv($encodingTmp, $encodingTmp . '//IGNORE', $str)) === $md5) { |
|
4319 | + if (md5(@\iconv($encodingTmp, $encodingTmp.'//IGNORE', $str)) === $md5) { |
|
4320 | 4320 | return $encodingTmp; |
4321 | 4321 | } |
4322 | 4322 | } |
@@ -4406,7 +4406,7 @@ discard block |
||
4406 | 4406 | if ('' === $s .= '') { |
4407 | 4407 | $s = '/^(?<=.)$/'; |
4408 | 4408 | } else { |
4409 | - $s = '/' . preg_quote($s, '/') . '/ui'; |
|
4409 | + $s = '/'.preg_quote($s, '/').'/ui'; |
|
4410 | 4410 | } |
4411 | 4411 | } |
4412 | 4412 | |
@@ -4464,7 +4464,7 @@ discard block |
||
4464 | 4464 | } |
4465 | 4465 | |
4466 | 4466 | if (self::substr($str, $length - 1, 1) === ' ') { |
4467 | - return (string)self::substr($str, 0, $length - 1) . $strAddOn; |
|
4467 | + return (string)self::substr($str, 0, $length - 1).$strAddOn; |
|
4468 | 4468 | } |
4469 | 4469 | |
4470 | 4470 | $str = (string)self::substr($str, 0, $length); |
@@ -4473,9 +4473,9 @@ discard block |
||
4473 | 4473 | $new_str = implode(' ', $array); |
4474 | 4474 | |
4475 | 4475 | if ($new_str === '') { |
4476 | - $str = self::substr($str, 0, $length - 1) . $strAddOn; |
|
4476 | + $str = self::substr($str, 0, $length - 1).$strAddOn; |
|
4477 | 4477 | } else { |
4478 | - $str = $new_str . $strAddOn; |
|
4478 | + $str = $new_str.$strAddOn; |
|
4479 | 4479 | } |
4480 | 4480 | |
4481 | 4481 | return $str; |
@@ -4530,7 +4530,7 @@ discard block |
||
4530 | 4530 | $pre = ''; |
4531 | 4531 | } |
4532 | 4532 | |
4533 | - return $pre . $str . $post; |
|
4533 | + return $pre.$str.$post; |
|
4534 | 4534 | } |
4535 | 4535 | |
4536 | 4536 | return $str; |
@@ -4680,7 +4680,7 @@ discard block |
||
4680 | 4680 | } |
4681 | 4681 | |
4682 | 4682 | /** @noinspection PhpInternalEntityUsedInspection */ |
4683 | - preg_match_all('/' . Grapheme::GRAPHEME_CLUSTER_RX . '/u', $str, $a); |
|
4683 | + preg_match_all('/'.Grapheme::GRAPHEME_CLUSTER_RX.'/u', $str, $a); |
|
4684 | 4684 | $a = $a[0]; |
4685 | 4685 | |
4686 | 4686 | if ($len === 1) { |
@@ -4917,7 +4917,7 @@ discard block |
||
4917 | 4917 | public static function strcmp($str1, $str2) |
4918 | 4918 | { |
4919 | 4919 | /** @noinspection PhpUndefinedClassInspection */ |
4920 | - return $str1 . '' === $str2 . '' ? 0 : strcmp( |
|
4920 | + return $str1.'' === $str2.'' ? 0 : strcmp( |
|
4921 | 4921 | \Normalizer::normalize($str1, \Normalizer::NFD), |
4922 | 4922 | \Normalizer::normalize($str2, \Normalizer::NFD) |
4923 | 4923 | ); |
@@ -4948,7 +4948,7 @@ discard block |
||
4948 | 4948 | return null; |
4949 | 4949 | } |
4950 | 4950 | |
4951 | - if (preg_match('/^(.*?)' . self::rxClass($charList) . '/us', $str, $length)) { |
|
4951 | + if (preg_match('/^(.*?)'.self::rxClass($charList).'/us', $str, $length)) { |
|
4952 | 4952 | /** @noinspection OffsetOperationsInspection */ |
4953 | 4953 | return self::strlen($length[1]); |
4954 | 4954 | } |
@@ -5163,7 +5163,7 @@ discard block |
||
5163 | 5163 | && |
5164 | 5164 | self::$SUPPORT['mbstring'] === false |
5165 | 5165 | ) { |
5166 | - trigger_error('UTF8::stristr() without mbstring cannot handle "' . $encoding . '" encoding', E_USER_WARNING); |
|
5166 | + trigger_error('UTF8::stristr() without mbstring cannot handle "'.$encoding.'" encoding', E_USER_WARNING); |
|
5167 | 5167 | } |
5168 | 5168 | |
5169 | 5169 | if (self::$SUPPORT['mbstring'] === true) { |
@@ -5180,7 +5180,7 @@ discard block |
||
5180 | 5180 | return \grapheme_stristr($haystack, $needle, $before_needle); |
5181 | 5181 | } |
5182 | 5182 | |
5183 | - preg_match('/^(.*?)' . preg_quote($needle, '/') . '/usi', $haystack, $match); |
|
5183 | + preg_match('/^(.*?)'.preg_quote($needle, '/').'/usi', $haystack, $match); |
|
5184 | 5184 | |
5185 | 5185 | if (!isset($match[1])) { |
5186 | 5186 | return false; |
@@ -5254,7 +5254,7 @@ discard block |
||
5254 | 5254 | && |
5255 | 5255 | self::$SUPPORT['iconv'] === false |
5256 | 5256 | ) { |
5257 | - trigger_error('UTF8::strlen() without mbstring / iconv cannot handle "' . $encoding . '" encoding', E_USER_WARNING); |
|
5257 | + trigger_error('UTF8::strlen() without mbstring / iconv cannot handle "'.$encoding.'" encoding', E_USER_WARNING); |
|
5258 | 5258 | } |
5259 | 5259 | |
5260 | 5260 | if ( |
@@ -5329,7 +5329,7 @@ discard block |
||
5329 | 5329 | */ |
5330 | 5330 | public static function strnatcmp($str1, $str2) |
5331 | 5331 | { |
5332 | - return $str1 . '' === $str2 . '' ? 0 : strnatcmp(self::strtonatfold($str1), self::strtonatfold($str2)); |
|
5332 | + return $str1.'' === $str2.'' ? 0 : strnatcmp(self::strtonatfold($str1), self::strtonatfold($str2)); |
|
5333 | 5333 | } |
5334 | 5334 | |
5335 | 5335 | /** |
@@ -5390,7 +5390,7 @@ discard block |
||
5390 | 5390 | return false; |
5391 | 5391 | } |
5392 | 5392 | |
5393 | - if (preg_match('/' . self::rxClass($char_list) . '/us', $haystack, $m)) { |
|
5393 | + if (preg_match('/'.self::rxClass($char_list).'/us', $haystack, $m)) { |
|
5394 | 5394 | return substr($haystack, strpos($haystack, $m[0])); |
5395 | 5395 | } |
5396 | 5396 | |
@@ -5467,7 +5467,7 @@ discard block |
||
5467 | 5467 | && |
5468 | 5468 | self::$SUPPORT['mbstring'] === false |
5469 | 5469 | ) { |
5470 | - trigger_error('UTF8::strpos() without mbstring / iconv cannot handle "' . $encoding . '" encoding', E_USER_WARNING); |
|
5470 | + trigger_error('UTF8::strpos() without mbstring / iconv cannot handle "'.$encoding.'" encoding', E_USER_WARNING); |
|
5471 | 5471 | } |
5472 | 5472 | |
5473 | 5473 | if ( |
@@ -5690,7 +5690,7 @@ discard block |
||
5690 | 5690 | && |
5691 | 5691 | self::$SUPPORT['mbstring'] === false |
5692 | 5692 | ) { |
5693 | - trigger_error('UTF8::strripos() without mbstring cannot handle "' . $encoding . '" encoding', E_USER_WARNING); |
|
5693 | + trigger_error('UTF8::strripos() without mbstring cannot handle "'.$encoding.'" encoding', E_USER_WARNING); |
|
5694 | 5694 | } |
5695 | 5695 | |
5696 | 5696 | if (self::$SUPPORT['mbstring'] === true) { |
@@ -5773,7 +5773,7 @@ discard block |
||
5773 | 5773 | && |
5774 | 5774 | self::$SUPPORT['mbstring'] === false |
5775 | 5775 | ) { |
5776 | - trigger_error('UTF8::strrpos() without mbstring cannot handle "' . $encoding . '" encoding', E_USER_WARNING); |
|
5776 | + trigger_error('UTF8::strrpos() without mbstring cannot handle "'.$encoding.'" encoding', E_USER_WARNING); |
|
5777 | 5777 | } |
5778 | 5778 | |
5779 | 5779 | if (self::$SUPPORT['mbstring'] === true) { |
@@ -5841,7 +5841,7 @@ discard block |
||
5841 | 5841 | return 0; |
5842 | 5842 | } |
5843 | 5843 | |
5844 | - return preg_match('/^' . self::rxClass($mask) . '+/u', $str, $str) ? self::strlen($str[0]) : 0; |
|
5844 | + return preg_match('/^'.self::rxClass($mask).'+/u', $str, $str) ? self::strlen($str[0]) : 0; |
|
5845 | 5845 | } |
5846 | 5846 | |
5847 | 5847 | /** |
@@ -5887,7 +5887,7 @@ discard block |
||
5887 | 5887 | && |
5888 | 5888 | self::$SUPPORT['mbstring'] === false |
5889 | 5889 | ) { |
5890 | - trigger_error('UTF8::strstr() without mbstring cannot handle "' . $encoding . '" encoding', E_USER_WARNING); |
|
5890 | + trigger_error('UTF8::strstr() without mbstring cannot handle "'.$encoding.'" encoding', E_USER_WARNING); |
|
5891 | 5891 | } |
5892 | 5892 | |
5893 | 5893 | if (self::$SUPPORT['mbstring'] === true) { |
@@ -5904,7 +5904,7 @@ discard block |
||
5904 | 5904 | return \grapheme_strstr($haystack, $needle, $before_needle); |
5905 | 5905 | } |
5906 | 5906 | |
5907 | - preg_match('/^(.*?)' . preg_quote($needle, '/') . '/us', $haystack, $match); |
|
5907 | + preg_match('/^(.*?)'.preg_quote($needle, '/').'/us', $haystack, $match); |
|
5908 | 5908 | |
5909 | 5909 | if (!isset($match[1])) { |
5910 | 5910 | return false; |
@@ -6011,9 +6011,9 @@ discard block |
||
6011 | 6011 | Bootup::is_php('5.4') === true |
6012 | 6012 | ) { |
6013 | 6013 | |
6014 | - $langCode = $lang . '-Lower'; |
|
6014 | + $langCode = $lang.'-Lower'; |
|
6015 | 6015 | if (!in_array($langCode, self::$SUPPORT['intl__transliterator_list_ids'], true)) { |
6016 | - trigger_error('UTF8::strtolower() without intl for special language: ' . $lang, E_USER_WARNING); |
|
6016 | + trigger_error('UTF8::strtolower() without intl for special language: '.$lang, E_USER_WARNING); |
|
6017 | 6017 | |
6018 | 6018 | $langCode = 'Any-Lower'; |
6019 | 6019 | } |
@@ -6021,7 +6021,7 @@ discard block |
||
6021 | 6021 | return transliterator_transliterate($langCode, $str); |
6022 | 6022 | } |
6023 | 6023 | |
6024 | - trigger_error('UTF8::strtolower() without intl + PHP >= 5.4 cannot handle the "lang"-parameter: ' . $lang, E_USER_WARNING); |
|
6024 | + trigger_error('UTF8::strtolower() without intl + PHP >= 5.4 cannot handle the "lang"-parameter: '.$lang, E_USER_WARNING); |
|
6025 | 6025 | } |
6026 | 6026 | |
6027 | 6027 | return \mb_strtolower($str, $encoding); |
@@ -6081,9 +6081,9 @@ discard block |
||
6081 | 6081 | Bootup::is_php('5.4') === true |
6082 | 6082 | ) { |
6083 | 6083 | |
6084 | - $langCode = $lang . '-Upper'; |
|
6084 | + $langCode = $lang.'-Upper'; |
|
6085 | 6085 | if (!in_array($langCode, self::$SUPPORT['intl__transliterator_list_ids'], true)) { |
6086 | - trigger_error('UTF8::strtoupper() without intl for special language: ' . $lang, E_USER_WARNING); |
|
6086 | + trigger_error('UTF8::strtoupper() without intl for special language: '.$lang, E_USER_WARNING); |
|
6087 | 6087 | |
6088 | 6088 | $langCode = 'Any-Upper'; |
6089 | 6089 | } |
@@ -6091,7 +6091,7 @@ discard block |
||
6091 | 6091 | return transliterator_transliterate($langCode, $str); |
6092 | 6092 | } |
6093 | 6093 | |
6094 | - trigger_error('UTF8::strtolower() without intl + PHP >= 5.4 cannot handle the "lang"-parameter: ' . $lang, E_USER_WARNING); |
|
6094 | + trigger_error('UTF8::strtolower() without intl + PHP >= 5.4 cannot handle the "lang"-parameter: '.$lang, E_USER_WARNING); |
|
6095 | 6095 | } |
6096 | 6096 | |
6097 | 6097 | return \mb_strtoupper($str, $encoding); |
@@ -6228,7 +6228,7 @@ discard block |
||
6228 | 6228 | && |
6229 | 6229 | self::$SUPPORT['mbstring'] === false |
6230 | 6230 | ) { |
6231 | - trigger_error('UTF8::substr() without mbstring cannot handle "' . $encoding . '" encoding', E_USER_WARNING); |
|
6231 | + trigger_error('UTF8::substr() without mbstring cannot handle "'.$encoding.'" encoding', E_USER_WARNING); |
|
6232 | 6232 | } |
6233 | 6233 | |
6234 | 6234 | if (self::$SUPPORT['mbstring'] === true) { |
@@ -6374,14 +6374,14 @@ discard block |
||
6374 | 6374 | && |
6375 | 6375 | self::$SUPPORT['mbstring'] === false |
6376 | 6376 | ) { |
6377 | - trigger_error('UTF8::substr_count() without mbstring cannot handle "' . $encoding . '" encoding', E_USER_WARNING); |
|
6377 | + trigger_error('UTF8::substr_count() without mbstring cannot handle "'.$encoding.'" encoding', E_USER_WARNING); |
|
6378 | 6378 | } |
6379 | 6379 | |
6380 | 6380 | if (self::$SUPPORT['mbstring'] === true) { |
6381 | 6381 | return \mb_substr_count($haystack, $needle, $encoding); |
6382 | 6382 | } |
6383 | 6383 | |
6384 | - preg_match_all('/' . preg_quote($needle, '/') . '/us', $haystack, $matches, PREG_SET_ORDER); |
|
6384 | + preg_match_all('/'.preg_quote($needle, '/').'/us', $haystack, $matches, PREG_SET_ORDER); |
|
6385 | 6385 | |
6386 | 6386 | return count($matches); |
6387 | 6387 | } |
@@ -6643,7 +6643,7 @@ discard block |
||
6643 | 6643 | |
6644 | 6644 | $strSwappedCase = preg_replace_callback( |
6645 | 6645 | '/[\S]/u', |
6646 | - function ($match) use ($encoding) { |
|
6646 | + function($match) use ($encoding) { |
|
6647 | 6647 | $marchToUpper = UTF8::strtoupper($match[0], $encoding); |
6648 | 6648 | |
6649 | 6649 | if ($match[0] === $marchToUpper) { |
@@ -6982,13 +6982,13 @@ discard block |
||
6982 | 6982 | $c2 = $i + 1 >= $max ? "\x00" : $str[$i + 1]; |
6983 | 6983 | |
6984 | 6984 | if ($c2 >= "\x80" && $c2 <= "\xBF") { // yeah, almost sure it's UTF8 already |
6985 | - $buf .= $c1 . $c2; |
|
6985 | + $buf .= $c1.$c2; |
|
6986 | 6986 | $i++; |
6987 | 6987 | } else { // not valid UTF8 - convert it |
6988 | 6988 | $cc1tmp = ord($c1) / 64; |
6989 | 6989 | $cc1 = self::chr_and_parse_int($cc1tmp) | "\xC0"; |
6990 | 6990 | $cc2 = ($c1 & "\x3F") | "\x80"; |
6991 | - $buf .= $cc1 . $cc2; |
|
6991 | + $buf .= $cc1.$cc2; |
|
6992 | 6992 | } |
6993 | 6993 | |
6994 | 6994 | } elseif ($c1 >= "\xE0" && $c1 <= "\xEF") { // looks like 3 bytes UTF8 |
@@ -6997,13 +6997,13 @@ discard block |
||
6997 | 6997 | $c3 = $i + 2 >= $max ? "\x00" : $str[$i + 2]; |
6998 | 6998 | |
6999 | 6999 | if ($c2 >= "\x80" && $c2 <= "\xBF" && $c3 >= "\x80" && $c3 <= "\xBF") { // yeah, almost sure it's UTF8 already |
7000 | - $buf .= $c1 . $c2 . $c3; |
|
7000 | + $buf .= $c1.$c2.$c3; |
|
7001 | 7001 | $i += 2; |
7002 | 7002 | } else { // not valid UTF8 - convert it |
7003 | 7003 | $cc1tmp = ord($c1) / 64; |
7004 | 7004 | $cc1 = self::chr_and_parse_int($cc1tmp) | "\xC0"; |
7005 | 7005 | $cc2 = ($c1 & "\x3F") | "\x80"; |
7006 | - $buf .= $cc1 . $cc2; |
|
7006 | + $buf .= $cc1.$cc2; |
|
7007 | 7007 | } |
7008 | 7008 | |
7009 | 7009 | } elseif ($c1 >= "\xF0" && $c1 <= "\xF7") { // looks like 4 bytes UTF8 |
@@ -7013,20 +7013,20 @@ discard block |
||
7013 | 7013 | $c4 = $i + 3 >= $max ? "\x00" : $str[$i + 3]; |
7014 | 7014 | |
7015 | 7015 | if ($c2 >= "\x80" && $c2 <= "\xBF" && $c3 >= "\x80" && $c3 <= "\xBF" && $c4 >= "\x80" && $c4 <= "\xBF") { // yeah, almost sure it's UTF8 already |
7016 | - $buf .= $c1 . $c2 . $c3 . $c4; |
|
7016 | + $buf .= $c1.$c2.$c3.$c4; |
|
7017 | 7017 | $i += 3; |
7018 | 7018 | } else { // not valid UTF8 - convert it |
7019 | 7019 | $cc1tmp = ord($c1) / 64; |
7020 | 7020 | $cc1 = self::chr_and_parse_int($cc1tmp) | "\xC0"; |
7021 | 7021 | $cc2 = ($c1 & "\x3F") | "\x80"; |
7022 | - $buf .= $cc1 . $cc2; |
|
7022 | + $buf .= $cc1.$cc2; |
|
7023 | 7023 | } |
7024 | 7024 | |
7025 | 7025 | } else { // doesn't look like UTF8, but should be converted |
7026 | 7026 | $cc1tmp = ord($c1) / 64; |
7027 | 7027 | $cc1 = self::chr_and_parse_int($cc1tmp) | "\xC0"; |
7028 | 7028 | $cc2 = ($c1 & "\x3F") | "\x80"; |
7029 | - $buf .= $cc1 . $cc2; |
|
7029 | + $buf .= $cc1.$cc2; |
|
7030 | 7030 | } |
7031 | 7031 | |
7032 | 7032 | } elseif (($c1 & "\xC0") === "\x80") { // needs conversion |
@@ -7037,7 +7037,7 @@ discard block |
||
7037 | 7037 | } else { |
7038 | 7038 | $cc1 = self::chr_and_parse_int($ordC1 / 64) | "\xC0"; |
7039 | 7039 | $cc2 = ($c1 & "\x3F") | "\x80"; |
7040 | - $buf .= $cc1 . $cc2; |
|
7040 | + $buf .= $cc1.$cc2; |
|
7041 | 7041 | } |
7042 | 7042 | |
7043 | 7043 | } else { // it doesn't need conversion |
@@ -7048,7 +7048,7 @@ discard block |
||
7048 | 7048 | // decode unicode escape sequences |
7049 | 7049 | $buf = preg_replace_callback( |
7050 | 7050 | '/\\\\u([0-9a-f]{4})/i', |
7051 | - function ($match) { |
|
7051 | + function($match) { |
|
7052 | 7052 | return \mb_convert_encoding(pack('H*', $match[1]), 'UTF-8', 'UCS-2BE'); |
7053 | 7053 | }, |
7054 | 7054 | $buf |
@@ -7102,7 +7102,7 @@ discard block |
||
7102 | 7102 | */ |
7103 | 7103 | public static function ucfirst($str, $encoding = 'UTF-8', $cleanUtf8 = false) |
7104 | 7104 | { |
7105 | - return self::strtoupper(self::substr($str, 0, 1, $encoding, $cleanUtf8), $encoding, $cleanUtf8) . self::substr($str, 1, null, $encoding, $cleanUtf8); |
|
7105 | + return self::strtoupper(self::substr($str, 0, 1, $encoding, $cleanUtf8), $encoding, $cleanUtf8).self::substr($str, 1, null, $encoding, $cleanUtf8); |
|
7106 | 7106 | } |
7107 | 7107 | |
7108 | 7108 | /** |
@@ -7613,7 +7613,7 @@ discard block |
||
7613 | 7613 | return ''; |
7614 | 7614 | } |
7615 | 7615 | |
7616 | - preg_match('/^\s*+(?:\S++\s*+){1,' . $words . '}/u', $str, $matches); |
|
7616 | + preg_match('/^\s*+(?:\S++\s*+){1,'.$words.'}/u', $str, $matches); |
|
7617 | 7617 | |
7618 | 7618 | if ( |
7619 | 7619 | !isset($matches[0]) |
@@ -7623,7 +7623,7 @@ discard block |
||
7623 | 7623 | return $str; |
7624 | 7624 | } |
7625 | 7625 | |
7626 | - return self::rtrim($matches[0]) . $strAddOn; |
|
7626 | + return self::rtrim($matches[0]).$strAddOn; |
|
7627 | 7627 | } |
7628 | 7628 | |
7629 | 7629 | /** |
@@ -7691,7 +7691,7 @@ discard block |
||
7691 | 7691 | $strReturn .= $break; |
7692 | 7692 | } |
7693 | 7693 | |
7694 | - return $strReturn . implode('', $chars); |
|
7694 | + return $strReturn.implode('', $chars); |
|
7695 | 7695 | } |
7696 | 7696 | |
7697 | 7697 | /** |