@@ -989,16 +989,16 @@ |
||
| 989 | 989 | $str = self::chr_and_parse_int($code_point); |
| 990 | 990 | } elseif ($code_point <= 0x7FF) { |
| 991 | 991 | $str = self::chr_and_parse_int(($code_point >> 6) + 0xC0) . |
| 992 | - self::chr_and_parse_int(($code_point & 0x3F) + 0x80); |
|
| 992 | + self::chr_and_parse_int(($code_point & 0x3F) + 0x80); |
|
| 993 | 993 | } elseif ($code_point <= 0xFFFF) { |
| 994 | 994 | $str = self::chr_and_parse_int(($code_point >> 12) + 0xE0) . |
| 995 | - self::chr_and_parse_int((($code_point >> 6) & 0x3F) + 0x80) . |
|
| 996 | - self::chr_and_parse_int(($code_point & 0x3F) + 0x80); |
|
| 995 | + self::chr_and_parse_int((($code_point >> 6) & 0x3F) + 0x80) . |
|
| 996 | + self::chr_and_parse_int(($code_point & 0x3F) + 0x80); |
|
| 997 | 997 | } else { |
| 998 | 998 | $str = self::chr_and_parse_int(($code_point >> 18) + 0xF0) . |
| 999 | - self::chr_and_parse_int((($code_point >> 12) & 0x3F) + 0x80) . |
|
| 1000 | - self::chr_and_parse_int((($code_point >> 6) & 0x3F) + 0x80) . |
|
| 1001 | - self::chr_and_parse_int(($code_point & 0x3F) + 0x80); |
|
| 999 | + self::chr_and_parse_int((($code_point >> 12) & 0x3F) + 0x80) . |
|
| 1000 | + self::chr_and_parse_int((($code_point >> 6) & 0x3F) + 0x80) . |
|
| 1001 | + self::chr_and_parse_int(($code_point & 0x3F) + 0x80); |
|
| 1002 | 1002 | } |
| 1003 | 1003 | if ($encoding !== 'UTF-8') { |
| 1004 | 1004 | $str = \mb_convert_encoding($str, $encoding, 'UTF-8'); |
@@ -855,7 +855,7 @@ discard block |
||
| 855 | 855 | public static function add_bom_to_string($str) |
| 856 | 856 | { |
| 857 | 857 | if (self::string_has_bom($str) === false) { |
| 858 | - $str = self::bom() . $str; |
|
| 858 | + $str = self::bom().$str; |
|
| 859 | 859 | } |
| 860 | 860 | |
| 861 | 861 | return $str; |
@@ -980,7 +980,7 @@ discard block |
||
| 980 | 980 | |
| 981 | 981 | // use static cache, only if there is no support for "\IntlChar" |
| 982 | 982 | static $CHAR_CACHE = array(); |
| 983 | - $cacheKey = $code_point . $encoding; |
|
| 983 | + $cacheKey = $code_point.$encoding; |
|
| 984 | 984 | if (isset($CHAR_CACHE[$cacheKey]) === true) { |
| 985 | 985 | return $CHAR_CACHE[$cacheKey]; |
| 986 | 986 | } |
@@ -988,16 +988,16 @@ discard block |
||
| 988 | 988 | if ($code_point <= 0x7F) { |
| 989 | 989 | $str = self::chr_and_parse_int($code_point); |
| 990 | 990 | } elseif ($code_point <= 0x7FF) { |
| 991 | - $str = self::chr_and_parse_int(($code_point >> 6) + 0xC0) . |
|
| 991 | + $str = self::chr_and_parse_int(($code_point >> 6) + 0xC0). |
|
| 992 | 992 | self::chr_and_parse_int(($code_point & 0x3F) + 0x80); |
| 993 | 993 | } elseif ($code_point <= 0xFFFF) { |
| 994 | - $str = self::chr_and_parse_int(($code_point >> 12) + 0xE0) . |
|
| 995 | - self::chr_and_parse_int((($code_point >> 6) & 0x3F) + 0x80) . |
|
| 994 | + $str = self::chr_and_parse_int(($code_point >> 12) + 0xE0). |
|
| 995 | + self::chr_and_parse_int((($code_point >> 6) & 0x3F) + 0x80). |
|
| 996 | 996 | self::chr_and_parse_int(($code_point & 0x3F) + 0x80); |
| 997 | 997 | } else { |
| 998 | - $str = self::chr_and_parse_int(($code_point >> 18) + 0xF0) . |
|
| 999 | - self::chr_and_parse_int((($code_point >> 12) & 0x3F) + 0x80) . |
|
| 1000 | - self::chr_and_parse_int((($code_point >> 6) & 0x3F) + 0x80) . |
|
| 998 | + $str = self::chr_and_parse_int(($code_point >> 18) + 0xF0). |
|
| 999 | + self::chr_and_parse_int((($code_point >> 12) & 0x3F) + 0x80). |
|
| 1000 | + self::chr_and_parse_int((($code_point >> 6) & 0x3F) + 0x80). |
|
| 1001 | 1001 | self::chr_and_parse_int(($code_point & 0x3F) + 0x80); |
| 1002 | 1002 | } |
| 1003 | 1003 | if ($encoding !== 'UTF-8') { |
@@ -1054,7 +1054,7 @@ discard block |
||
| 1054 | 1054 | } |
| 1055 | 1055 | |
| 1056 | 1056 | return array_map( |
| 1057 | - function ($data) { |
|
| 1057 | + function($data) { |
|
| 1058 | 1058 | return self::strlen($data, '8BIT'); |
| 1059 | 1059 | }, |
| 1060 | 1060 | self::split($str) |
@@ -1296,7 +1296,7 @@ discard block |
||
| 1296 | 1296 | $flags = ENT_QUOTES; |
| 1297 | 1297 | } |
| 1298 | 1298 | |
| 1299 | - return self::html_entity_decode('&#' . $int . ';', $flags); |
|
| 1299 | + return self::html_entity_decode('&#'.$int.';', $flags); |
|
| 1300 | 1300 | } |
| 1301 | 1301 | |
| 1302 | 1302 | /** |
@@ -1374,7 +1374,7 @@ discard block |
||
| 1374 | 1374 | && |
| 1375 | 1375 | self::$SUPPORT['mbstring'] === false |
| 1376 | 1376 | ) { |
| 1377 | - trigger_error('UTF8::encode() without mbstring cannot handle "' . $encoding . '" encoding', E_USER_WARNING); |
|
| 1377 | + trigger_error('UTF8::encode() without mbstring cannot handle "'.$encoding.'" encoding', E_USER_WARNING); |
|
| 1378 | 1378 | } |
| 1379 | 1379 | |
| 1380 | 1380 | $strEncoded = \mb_convert_encoding( |
@@ -1583,7 +1583,7 @@ discard block |
||
| 1583 | 1583 | ) { |
| 1584 | 1584 | // Prevent leading combining chars |
| 1585 | 1585 | // for NFC-safe concatenations. |
| 1586 | - $var = $leading_combining . $var; |
|
| 1586 | + $var = $leading_combining.$var; |
|
| 1587 | 1587 | } |
| 1588 | 1588 | } |
| 1589 | 1589 | |
@@ -2007,7 +2007,7 @@ discard block |
||
| 2007 | 2007 | */ |
| 2008 | 2008 | private static function getData($file) |
| 2009 | 2009 | { |
| 2010 | - $file = __DIR__ . '/data/' . $file . '.php'; |
|
| 2010 | + $file = __DIR__.'/data/'.$file.'.php'; |
|
| 2011 | 2011 | if (file_exists($file)) { |
| 2012 | 2012 | /** @noinspection PhpIncludeInspection */ |
| 2013 | 2013 | return require $file; |
@@ -2152,7 +2152,7 @@ discard block |
||
| 2152 | 2152 | return implode( |
| 2153 | 2153 | '', |
| 2154 | 2154 | array_map( |
| 2155 | - function ($data) use ($keepAsciiChars, $encoding) { |
|
| 2155 | + function($data) use ($keepAsciiChars, $encoding) { |
|
| 2156 | 2156 | return self::single_chr_html_encode($data, $keepAsciiChars, $encoding); |
| 2157 | 2157 | }, |
| 2158 | 2158 | self::split($str) |
@@ -2273,7 +2273,7 @@ discard block |
||
| 2273 | 2273 | && |
| 2274 | 2274 | self::$SUPPORT['mbstring'] === false |
| 2275 | 2275 | ) { |
| 2276 | - trigger_error('UTF8::html_entity_decode() without mbstring cannot handle "' . $encoding . '" encoding', E_USER_WARNING); |
|
| 2276 | + trigger_error('UTF8::html_entity_decode() without mbstring cannot handle "'.$encoding.'" encoding', E_USER_WARNING); |
|
| 2277 | 2277 | } |
| 2278 | 2278 | |
| 2279 | 2279 | do { |
@@ -2281,7 +2281,7 @@ discard block |
||
| 2281 | 2281 | |
| 2282 | 2282 | $str = preg_replace_callback( |
| 2283 | 2283 | "/&#\d{2,6};/", |
| 2284 | - function ($matches) use ($encoding) { |
|
| 2284 | + function($matches) use ($encoding) { |
|
| 2285 | 2285 | $returnTmp = \mb_convert_encoding($matches[0], $encoding, 'HTML-ENTITIES'); |
| 2286 | 2286 | |
| 2287 | 2287 | if ($returnTmp !== '"' && $returnTmp !== "'") { |
@@ -2615,9 +2615,9 @@ discard block |
||
| 2615 | 2615 | if ((int)$int === $int) { |
| 2616 | 2616 | $hex = dechex($int); |
| 2617 | 2617 | |
| 2618 | - $hex = (strlen($hex) < 4 ? substr('0000' . $hex, -4) : $hex); |
|
| 2618 | + $hex = (strlen($hex) < 4 ? substr('0000'.$hex, -4) : $hex); |
|
| 2619 | 2619 | |
| 2620 | - return $pfix . $hex; |
|
| 2620 | + return $pfix.$hex; |
|
| 2621 | 2621 | } |
| 2622 | 2622 | |
| 2623 | 2623 | return ''; |
@@ -3358,7 +3358,7 @@ discard block |
||
| 3358 | 3358 | $cleanUtf8 |
| 3359 | 3359 | ); |
| 3360 | 3360 | |
| 3361 | - return $strPartOne . $strPartTwo; |
|
| 3361 | + return $strPartOne.$strPartTwo; |
|
| 3362 | 3362 | } |
| 3363 | 3363 | |
| 3364 | 3364 | /** |
@@ -3448,7 +3448,7 @@ discard block |
||
| 3448 | 3448 | return preg_replace('/^[\pZ\pC]+/u', '', $str); |
| 3449 | 3449 | } |
| 3450 | 3450 | |
| 3451 | - return preg_replace('/^' . self::rxClass($chars) . '+/u', '', $str); |
|
| 3451 | + return preg_replace('/^'.self::rxClass($chars).'+/u', '', $str); |
|
| 3452 | 3452 | } |
| 3453 | 3453 | |
| 3454 | 3454 | /** |
@@ -4033,7 +4033,7 @@ discard block |
||
| 4033 | 4033 | if (is_array($what) === true) { |
| 4034 | 4034 | /** @noinspection ForeachSourceInspection */ |
| 4035 | 4035 | foreach ($what as $item) { |
| 4036 | - $str = preg_replace('/(' . preg_quote($item, '/') . ')+/', $item, $str); |
|
| 4036 | + $str = preg_replace('/('.preg_quote($item, '/').')+/', $item, $str); |
|
| 4037 | 4037 | } |
| 4038 | 4038 | } |
| 4039 | 4039 | |
@@ -4141,7 +4141,7 @@ discard block |
||
| 4141 | 4141 | return preg_replace('/[\pZ\pC]+$/u', '', $str); |
| 4142 | 4142 | } |
| 4143 | 4143 | |
| 4144 | - return preg_replace('/' . self::rxClass($chars) . '+$/u', '', $str); |
|
| 4144 | + return preg_replace('/'.self::rxClass($chars).'+$/u', '', $str); |
|
| 4145 | 4145 | } |
| 4146 | 4146 | |
| 4147 | 4147 | /** |
@@ -4156,7 +4156,7 @@ discard block |
||
| 4156 | 4156 | { |
| 4157 | 4157 | static $RX_CLASSS_CACHE = array(); |
| 4158 | 4158 | |
| 4159 | - $cacheKey = $s . $class; |
|
| 4159 | + $cacheKey = $s.$class; |
|
| 4160 | 4160 | |
| 4161 | 4161 | if (isset($RX_CLASSS_CACHE[$cacheKey])) { |
| 4162 | 4162 | return $RX_CLASSS_CACHE[$cacheKey]; |
@@ -4168,7 +4168,7 @@ discard block |
||
| 4168 | 4168 | /** @noinspection SuspiciousLoopInspection */ |
| 4169 | 4169 | foreach (self::str_split($s) as $s) { |
| 4170 | 4170 | if ('-' === $s) { |
| 4171 | - $class[0] = '-' . $class[0]; |
|
| 4171 | + $class[0] = '-'.$class[0]; |
|
| 4172 | 4172 | } elseif (!isset($s[2])) { |
| 4173 | 4173 | $class[0] .= preg_quote($s, '/'); |
| 4174 | 4174 | } elseif (1 === self::strlen($s)) { |
@@ -4179,13 +4179,13 @@ discard block |
||
| 4179 | 4179 | } |
| 4180 | 4180 | |
| 4181 | 4181 | if ($class[0]) { |
| 4182 | - $class[0] = '[' . $class[0] . ']'; |
|
| 4182 | + $class[0] = '['.$class[0].']'; |
|
| 4183 | 4183 | } |
| 4184 | 4184 | |
| 4185 | 4185 | if (1 === count($class)) { |
| 4186 | 4186 | $return = $class[0]; |
| 4187 | 4187 | } else { |
| 4188 | - $return = '(?:' . implode('|', $class) . ')'; |
|
| 4188 | + $return = '(?:'.implode('|', $class).')'; |
|
| 4189 | 4189 | } |
| 4190 | 4190 | |
| 4191 | 4191 | $RX_CLASSS_CACHE[$cacheKey] = $return; |
@@ -4203,7 +4203,7 @@ discard block |
||
| 4203 | 4203 | } |
| 4204 | 4204 | |
| 4205 | 4205 | foreach (self::$SUPPORT as $utf8Support) { |
| 4206 | - echo $utf8Support . "\n<br>"; |
|
| 4206 | + echo $utf8Support."\n<br>"; |
|
| 4207 | 4207 | } |
| 4208 | 4208 | } |
| 4209 | 4209 | |
@@ -4236,7 +4236,7 @@ discard block |
||
| 4236 | 4236 | $encoding = self::normalize_encoding($encoding, 'UTF-8'); |
| 4237 | 4237 | } |
| 4238 | 4238 | |
| 4239 | - return '&#' . self::ord($char, $encoding) . ';'; |
|
| 4239 | + return '&#'.self::ord($char, $encoding).';'; |
|
| 4240 | 4240 | } |
| 4241 | 4241 | |
| 4242 | 4242 | /** |
@@ -4303,7 +4303,7 @@ discard block |
||
| 4303 | 4303 | ) { |
| 4304 | 4304 | |
| 4305 | 4305 | if (($str[$i + 1] & "\xC0") === "\x80") { |
| 4306 | - $ret[] = $str[$i] . $str[$i + 1]; |
|
| 4306 | + $ret[] = $str[$i].$str[$i + 1]; |
|
| 4307 | 4307 | |
| 4308 | 4308 | $i++; |
| 4309 | 4309 | } |
@@ -4319,7 +4319,7 @@ discard block |
||
| 4319 | 4319 | && |
| 4320 | 4320 | ($str[$i + 2] & "\xC0") === "\x80" |
| 4321 | 4321 | ) { |
| 4322 | - $ret[] = $str[$i] . $str[$i + 1] . $str[$i + 2]; |
|
| 4322 | + $ret[] = $str[$i].$str[$i + 1].$str[$i + 2]; |
|
| 4323 | 4323 | |
| 4324 | 4324 | $i += 2; |
| 4325 | 4325 | } |
@@ -4337,7 +4337,7 @@ discard block |
||
| 4337 | 4337 | && |
| 4338 | 4338 | ($str[$i + 3] & "\xC0") === "\x80" |
| 4339 | 4339 | ) { |
| 4340 | - $ret[] = $str[$i] . $str[$i + 1] . $str[$i + 2] . $str[$i + 3]; |
|
| 4340 | + $ret[] = $str[$i].$str[$i + 1].$str[$i + 2].$str[$i + 3]; |
|
| 4341 | 4341 | |
| 4342 | 4342 | $i += 3; |
| 4343 | 4343 | } |
@@ -4350,7 +4350,7 @@ discard block |
||
| 4350 | 4350 | $ret = array_chunk($ret, $length); |
| 4351 | 4351 | |
| 4352 | 4352 | return array_map( |
| 4353 | - function ($item) { |
|
| 4353 | + function($item) { |
|
| 4354 | 4354 | return implode('', $item); |
| 4355 | 4355 | }, $ret |
| 4356 | 4356 | ); |
@@ -4456,7 +4456,7 @@ discard block |
||
| 4456 | 4456 | foreach (self::$ICONV_ENCODING as $encodingTmp) { |
| 4457 | 4457 | # INFO: //IGNORE and //TRANSLIT still throw notice |
| 4458 | 4458 | /** @noinspection PhpUsageOfSilenceOperatorInspection */ |
| 4459 | - if (md5(@\iconv($encodingTmp, $encodingTmp . '//IGNORE', $str)) === $md5) { |
|
| 4459 | + if (md5(@\iconv($encodingTmp, $encodingTmp.'//IGNORE', $str)) === $md5) { |
|
| 4460 | 4460 | return $encodingTmp; |
| 4461 | 4461 | } |
| 4462 | 4462 | } |
@@ -4551,7 +4551,7 @@ discard block |
||
| 4551 | 4551 | if ('' === $s .= '') { |
| 4552 | 4552 | $s = '/^(?<=.)$/'; |
| 4553 | 4553 | } else { |
| 4554 | - $s = '/' . preg_quote($s, '/') . '/ui'; |
|
| 4554 | + $s = '/'.preg_quote($s, '/').'/ui'; |
|
| 4555 | 4555 | } |
| 4556 | 4556 | } |
| 4557 | 4557 | |
@@ -4609,7 +4609,7 @@ discard block |
||
| 4609 | 4609 | } |
| 4610 | 4610 | |
| 4611 | 4611 | if (self::substr($str, $length - 1, 1) === ' ') { |
| 4612 | - return (string)self::substr($str, 0, $length - 1) . $strAddOn; |
|
| 4612 | + return (string)self::substr($str, 0, $length - 1).$strAddOn; |
|
| 4613 | 4613 | } |
| 4614 | 4614 | |
| 4615 | 4615 | $str = (string)self::substr($str, 0, $length); |
@@ -4618,9 +4618,9 @@ discard block |
||
| 4618 | 4618 | $new_str = implode(' ', $array); |
| 4619 | 4619 | |
| 4620 | 4620 | if ($new_str === '') { |
| 4621 | - $str = (string)self::substr($str, 0, $length - 1) . $strAddOn; |
|
| 4621 | + $str = (string)self::substr($str, 0, $length - 1).$strAddOn; |
|
| 4622 | 4622 | } else { |
| 4623 | - $str = $new_str . $strAddOn; |
|
| 4623 | + $str = $new_str.$strAddOn; |
|
| 4624 | 4624 | } |
| 4625 | 4625 | |
| 4626 | 4626 | return $str; |
@@ -4675,7 +4675,7 @@ discard block |
||
| 4675 | 4675 | $pre = ''; |
| 4676 | 4676 | } |
| 4677 | 4677 | |
| 4678 | - return $pre . $str . $post; |
|
| 4678 | + return $pre.$str.$post; |
|
| 4679 | 4679 | } |
| 4680 | 4680 | |
| 4681 | 4681 | return $str; |
@@ -4825,7 +4825,7 @@ discard block |
||
| 4825 | 4825 | } |
| 4826 | 4826 | |
| 4827 | 4827 | /** @noinspection PhpInternalEntityUsedInspection */ |
| 4828 | - preg_match_all('/' . self::GRAPHEME_CLUSTER_RX . '/u', $str, $a); |
|
| 4828 | + preg_match_all('/'.self::GRAPHEME_CLUSTER_RX.'/u', $str, $a); |
|
| 4829 | 4829 | $a = $a[0]; |
| 4830 | 4830 | |
| 4831 | 4831 | if ($len === 1) { |
@@ -5061,7 +5061,7 @@ discard block |
||
| 5061 | 5061 | public static function strcmp($str1, $str2) |
| 5062 | 5062 | { |
| 5063 | 5063 | /** @noinspection PhpUndefinedClassInspection */ |
| 5064 | - return $str1 . '' === $str2 . '' ? 0 : strcmp( |
|
| 5064 | + return $str1.'' === $str2.'' ? 0 : strcmp( |
|
| 5065 | 5065 | \Normalizer::normalize($str1, \Normalizer::NFD), |
| 5066 | 5066 | \Normalizer::normalize($str2, \Normalizer::NFD) |
| 5067 | 5067 | ); |
@@ -5096,7 +5096,7 @@ discard block |
||
| 5096 | 5096 | return null; |
| 5097 | 5097 | } |
| 5098 | 5098 | |
| 5099 | - if (preg_match('/^(.*?)' . self::rxClass($charList) . '/us', $str, $length)) { |
|
| 5099 | + if (preg_match('/^(.*?)'.self::rxClass($charList).'/us', $str, $length)) { |
|
| 5100 | 5100 | /** @noinspection OffsetOperationsInspection */ |
| 5101 | 5101 | return self::strlen($length[1]); |
| 5102 | 5102 | } |
@@ -5307,7 +5307,7 @@ discard block |
||
| 5307 | 5307 | && |
| 5308 | 5308 | self::$SUPPORT['mbstring'] === false |
| 5309 | 5309 | ) { |
| 5310 | - trigger_error('UTF8::stristr() without mbstring cannot handle "' . $encoding . '" encoding', E_USER_WARNING); |
|
| 5310 | + trigger_error('UTF8::stristr() without mbstring cannot handle "'.$encoding.'" encoding', E_USER_WARNING); |
|
| 5311 | 5311 | } |
| 5312 | 5312 | |
| 5313 | 5313 | if (self::$SUPPORT['mbstring'] === true) { |
@@ -5328,7 +5328,7 @@ discard block |
||
| 5328 | 5328 | return stristr($haystack, $needle, $before_needle); |
| 5329 | 5329 | } |
| 5330 | 5330 | |
| 5331 | - preg_match('/^(.*?)' . preg_quote($needle, '/') . '/usi', $haystack, $match); |
|
| 5331 | + preg_match('/^(.*?)'.preg_quote($needle, '/').'/usi', $haystack, $match); |
|
| 5332 | 5332 | |
| 5333 | 5333 | if (!isset($match[1])) { |
| 5334 | 5334 | return false; |
@@ -5403,7 +5403,7 @@ discard block |
||
| 5403 | 5403 | && |
| 5404 | 5404 | self::$SUPPORT['iconv'] === false |
| 5405 | 5405 | ) { |
| 5406 | - trigger_error('UTF8::strlen() without mbstring / iconv cannot handle "' . $encoding . '" encoding', E_USER_WARNING); |
|
| 5406 | + trigger_error('UTF8::strlen() without mbstring / iconv cannot handle "'.$encoding.'" encoding', E_USER_WARNING); |
|
| 5407 | 5407 | } |
| 5408 | 5408 | |
| 5409 | 5409 | if ( |
@@ -5482,7 +5482,7 @@ discard block |
||
| 5482 | 5482 | */ |
| 5483 | 5483 | public static function strnatcmp($str1, $str2) |
| 5484 | 5484 | { |
| 5485 | - return $str1 . '' === $str2 . '' ? 0 : strnatcmp(self::strtonatfold($str1), self::strtonatfold($str2)); |
|
| 5485 | + return $str1.'' === $str2.'' ? 0 : strnatcmp(self::strtonatfold($str1), self::strtonatfold($str2)); |
|
| 5486 | 5486 | } |
| 5487 | 5487 | |
| 5488 | 5488 | /** |
@@ -5543,7 +5543,7 @@ discard block |
||
| 5543 | 5543 | return false; |
| 5544 | 5544 | } |
| 5545 | 5545 | |
| 5546 | - if (preg_match('/' . self::rxClass($char_list) . '/us', $haystack, $m)) { |
|
| 5546 | + if (preg_match('/'.self::rxClass($char_list).'/us', $haystack, $m)) { |
|
| 5547 | 5547 | return substr($haystack, strpos($haystack, $m[0])); |
| 5548 | 5548 | } |
| 5549 | 5549 | |
@@ -5620,7 +5620,7 @@ discard block |
||
| 5620 | 5620 | && |
| 5621 | 5621 | self::$SUPPORT['mbstring'] === false |
| 5622 | 5622 | ) { |
| 5623 | - trigger_error('UTF8::strpos() without mbstring / iconv cannot handle "' . $encoding . '" encoding', E_USER_WARNING); |
|
| 5623 | + trigger_error('UTF8::strpos() without mbstring / iconv cannot handle "'.$encoding.'" encoding', E_USER_WARNING); |
|
| 5624 | 5624 | } |
| 5625 | 5625 | |
| 5626 | 5626 | if ( |
@@ -5852,7 +5852,7 @@ discard block |
||
| 5852 | 5852 | && |
| 5853 | 5853 | self::$SUPPORT['mbstring'] === false |
| 5854 | 5854 | ) { |
| 5855 | - trigger_error('UTF8::strripos() without mbstring cannot handle "' . $encoding . '" encoding', E_USER_WARNING); |
|
| 5855 | + trigger_error('UTF8::strripos() without mbstring cannot handle "'.$encoding.'" encoding', E_USER_WARNING); |
|
| 5856 | 5856 | } |
| 5857 | 5857 | |
| 5858 | 5858 | if (self::$SUPPORT['mbstring'] === true) { |
@@ -5935,7 +5935,7 @@ discard block |
||
| 5935 | 5935 | && |
| 5936 | 5936 | self::$SUPPORT['mbstring'] === false |
| 5937 | 5937 | ) { |
| 5938 | - trigger_error('UTF8::strrpos() without mbstring cannot handle "' . $encoding . '" encoding', E_USER_WARNING); |
|
| 5938 | + trigger_error('UTF8::strrpos() without mbstring cannot handle "'.$encoding.'" encoding', E_USER_WARNING); |
|
| 5939 | 5939 | } |
| 5940 | 5940 | |
| 5941 | 5941 | if (self::$SUPPORT['mbstring'] === true) { |
@@ -6003,7 +6003,7 @@ discard block |
||
| 6003 | 6003 | return 0; |
| 6004 | 6004 | } |
| 6005 | 6005 | |
| 6006 | - return preg_match('/^' . self::rxClass($mask) . '+/u', $str, $str) ? self::strlen($str[0]) : 0; |
|
| 6006 | + return preg_match('/^'.self::rxClass($mask).'+/u', $str, $str) ? self::strlen($str[0]) : 0; |
|
| 6007 | 6007 | } |
| 6008 | 6008 | |
| 6009 | 6009 | /** |
@@ -6049,7 +6049,7 @@ discard block |
||
| 6049 | 6049 | && |
| 6050 | 6050 | self::$SUPPORT['mbstring'] === false |
| 6051 | 6051 | ) { |
| 6052 | - trigger_error('UTF8::strstr() without mbstring cannot handle "' . $encoding . '" encoding', E_USER_WARNING); |
|
| 6052 | + trigger_error('UTF8::strstr() without mbstring cannot handle "'.$encoding.'" encoding', E_USER_WARNING); |
|
| 6053 | 6053 | } |
| 6054 | 6054 | |
| 6055 | 6055 | if (self::$SUPPORT['mbstring'] === true) { |
@@ -6066,7 +6066,7 @@ discard block |
||
| 6066 | 6066 | return \grapheme_strstr($haystack, $needle, $before_needle); |
| 6067 | 6067 | } |
| 6068 | 6068 | |
| 6069 | - preg_match('/^(.*?)' . preg_quote($needle, '/') . '/us', $haystack, $match); |
|
| 6069 | + preg_match('/^(.*?)'.preg_quote($needle, '/').'/us', $haystack, $match); |
|
| 6070 | 6070 | |
| 6071 | 6071 | if (!isset($match[1])) { |
| 6072 | 6072 | return false; |
@@ -6173,9 +6173,9 @@ discard block |
||
| 6173 | 6173 | Bootup::is_php('5.4') === true |
| 6174 | 6174 | ) { |
| 6175 | 6175 | |
| 6176 | - $langCode = $lang . '-Lower'; |
|
| 6176 | + $langCode = $lang.'-Lower'; |
|
| 6177 | 6177 | if (!in_array($langCode, self::$SUPPORT['intl__transliterator_list_ids'], true)) { |
| 6178 | - trigger_error('UTF8::strtolower() without intl for special language: ' . $lang, E_USER_WARNING); |
|
| 6178 | + trigger_error('UTF8::strtolower() without intl for special language: '.$lang, E_USER_WARNING); |
|
| 6179 | 6179 | |
| 6180 | 6180 | $langCode = 'Any-Lower'; |
| 6181 | 6181 | } |
@@ -6183,7 +6183,7 @@ discard block |
||
| 6183 | 6183 | return transliterator_transliterate($langCode, $str); |
| 6184 | 6184 | } |
| 6185 | 6185 | |
| 6186 | - trigger_error('UTF8::strtolower() without intl + PHP >= 5.4 cannot handle the "lang"-parameter: ' . $lang, E_USER_WARNING); |
|
| 6186 | + trigger_error('UTF8::strtolower() without intl + PHP >= 5.4 cannot handle the "lang"-parameter: '.$lang, E_USER_WARNING); |
|
| 6187 | 6187 | } |
| 6188 | 6188 | |
| 6189 | 6189 | return \mb_strtolower($str, $encoding); |
@@ -6243,9 +6243,9 @@ discard block |
||
| 6243 | 6243 | Bootup::is_php('5.4') === true |
| 6244 | 6244 | ) { |
| 6245 | 6245 | |
| 6246 | - $langCode = $lang . '-Upper'; |
|
| 6246 | + $langCode = $lang.'-Upper'; |
|
| 6247 | 6247 | if (!in_array($langCode, self::$SUPPORT['intl__transliterator_list_ids'], true)) { |
| 6248 | - trigger_error('UTF8::strtoupper() without intl for special language: ' . $lang, E_USER_WARNING); |
|
| 6248 | + trigger_error('UTF8::strtoupper() without intl for special language: '.$lang, E_USER_WARNING); |
|
| 6249 | 6249 | |
| 6250 | 6250 | $langCode = 'Any-Upper'; |
| 6251 | 6251 | } |
@@ -6253,7 +6253,7 @@ discard block |
||
| 6253 | 6253 | return transliterator_transliterate($langCode, $str); |
| 6254 | 6254 | } |
| 6255 | 6255 | |
| 6256 | - trigger_error('UTF8::strtolower() without intl + PHP >= 5.4 cannot handle the "lang"-parameter: ' . $lang, E_USER_WARNING); |
|
| 6256 | + trigger_error('UTF8::strtolower() without intl + PHP >= 5.4 cannot handle the "lang"-parameter: '.$lang, E_USER_WARNING); |
|
| 6257 | 6257 | } |
| 6258 | 6258 | |
| 6259 | 6259 | return \mb_strtoupper($str, $encoding); |
@@ -6358,7 +6358,7 @@ discard block |
||
| 6358 | 6358 | |
| 6359 | 6359 | $return = array(); |
| 6360 | 6360 | foreach ($array as $key => $value) { |
| 6361 | - if ($case === CASE_LOWER) { |
|
| 6361 | + if ($case === CASE_LOWER) { |
|
| 6362 | 6362 | $key = self::strtolower($key); |
| 6363 | 6363 | } else { |
| 6364 | 6364 | $key = self::strtoupper($key); |
@@ -6453,7 +6453,7 @@ discard block |
||
| 6453 | 6453 | && |
| 6454 | 6454 | self::$SUPPORT['mbstring'] === false |
| 6455 | 6455 | ) { |
| 6456 | - trigger_error('UTF8::substr() without mbstring cannot handle "' . $encoding . '" encoding', E_USER_WARNING); |
|
| 6456 | + trigger_error('UTF8::substr() without mbstring cannot handle "'.$encoding.'" encoding', E_USER_WARNING); |
|
| 6457 | 6457 | } |
| 6458 | 6458 | |
| 6459 | 6459 | if (self::$SUPPORT['mbstring'] === true) { |
@@ -6480,8 +6480,7 @@ discard block |
||
| 6480 | 6480 | |
| 6481 | 6481 | if (self::is_ascii($str)) { |
| 6482 | 6482 | return ($length === null) ? |
| 6483 | - substr($str, $offset) : |
|
| 6484 | - substr($str, $offset, $length); |
|
| 6483 | + substr($str, $offset) : substr($str, $offset, $length); |
|
| 6485 | 6484 | } |
| 6486 | 6485 | |
| 6487 | 6486 | // fallback via vanilla php |
@@ -6616,14 +6615,14 @@ discard block |
||
| 6616 | 6615 | && |
| 6617 | 6616 | self::$SUPPORT['mbstring'] === false |
| 6618 | 6617 | ) { |
| 6619 | - trigger_error('UTF8::substr_count() without mbstring cannot handle "' . $encoding . '" encoding', E_USER_WARNING); |
|
| 6618 | + trigger_error('UTF8::substr_count() without mbstring cannot handle "'.$encoding.'" encoding', E_USER_WARNING); |
|
| 6620 | 6619 | } |
| 6621 | 6620 | |
| 6622 | 6621 | if (self::$SUPPORT['mbstring'] === true) { |
| 6623 | 6622 | return \mb_substr_count($haystack, $needle, $encoding); |
| 6624 | 6623 | } |
| 6625 | 6624 | |
| 6626 | - preg_match_all('/' . preg_quote($needle, '/') . '/us', $haystack, $matches, PREG_SET_ORDER); |
|
| 6625 | + preg_match_all('/'.preg_quote($needle, '/').'/us', $haystack, $matches, PREG_SET_ORDER); |
|
| 6627 | 6626 | |
| 6628 | 6627 | return count($matches); |
| 6629 | 6628 | } |
@@ -6813,8 +6812,7 @@ discard block |
||
| 6813 | 6812 | |
| 6814 | 6813 | if (self::is_ascii($str)) { |
| 6815 | 6814 | return ($length === null) ? |
| 6816 | - substr_replace($str, $replacement, $offset) : |
|
| 6817 | - substr_replace($str, $replacement, $offset, $length); |
|
| 6815 | + substr_replace($str, $replacement, $offset) : substr_replace($str, $replacement, $offset, $length); |
|
| 6818 | 6816 | } |
| 6819 | 6817 | |
| 6820 | 6818 | preg_match_all('/./us', $str, $smatches); |
@@ -6890,7 +6888,7 @@ discard block |
||
| 6890 | 6888 | |
| 6891 | 6889 | $strSwappedCase = preg_replace_callback( |
| 6892 | 6890 | '/[\S]/u', |
| 6893 | - function ($match) use ($encoding) { |
|
| 6891 | + function($match) use ($encoding) { |
|
| 6894 | 6892 | $marchToUpper = self::strtoupper($match[0], $encoding); |
| 6895 | 6893 | |
| 6896 | 6894 | if ($match[0] === $marchToUpper) { |
@@ -7233,7 +7231,7 @@ discard block |
||
| 7233 | 7231 | $c2 = $i + 1 >= $max ? "\x00" : $str[$i + 1]; |
| 7234 | 7232 | |
| 7235 | 7233 | if ($c2 >= "\x80" && $c2 <= "\xBF") { // yeah, almost sure it's UTF8 already |
| 7236 | - $buf .= $c1 . $c2; |
|
| 7234 | + $buf .= $c1.$c2; |
|
| 7237 | 7235 | $i++; |
| 7238 | 7236 | } else { // not valid UTF8 - convert it |
| 7239 | 7237 | $buf .= self::to_utf8_convert($c1); |
@@ -7245,7 +7243,7 @@ discard block |
||
| 7245 | 7243 | $c3 = $i + 2 >= $max ? "\x00" : $str[$i + 2]; |
| 7246 | 7244 | |
| 7247 | 7245 | if ($c2 >= "\x80" && $c2 <= "\xBF" && $c3 >= "\x80" && $c3 <= "\xBF") { // yeah, almost sure it's UTF8 already |
| 7248 | - $buf .= $c1 . $c2 . $c3; |
|
| 7246 | + $buf .= $c1.$c2.$c3; |
|
| 7249 | 7247 | $i += 2; |
| 7250 | 7248 | } else { // not valid UTF8 - convert it |
| 7251 | 7249 | $buf .= self::to_utf8_convert($c1); |
@@ -7258,7 +7256,7 @@ discard block |
||
| 7258 | 7256 | $c4 = $i + 3 >= $max ? "\x00" : $str[$i + 3]; |
| 7259 | 7257 | |
| 7260 | 7258 | if ($c2 >= "\x80" && $c2 <= "\xBF" && $c3 >= "\x80" && $c3 <= "\xBF" && $c4 >= "\x80" && $c4 <= "\xBF") { // yeah, almost sure it's UTF8 already |
| 7261 | - $buf .= $c1 . $c2 . $c3 . $c4; |
|
| 7259 | + $buf .= $c1.$c2.$c3.$c4; |
|
| 7262 | 7260 | $i += 3; |
| 7263 | 7261 | } else { // not valid UTF8 - convert it |
| 7264 | 7262 | $buf .= self::to_utf8_convert($c1); |
@@ -7280,7 +7278,7 @@ discard block |
||
| 7280 | 7278 | // decode unicode escape sequences |
| 7281 | 7279 | $buf = preg_replace_callback( |
| 7282 | 7280 | '/\\\\u([0-9a-f]{4})/i', |
| 7283 | - function ($match) { |
|
| 7281 | + function($match) { |
|
| 7284 | 7282 | return \mb_convert_encoding(pack('H*', $match[1]), 'UTF-8', 'UCS-2BE'); |
| 7285 | 7283 | }, |
| 7286 | 7284 | $buf |
@@ -7309,7 +7307,7 @@ discard block |
||
| 7309 | 7307 | } else { |
| 7310 | 7308 | $cc1 = self::chr_and_parse_int($ordC1 / 64) | "\xC0"; |
| 7311 | 7309 | $cc2 = ($int & "\x3F") | "\x80"; |
| 7312 | - $buf .= $cc1 . $cc2; |
|
| 7310 | + $buf .= $cc1.$cc2; |
|
| 7313 | 7311 | } |
| 7314 | 7312 | |
| 7315 | 7313 | return $buf; |
@@ -7372,7 +7370,7 @@ discard block |
||
| 7372 | 7370 | $cleanUtf8 |
| 7373 | 7371 | ); |
| 7374 | 7372 | |
| 7375 | - return $strPartOne . $strPartTwo; |
|
| 7373 | + return $strPartOne.$strPartTwo; |
|
| 7376 | 7374 | } |
| 7377 | 7375 | |
| 7378 | 7376 | /** |
@@ -7417,7 +7415,7 @@ discard block |
||
| 7417 | 7415 | $str = self::clean($str); |
| 7418 | 7416 | } |
| 7419 | 7417 | |
| 7420 | - $usePhpDefaultFunctions = !(bool)($charlist . implode('', $exceptions)); |
|
| 7418 | + $usePhpDefaultFunctions = !(bool)($charlist.implode('', $exceptions)); |
|
| 7421 | 7419 | |
| 7422 | 7420 | if ( |
| 7423 | 7421 | $usePhpDefaultFunctions === true |
@@ -7904,7 +7902,7 @@ discard block |
||
| 7904 | 7902 | return ''; |
| 7905 | 7903 | } |
| 7906 | 7904 | |
| 7907 | - preg_match('/^\s*+(?:\S++\s*+){1,' . $limit . '}/u', $str, $matches); |
|
| 7905 | + preg_match('/^\s*+(?:\S++\s*+){1,'.$limit.'}/u', $str, $matches); |
|
| 7908 | 7906 | |
| 7909 | 7907 | if ( |
| 7910 | 7908 | !isset($matches[0]) |
@@ -7914,7 +7912,7 @@ discard block |
||
| 7914 | 7912 | return $str; |
| 7915 | 7913 | } |
| 7916 | 7914 | |
| 7917 | - return self::rtrim($matches[0]) . $strAddOn; |
|
| 7915 | + return self::rtrim($matches[0]).$strAddOn; |
|
| 7918 | 7916 | } |
| 7919 | 7917 | |
| 7920 | 7918 | /** |
@@ -7982,7 +7980,7 @@ discard block |
||
| 7982 | 7980 | $strReturn .= $break; |
| 7983 | 7981 | } |
| 7984 | 7982 | |
| 7985 | - return $strReturn . implode('', $chars); |
|
| 7983 | + return $strReturn.implode('', $chars); |
|
| 7986 | 7984 | } |
| 7987 | 7985 | |
| 7988 | 7986 | /** |