@@ -2668,7 +2668,7 @@ discard block |
||
2668 | 2668 | /** |
2669 | 2669 | * Check if the input is binary... (is look like a hack). |
2670 | 2670 | * |
2671 | - * @param mixed $input |
|
2671 | + * @param string $input |
|
2672 | 2672 | * |
2673 | 2673 | * @return bool |
2674 | 2674 | */ |
@@ -5027,7 +5027,7 @@ discard block |
||
5027 | 5027 | * @param string $encoding [optional] <p>Set the charset for e.g. "\mb_" function.</p> |
5028 | 5028 | * @param boolean $cleanUtf8 [optional] <p>Clean non UTF-8 chars from the string.</p> |
5029 | 5029 | * |
5030 | - * @return int|false <p> |
|
5030 | + * @return string <p> |
|
5031 | 5031 | * The numeric position of the first occurrence of needle in the haystack string.<br /> |
5032 | 5032 | * If needle is not found it returns false. |
5033 | 5033 | * </p> |
@@ -5303,7 +5303,7 @@ discard block |
||
5303 | 5303 | * @link http://php.net/manual/en/function.mb-strrpos.php |
5304 | 5304 | * |
5305 | 5305 | * @param string $haystack <p>The string being checked, for the last occurrence of needle</p> |
5306 | - * @param string|int $needle <p>The string to find in haystack.<br />Or a code point as int.</p> |
|
5306 | + * @param string $needle <p>The string to find in haystack.<br />Or a code point as int.</p> |
|
5307 | 5307 | * @param int $offset [optional] <p>May be specified to begin searching an arbitrary number of characters |
5308 | 5308 | * into the string. Negative values will stop searching at an arbitrary point prior to |
5309 | 5309 | * the end of the string. |
@@ -6388,7 +6388,7 @@ discard block |
||
6388 | 6388 | * 2) when any of these: àáâãäåæçèéêëìíîï are followed by TWO chars from group B, |
6389 | 6389 | * 3) when any of these: ðñòó are followed by THREE chars from group B. |
6390 | 6390 | * |
6391 | - * @param string|string[] $str <p>Any string or array.</p> |
|
6391 | + * @param string $str <p>Any string or array.</p> |
|
6392 | 6392 | * @param bool $decodeHtmlEntityToUtf8 <p>Set to true, if you need to decode html-entities.</p> |
6393 | 6393 | * |
6394 | 6394 | * @return string|string[] <p>The UTF-8 encoded string.</p> |
@@ -839,7 +839,7 @@ discard block |
||
839 | 839 | public static function add_bom_to_string($str) |
840 | 840 | { |
841 | 841 | if (self::string_has_bom($str) === false) { |
842 | - $str = self::bom() . $str; |
|
842 | + $str = self::bom().$str; |
|
843 | 843 | } |
844 | 844 | |
845 | 845 | return $str; |
@@ -939,7 +939,7 @@ discard block |
||
939 | 939 | |
940 | 940 | // use static cache, if there is no support for "IntlChar" |
941 | 941 | static $cache = array(); |
942 | - $cacheKey = $code_point . $encoding; |
|
942 | + $cacheKey = $code_point.$encoding; |
|
943 | 943 | if (isset($cache[$cacheKey]) === true) { |
944 | 944 | return $cache[$cacheKey]; |
945 | 945 | } |
@@ -947,16 +947,16 @@ discard block |
||
947 | 947 | if (0x80 > $code_point %= 0x200000) { |
948 | 948 | $str = chr($code_point); |
949 | 949 | } elseif (0x800 > $code_point) { |
950 | - $str = chr(0xC0 | $code_point >> 6) . |
|
950 | + $str = chr(0xC0 | $code_point >> 6). |
|
951 | 951 | chr(0x80 | $code_point & 0x3F); |
952 | 952 | } elseif (0x10000 > $code_point) { |
953 | - $str = chr(0xE0 | $code_point >> 12) . |
|
954 | - chr(0x80 | $code_point >> 6 & 0x3F) . |
|
953 | + $str = chr(0xE0 | $code_point >> 12). |
|
954 | + chr(0x80 | $code_point >> 6 & 0x3F). |
|
955 | 955 | chr(0x80 | $code_point & 0x3F); |
956 | 956 | } else { |
957 | - $str = chr(0xF0 | $code_point >> 18) . |
|
958 | - chr(0x80 | $code_point >> 12 & 0x3F) . |
|
959 | - chr(0x80 | $code_point >> 6 & 0x3F) . |
|
957 | + $str = chr(0xF0 | $code_point >> 18). |
|
958 | + chr(0x80 | $code_point >> 12 & 0x3F). |
|
959 | + chr(0x80 | $code_point >> 6 & 0x3F). |
|
960 | 960 | chr(0x80 | $code_point & 0x3F); |
961 | 961 | } |
962 | 962 | |
@@ -1216,7 +1216,7 @@ discard block |
||
1216 | 1216 | public static function decimal_to_chr($code) |
1217 | 1217 | { |
1218 | 1218 | return \mb_convert_encoding( |
1219 | - '&#x' . dechex($code) . ';', |
|
1219 | + '&#x'.dechex($code).';', |
|
1220 | 1220 | 'UTF-8', |
1221 | 1221 | 'HTML-ENTITIES' |
1222 | 1222 | ); |
@@ -1296,7 +1296,7 @@ discard block |
||
1296 | 1296 | && |
1297 | 1297 | self::$support['mbstring'] === false |
1298 | 1298 | ) { |
1299 | - trigger_error('UTF8::encode() without mbstring cannot handle "' . $encoding . '" encoding', E_USER_WARNING); |
|
1299 | + trigger_error('UTF8::encode() without mbstring cannot handle "'.$encoding.'" encoding', E_USER_WARNING); |
|
1300 | 1300 | } |
1301 | 1301 | |
1302 | 1302 | $strEncoded = \mb_convert_encoding( |
@@ -1496,7 +1496,7 @@ discard block |
||
1496 | 1496 | ) { |
1497 | 1497 | // Prevent leading combining chars |
1498 | 1498 | // for NFC-safe concatenations. |
1499 | - $var = $leading_combining . $var; |
|
1499 | + $var = $leading_combining.$var; |
|
1500 | 1500 | } |
1501 | 1501 | } |
1502 | 1502 | break; |
@@ -1916,7 +1916,7 @@ discard block |
||
1916 | 1916 | */ |
1917 | 1917 | private static function getData($file) |
1918 | 1918 | { |
1919 | - $file = __DIR__ . '/data/' . $file . '.php'; |
|
1919 | + $file = __DIR__.'/data/'.$file.'.php'; |
|
1920 | 1920 | if (file_exists($file)) { |
1921 | 1921 | /** @noinspection PhpIncludeInspection */ |
1922 | 1922 | return require $file; |
@@ -2021,7 +2021,7 @@ discard block |
||
2021 | 2021 | return implode( |
2022 | 2022 | '', |
2023 | 2023 | array_map( |
2024 | - function ($data) use ($keepAsciiChars, $encoding) { |
|
2024 | + function($data) use ($keepAsciiChars, $encoding) { |
|
2025 | 2025 | return UTF8::single_chr_html_encode($data, $keepAsciiChars, $encoding); |
2026 | 2026 | }, |
2027 | 2027 | self::split($str) |
@@ -2140,7 +2140,7 @@ discard block |
||
2140 | 2140 | |
2141 | 2141 | $str = preg_replace_callback( |
2142 | 2142 | "/&#\d{2,6};/", |
2143 | - function ($matches) use ($encoding) { |
|
2143 | + function($matches) use ($encoding) { |
|
2144 | 2144 | $returnTmp = \mb_convert_encoding($matches[0], $encoding, 'HTML-ENTITIES'); |
2145 | 2145 | |
2146 | 2146 | if ($returnTmp !== '"' && $returnTmp !== "'") { |
@@ -2449,9 +2449,9 @@ discard block |
||
2449 | 2449 | if (ctype_digit((string)$int)) { |
2450 | 2450 | $hex = dechex((int)$int); |
2451 | 2451 | |
2452 | - $hex = (strlen($hex) < 4 ? substr('0000' . $hex, -4) : $hex); |
|
2452 | + $hex = (strlen($hex) < 4 ? substr('0000'.$hex, -4) : $hex); |
|
2453 | 2453 | |
2454 | - return $pfix . $hex; |
|
2454 | + return $pfix.$hex; |
|
2455 | 2455 | } |
2456 | 2456 | |
2457 | 2457 | return ''; |
@@ -3155,7 +3155,7 @@ discard block |
||
3155 | 3155 | */ |
3156 | 3156 | public static function lcfirst($str) |
3157 | 3157 | { |
3158 | - return self::strtolower(self::substr($str, 0, 1)) . self::substr($str, 1); |
|
3158 | + return self::strtolower(self::substr($str, 0, 1)).self::substr($str, 1); |
|
3159 | 3159 | } |
3160 | 3160 | |
3161 | 3161 | /** |
@@ -3179,7 +3179,7 @@ discard block |
||
3179 | 3179 | return preg_replace('/^[\pZ\pC]+/u', '', $str); |
3180 | 3180 | } |
3181 | 3181 | |
3182 | - return preg_replace('/^' . self::rxClass($chars) . '+/u', '', $str); |
|
3182 | + return preg_replace('/^'.self::rxClass($chars).'+/u', '', $str); |
|
3183 | 3183 | } |
3184 | 3184 | |
3185 | 3185 | /** |
@@ -3680,7 +3680,7 @@ discard block |
||
3680 | 3680 | if (is_array($what)) { |
3681 | 3681 | /** @noinspection ForeachSourceInspection */ |
3682 | 3682 | foreach ($what as $item) { |
3683 | - $str = preg_replace('/(' . preg_quote($item, '/') . ')+/', $item, $str); |
|
3683 | + $str = preg_replace('/('.preg_quote($item, '/').')+/', $item, $str); |
|
3684 | 3684 | } |
3685 | 3685 | } |
3686 | 3686 | |
@@ -3765,7 +3765,7 @@ discard block |
||
3765 | 3765 | return preg_replace('/[\pZ\pC]+$/u', '', $str); |
3766 | 3766 | } |
3767 | 3767 | |
3768 | - return preg_replace('/' . self::rxClass($chars) . '+$/u', '', $str); |
|
3768 | + return preg_replace('/'.self::rxClass($chars).'+$/u', '', $str); |
|
3769 | 3769 | } |
3770 | 3770 | |
3771 | 3771 | /** |
@@ -3780,7 +3780,7 @@ discard block |
||
3780 | 3780 | { |
3781 | 3781 | static $rxClassCache = array(); |
3782 | 3782 | |
3783 | - $cacheKey = $s . $class; |
|
3783 | + $cacheKey = $s.$class; |
|
3784 | 3784 | |
3785 | 3785 | if (isset($rxClassCache[$cacheKey])) { |
3786 | 3786 | return $rxClassCache[$cacheKey]; |
@@ -3792,7 +3792,7 @@ discard block |
||
3792 | 3792 | /** @noinspection SuspiciousLoopInspection */ |
3793 | 3793 | foreach (self::str_split($s) as $s) { |
3794 | 3794 | if ('-' === $s) { |
3795 | - $class[0] = '-' . $class[0]; |
|
3795 | + $class[0] = '-'.$class[0]; |
|
3796 | 3796 | } elseif (!isset($s[2])) { |
3797 | 3797 | $class[0] .= preg_quote($s, '/'); |
3798 | 3798 | } elseif (1 === self::strlen($s)) { |
@@ -3803,13 +3803,13 @@ discard block |
||
3803 | 3803 | } |
3804 | 3804 | |
3805 | 3805 | if ($class[0]) { |
3806 | - $class[0] = '[' . $class[0] . ']'; |
|
3806 | + $class[0] = '['.$class[0].']'; |
|
3807 | 3807 | } |
3808 | 3808 | |
3809 | 3809 | if (1 === count($class)) { |
3810 | 3810 | $return = $class[0]; |
3811 | 3811 | } else { |
3812 | - $return = '(?:' . implode('|', $class) . ')'; |
|
3812 | + $return = '(?:'.implode('|', $class).')'; |
|
3813 | 3813 | } |
3814 | 3814 | |
3815 | 3815 | $rxClassCache[$cacheKey] = $return; |
@@ -3827,7 +3827,7 @@ discard block |
||
3827 | 3827 | } |
3828 | 3828 | |
3829 | 3829 | foreach (self::$support as $utf8Support) { |
3830 | - echo $utf8Support . "\n<br>"; |
|
3830 | + echo $utf8Support."\n<br>"; |
|
3831 | 3831 | } |
3832 | 3832 | } |
3833 | 3833 | |
@@ -3861,7 +3861,7 @@ discard block |
||
3861 | 3861 | $encoding = self::normalize_encoding($encoding); |
3862 | 3862 | } |
3863 | 3863 | |
3864 | - return '&#' . self::ord($char, $encoding) . ';'; |
|
3864 | + return '&#'.self::ord($char, $encoding).';'; |
|
3865 | 3865 | } |
3866 | 3866 | |
3867 | 3867 | /** |
@@ -3913,19 +3913,19 @@ discard block |
||
3913 | 3913 | $ret[] = $str[$i]; |
3914 | 3914 | } elseif ((($str[$i] & "\xE0") === "\xC0") && isset($str[$i + 1])) { |
3915 | 3915 | if (($str[$i + 1] & "\xC0") === "\x80") { |
3916 | - $ret[] = $str[$i] . $str[$i + 1]; |
|
3916 | + $ret[] = $str[$i].$str[$i + 1]; |
|
3917 | 3917 | |
3918 | 3918 | $i++; |
3919 | 3919 | } |
3920 | 3920 | } elseif ((($str[$i] & "\xF0") === "\xE0") && isset($str[$i + 2])) { |
3921 | 3921 | if ((($str[$i + 1] & "\xC0") === "\x80") && (($str[$i + 2] & "\xC0") === "\x80")) { |
3922 | - $ret[] = $str[$i] . $str[$i + 1] . $str[$i + 2]; |
|
3922 | + $ret[] = $str[$i].$str[$i + 1].$str[$i + 2]; |
|
3923 | 3923 | |
3924 | 3924 | $i += 2; |
3925 | 3925 | } |
3926 | 3926 | } elseif ((($str[$i] & "\xF8") === "\xF0") && isset($str[$i + 3])) { |
3927 | 3927 | if ((($str[$i + 1] & "\xC0") === "\x80") && (($str[$i + 2] & "\xC0") === "\x80") && (($str[$i + 3] & "\xC0") === "\x80")) { |
3928 | - $ret[] = $str[$i] . $str[$i + 1] . $str[$i + 2] . $str[$i + 3]; |
|
3928 | + $ret[] = $str[$i].$str[$i + 1].$str[$i + 2].$str[$i + 3]; |
|
3929 | 3929 | |
3930 | 3930 | $i += 3; |
3931 | 3931 | } |
@@ -3937,7 +3937,7 @@ discard block |
||
3937 | 3937 | $ret = array_chunk($ret, $length); |
3938 | 3938 | |
3939 | 3939 | return array_map( |
3940 | - function ($item) { |
|
3940 | + function($item) { |
|
3941 | 3941 | return implode('', $item); |
3942 | 3942 | }, $ret |
3943 | 3943 | ); |
@@ -4036,7 +4036,7 @@ discard block |
||
4036 | 4036 | foreach (self::$iconvEncoding as $encodingTmp) { |
4037 | 4037 | # INFO: //IGNORE and //TRANSLIT still throw notice |
4038 | 4038 | /** @noinspection PhpUsageOfSilenceOperatorInspection */ |
4039 | - if (md5(@\iconv($encodingTmp, $encodingTmp . '//IGNORE', $str)) === $md5) { |
|
4039 | + if (md5(@\iconv($encodingTmp, $encodingTmp.'//IGNORE', $str)) === $md5) { |
|
4040 | 4040 | return $encodingTmp; |
4041 | 4041 | } |
4042 | 4042 | } |
@@ -4126,7 +4126,7 @@ discard block |
||
4126 | 4126 | if ('' === $s .= '') { |
4127 | 4127 | $s = '/^(?<=.)$/'; |
4128 | 4128 | } else { |
4129 | - $s = '/' . preg_quote($s, '/') . '/ui'; |
|
4129 | + $s = '/'.preg_quote($s, '/').'/ui'; |
|
4130 | 4130 | } |
4131 | 4131 | } |
4132 | 4132 | |
@@ -4184,7 +4184,7 @@ discard block |
||
4184 | 4184 | } |
4185 | 4185 | |
4186 | 4186 | if (self::substr($str, $length - 1, 1) === ' ') { |
4187 | - return self::substr($str, 0, $length - 1) . $strAddOn; |
|
4187 | + return self::substr($str, 0, $length - 1).$strAddOn; |
|
4188 | 4188 | } |
4189 | 4189 | |
4190 | 4190 | $str = self::substr($str, 0, $length); |
@@ -4193,9 +4193,9 @@ discard block |
||
4193 | 4193 | $new_str = implode(' ', $array); |
4194 | 4194 | |
4195 | 4195 | if ($new_str === '') { |
4196 | - $str = self::substr($str, 0, $length - 1) . $strAddOn; |
|
4196 | + $str = self::substr($str, 0, $length - 1).$strAddOn; |
|
4197 | 4197 | } else { |
4198 | - $str = $new_str . $strAddOn; |
|
4198 | + $str = $new_str.$strAddOn; |
|
4199 | 4199 | } |
4200 | 4200 | |
4201 | 4201 | return $str; |
@@ -4250,7 +4250,7 @@ discard block |
||
4250 | 4250 | $pre = ''; |
4251 | 4251 | } |
4252 | 4252 | |
4253 | - return $pre . $str . $post; |
|
4253 | + return $pre.$str.$post; |
|
4254 | 4254 | } |
4255 | 4255 | |
4256 | 4256 | return $str; |
@@ -4380,7 +4380,7 @@ discard block |
||
4380 | 4380 | } |
4381 | 4381 | |
4382 | 4382 | /** @noinspection PhpInternalEntityUsedInspection */ |
4383 | - preg_match_all('/' . Grapheme::GRAPHEME_CLUSTER_RX . '/u', $str, $a); |
|
4383 | + preg_match_all('/'.Grapheme::GRAPHEME_CLUSTER_RX.'/u', $str, $a); |
|
4384 | 4384 | $a = $a[0]; |
4385 | 4385 | |
4386 | 4386 | if ($len === 1) { |
@@ -4574,7 +4574,7 @@ discard block |
||
4574 | 4574 | public static function strcmp($str1, $str2) |
4575 | 4575 | { |
4576 | 4576 | /** @noinspection PhpUndefinedClassInspection */ |
4577 | - return $str1 . '' === $str2 . '' ? 0 : strcmp( |
|
4577 | + return $str1.'' === $str2.'' ? 0 : strcmp( |
|
4578 | 4578 | \Normalizer::normalize($str1, \Normalizer::NFD), |
4579 | 4579 | \Normalizer::normalize($str2, \Normalizer::NFD) |
4580 | 4580 | ); |
@@ -4605,7 +4605,7 @@ discard block |
||
4605 | 4605 | return null; |
4606 | 4606 | } |
4607 | 4607 | |
4608 | - if (preg_match('/^(.*?)' . self::rxClass($charList) . '/us', $str, $length)) { |
|
4608 | + if (preg_match('/^(.*?)'.self::rxClass($charList).'/us', $str, $length)) { |
|
4609 | 4609 | /** @noinspection OffsetOperationsInspection */ |
4610 | 4610 | return self::strlen($length[1]); |
4611 | 4611 | } |
@@ -4810,7 +4810,7 @@ discard block |
||
4810 | 4810 | && |
4811 | 4811 | self::$support['mbstring'] === false |
4812 | 4812 | ) { |
4813 | - trigger_error('UTF8::stristr() without mbstring cannot handle "' . $encoding . '" encoding', E_USER_WARNING); |
|
4813 | + trigger_error('UTF8::stristr() without mbstring cannot handle "'.$encoding.'" encoding', E_USER_WARNING); |
|
4814 | 4814 | } |
4815 | 4815 | |
4816 | 4816 | if (self::$support['mbstring'] === true) { |
@@ -4821,7 +4821,7 @@ discard block |
||
4821 | 4821 | return \grapheme_stristr($haystack, $needle, $before_needle); |
4822 | 4822 | } |
4823 | 4823 | |
4824 | - preg_match('/^(.*?)' . preg_quote($needle, '/') . '/usi', $haystack, $match); |
|
4824 | + preg_match('/^(.*?)'.preg_quote($needle, '/').'/usi', $haystack, $match); |
|
4825 | 4825 | |
4826 | 4826 | if (!isset($match[1])) { |
4827 | 4827 | return false; |
@@ -4883,7 +4883,7 @@ discard block |
||
4883 | 4883 | && |
4884 | 4884 | self::$support['mbstring'] === false |
4885 | 4885 | ) { |
4886 | - trigger_error('UTF8::strlen() without mbstring cannot handle "' . $encoding . '" encoding', E_USER_WARNING); |
|
4886 | + trigger_error('UTF8::strlen() without mbstring cannot handle "'.$encoding.'" encoding', E_USER_WARNING); |
|
4887 | 4887 | } |
4888 | 4888 | |
4889 | 4889 | if (self::$support['mbstring'] === true) { |
@@ -4948,7 +4948,7 @@ discard block |
||
4948 | 4948 | */ |
4949 | 4949 | public static function strnatcmp($str1, $str2) |
4950 | 4950 | { |
4951 | - return $str1 . '' === $str2 . '' ? 0 : strnatcmp(self::strtonatfold($str1), self::strtonatfold($str2)); |
|
4951 | + return $str1.'' === $str2.'' ? 0 : strnatcmp(self::strtonatfold($str1), self::strtonatfold($str2)); |
|
4952 | 4952 | } |
4953 | 4953 | |
4954 | 4954 | /** |
@@ -5009,7 +5009,7 @@ discard block |
||
5009 | 5009 | return false; |
5010 | 5010 | } |
5011 | 5011 | |
5012 | - if (preg_match('/' . self::rxClass($char_list) . '/us', $haystack, $m)) { |
|
5012 | + if (preg_match('/'.self::rxClass($char_list).'/us', $haystack, $m)) { |
|
5013 | 5013 | return substr($haystack, strpos($haystack, $m[0])); |
5014 | 5014 | } else { |
5015 | 5015 | return false; |
@@ -5076,7 +5076,7 @@ discard block |
||
5076 | 5076 | && |
5077 | 5077 | self::$support['mbstring'] === false |
5078 | 5078 | ) { |
5079 | - trigger_error('UTF8::strpos() without mbstring cannot handle "' . $encoding . '" encoding', E_USER_WARNING); |
|
5079 | + trigger_error('UTF8::strpos() without mbstring cannot handle "'.$encoding.'" encoding', E_USER_WARNING); |
|
5080 | 5080 | } |
5081 | 5081 | |
5082 | 5082 | if (self::$support['mbstring'] === true) { |
@@ -5278,7 +5278,7 @@ discard block |
||
5278 | 5278 | && |
5279 | 5279 | self::$support['mbstring'] === false |
5280 | 5280 | ) { |
5281 | - trigger_error('UTF8::strripos() without mbstring cannot handle "' . $encoding . '" encoding', E_USER_WARNING); |
|
5281 | + trigger_error('UTF8::strripos() without mbstring cannot handle "'.$encoding.'" encoding', E_USER_WARNING); |
|
5282 | 5282 | } |
5283 | 5283 | |
5284 | 5284 | if (self::$support['mbstring'] === true) { |
@@ -5359,7 +5359,7 @@ discard block |
||
5359 | 5359 | && |
5360 | 5360 | self::$support['mbstring'] === false |
5361 | 5361 | ) { |
5362 | - trigger_error('UTF8::strrpos() without mbstring cannot handle "' . $encoding . '" encoding', E_USER_WARNING); |
|
5362 | + trigger_error('UTF8::strrpos() without mbstring cannot handle "'.$encoding.'" encoding', E_USER_WARNING); |
|
5363 | 5363 | } |
5364 | 5364 | |
5365 | 5365 | if (self::$support['mbstring'] === true) { |
@@ -5419,7 +5419,7 @@ discard block |
||
5419 | 5419 | return 0; |
5420 | 5420 | } |
5421 | 5421 | |
5422 | - return preg_match('/^' . self::rxClass($mask) . '+/u', $str, $str) ? self::strlen($str[0]) : 0; |
|
5422 | + return preg_match('/^'.self::rxClass($mask).'+/u', $str, $str) ? self::strlen($str[0]) : 0; |
|
5423 | 5423 | } |
5424 | 5424 | |
5425 | 5425 | /** |
@@ -5465,7 +5465,7 @@ discard block |
||
5465 | 5465 | && |
5466 | 5466 | self::$support['mbstring'] === false |
5467 | 5467 | ) { |
5468 | - trigger_error('UTF8::strstr() without mbstring cannot handle "' . $encoding . '" encoding', E_USER_WARNING); |
|
5468 | + trigger_error('UTF8::strstr() without mbstring cannot handle "'.$encoding.'" encoding', E_USER_WARNING); |
|
5469 | 5469 | } |
5470 | 5470 | |
5471 | 5471 | if (self::$support['mbstring'] === true) { |
@@ -5482,7 +5482,7 @@ discard block |
||
5482 | 5482 | } |
5483 | 5483 | } |
5484 | 5484 | |
5485 | - preg_match('/^(.*?)' . preg_quote($needle, '/') . '/us', $haystack, $match); |
|
5485 | + preg_match('/^(.*?)'.preg_quote($needle, '/').'/us', $haystack, $match); |
|
5486 | 5486 | |
5487 | 5487 | if (!isset($match[1])) { |
5488 | 5488 | return false; |
@@ -5748,7 +5748,7 @@ discard block |
||
5748 | 5748 | && |
5749 | 5749 | self::$support['mbstring'] === false |
5750 | 5750 | ) { |
5751 | - trigger_error('UTF8::substr() without mbstring cannot handle "' . $encoding . '" encoding', E_USER_WARNING); |
|
5751 | + trigger_error('UTF8::substr() without mbstring cannot handle "'.$encoding.'" encoding', E_USER_WARNING); |
|
5752 | 5752 | } |
5753 | 5753 | |
5754 | 5754 | if (self::$support['mbstring'] === true) { |
@@ -5861,14 +5861,14 @@ discard block |
||
5861 | 5861 | && |
5862 | 5862 | self::$support['mbstring'] === false |
5863 | 5863 | ) { |
5864 | - trigger_error('UTF8::substr_count() without mbstring cannot handle "' . $encoding . '" encoding', E_USER_WARNING); |
|
5864 | + trigger_error('UTF8::substr_count() without mbstring cannot handle "'.$encoding.'" encoding', E_USER_WARNING); |
|
5865 | 5865 | } |
5866 | 5866 | |
5867 | 5867 | if (self::$support['mbstring'] === true) { |
5868 | 5868 | return \mb_substr_count($haystack, $needle, $encoding); |
5869 | 5869 | } |
5870 | 5870 | |
5871 | - preg_match_all('/' . preg_quote($needle, '/') . '/us', $haystack, $matches, PREG_SET_ORDER); |
|
5871 | + preg_match_all('/'.preg_quote($needle, '/').'/us', $haystack, $matches, PREG_SET_ORDER); |
|
5872 | 5872 | |
5873 | 5873 | return count($matches); |
5874 | 5874 | } |
@@ -6115,7 +6115,7 @@ discard block |
||
6115 | 6115 | |
6116 | 6116 | $strSwappedCase = preg_replace_callback( |
6117 | 6117 | '/[\S]/u', |
6118 | - function ($match) use ($encoding) { |
|
6118 | + function($match) use ($encoding) { |
|
6119 | 6119 | $marchToUpper = UTF8::strtoupper($match[0], $encoding); |
6120 | 6120 | |
6121 | 6121 | if ($match[0] === $marchToUpper) { |
@@ -6305,7 +6305,7 @@ discard block |
||
6305 | 6305 | |
6306 | 6306 | $bank = $ord >> 8; |
6307 | 6307 | if (!array_key_exists($bank, (array)$UTF8_TO_ASCII)) { |
6308 | - $bankfile = __DIR__ . '/data/' . sprintf('x%02x', $bank) . '.php'; |
|
6308 | + $bankfile = __DIR__.'/data/'.sprintf('x%02x', $bank).'.php'; |
|
6309 | 6309 | if (file_exists($bankfile)) { |
6310 | 6310 | /** @noinspection PhpIncludeInspection */ |
6311 | 6311 | require $bankfile; |
@@ -6427,40 +6427,40 @@ discard block |
||
6427 | 6427 | if ($c1 >= "\xc0" & $c1 <= "\xdf") { // looks like 2 bytes UTF8 |
6428 | 6428 | |
6429 | 6429 | if ($c2 >= "\x80" && $c2 <= "\xbf") { // yeah, almost sure it's UTF8 already |
6430 | - $buf .= $c1 . $c2; |
|
6430 | + $buf .= $c1.$c2; |
|
6431 | 6431 | $i++; |
6432 | 6432 | } else { // not valid UTF8 - convert it |
6433 | 6433 | $cc1 = (chr(ord($c1) / 64) | "\xc0"); |
6434 | 6434 | $cc2 = ($c1 & "\x3f") | "\x80"; |
6435 | - $buf .= $cc1 . $cc2; |
|
6435 | + $buf .= $cc1.$cc2; |
|
6436 | 6436 | } |
6437 | 6437 | |
6438 | 6438 | } elseif ($c1 >= "\xe0" & $c1 <= "\xef") { // looks like 3 bytes UTF8 |
6439 | 6439 | |
6440 | 6440 | if ($c2 >= "\x80" && $c2 <= "\xbf" && $c3 >= "\x80" && $c3 <= "\xbf") { // yeah, almost sure it's UTF8 already |
6441 | - $buf .= $c1 . $c2 . $c3; |
|
6441 | + $buf .= $c1.$c2.$c3; |
|
6442 | 6442 | $i += 2; |
6443 | 6443 | } else { // not valid UTF8 - convert it |
6444 | 6444 | $cc1 = (chr(ord($c1) / 64) | "\xc0"); |
6445 | 6445 | $cc2 = ($c1 & "\x3f") | "\x80"; |
6446 | - $buf .= $cc1 . $cc2; |
|
6446 | + $buf .= $cc1.$cc2; |
|
6447 | 6447 | } |
6448 | 6448 | |
6449 | 6449 | } elseif ($c1 >= "\xf0" & $c1 <= "\xf7") { // looks like 4 bytes UTF8 |
6450 | 6450 | |
6451 | 6451 | if ($c2 >= "\x80" && $c2 <= "\xbf" && $c3 >= "\x80" && $c3 <= "\xbf" && $c4 >= "\x80" && $c4 <= "\xbf") { // yeah, almost sure it's UTF8 already |
6452 | - $buf .= $c1 . $c2 . $c3 . $c4; |
|
6452 | + $buf .= $c1.$c2.$c3.$c4; |
|
6453 | 6453 | $i += 3; |
6454 | 6454 | } else { // not valid UTF8 - convert it |
6455 | 6455 | $cc1 = (chr(ord($c1) / 64) | "\xc0"); |
6456 | 6456 | $cc2 = ($c1 & "\x3f") | "\x80"; |
6457 | - $buf .= $cc1 . $cc2; |
|
6457 | + $buf .= $cc1.$cc2; |
|
6458 | 6458 | } |
6459 | 6459 | |
6460 | 6460 | } else { // doesn't look like UTF8, but should be converted |
6461 | 6461 | $cc1 = (chr(ord($c1) / 64) | "\xc0"); |
6462 | 6462 | $cc2 = (($c1 & "\x3f") | "\x80"); |
6463 | - $buf .= $cc1 . $cc2; |
|
6463 | + $buf .= $cc1.$cc2; |
|
6464 | 6464 | } |
6465 | 6465 | |
6466 | 6466 | } elseif (($c1 & "\xc0") === "\x80") { // needs conversion |
@@ -6471,7 +6471,7 @@ discard block |
||
6471 | 6471 | } else { |
6472 | 6472 | $cc1 = (chr($ordC1 / 64) | "\xc0"); |
6473 | 6473 | $cc2 = (($c1 & "\x3f") | "\x80"); |
6474 | - $buf .= $cc1 . $cc2; |
|
6474 | + $buf .= $cc1.$cc2; |
|
6475 | 6475 | } |
6476 | 6476 | |
6477 | 6477 | } else { // it doesn't need conversion |
@@ -6482,7 +6482,7 @@ discard block |
||
6482 | 6482 | // decode unicode escape sequences |
6483 | 6483 | $buf = preg_replace_callback( |
6484 | 6484 | '/\\\\u([0-9a-f]{4})/i', |
6485 | - function ($match) { |
|
6485 | + function($match) { |
|
6486 | 6486 | return \mb_convert_encoding(pack('H*', $match[1]), 'UTF-8', 'UCS-2BE'); |
6487 | 6487 | }, |
6488 | 6488 | $buf |
@@ -6536,7 +6536,7 @@ discard block |
||
6536 | 6536 | */ |
6537 | 6537 | public static function ucfirst($str, $encoding = 'UTF-8', $cleanUtf8 = false) |
6538 | 6538 | { |
6539 | - return self::strtoupper(self::substr($str, 0, 1, $encoding, $cleanUtf8), $encoding, $cleanUtf8) . self::substr($str, 1, null, $encoding, $cleanUtf8); |
|
6539 | + return self::strtoupper(self::substr($str, 0, 1, $encoding, $cleanUtf8), $encoding, $cleanUtf8).self::substr($str, 1, null, $encoding, $cleanUtf8); |
|
6540 | 6540 | } |
6541 | 6541 | |
6542 | 6542 | /** |
@@ -7013,7 +7013,7 @@ discard block |
||
7013 | 7013 | return ''; |
7014 | 7014 | } |
7015 | 7015 | |
7016 | - preg_match('/^\s*+(?:\S++\s*+){1,' . $words . '}/u', $str, $matches); |
|
7016 | + preg_match('/^\s*+(?:\S++\s*+){1,'.$words.'}/u', $str, $matches); |
|
7017 | 7017 | |
7018 | 7018 | if ( |
7019 | 7019 | !isset($matches[0]) |
@@ -7023,7 +7023,7 @@ discard block |
||
7023 | 7023 | return $str; |
7024 | 7024 | } |
7025 | 7025 | |
7026 | - return self::rtrim($matches[0]) . $strAddOn; |
|
7026 | + return self::rtrim($matches[0]).$strAddOn; |
|
7027 | 7027 | } |
7028 | 7028 | |
7029 | 7029 | /** |
@@ -7091,7 +7091,7 @@ discard block |
||
7091 | 7091 | $strReturn .= $break; |
7092 | 7092 | } |
7093 | 7093 | |
7094 | - return $strReturn . implode('', $chars); |
|
7094 | + return $strReturn.implode('', $chars); |
|
7095 | 7095 | } |
7096 | 7096 | |
7097 | 7097 | /** |