@@ -2731,7 +2731,7 @@ discard block |
||
2731 | 2731 | /** |
2732 | 2732 | * Check if the input is binary... (is look like a hack). |
2733 | 2733 | * |
2734 | - * @param mixed $input |
|
2734 | + * @param string $input |
|
2735 | 2735 | * |
2736 | 2736 | * @return bool |
2737 | 2737 | */ |
@@ -5457,7 +5457,7 @@ discard block |
||
5457 | 5457 | * @link http://php.net/manual/en/function.mb-strrpos.php |
5458 | 5458 | * |
5459 | 5459 | * @param string $haystack <p>The string being checked, for the last occurrence of needle</p> |
5460 | - * @param string|int $needle <p>The string to find in haystack.<br />Or a code point as int.</p> |
|
5460 | + * @param string $needle <p>The string to find in haystack.<br />Or a code point as int.</p> |
|
5461 | 5461 | * @param int $offset [optional] <p>May be specified to begin searching an arbitrary number of characters |
5462 | 5462 | * into the string. Negative values will stop searching at an arbitrary point prior to |
5463 | 5463 | * the end of the string. |
@@ -6116,8 +6116,8 @@ discard block |
||
6116 | 6116 | * |
6117 | 6117 | * source: https://gist.github.com/stemar/8287074 |
6118 | 6118 | * |
6119 | - * @param string|string[] $str <p>The input string or an array of stings.</p> |
|
6120 | - * @param string|string[] $replacement <p>The replacement string or an array of stings.</p> |
|
6119 | + * @param string $str <p>The input string or an array of stings.</p> |
|
6120 | + * @param string $replacement <p>The replacement string or an array of stings.</p> |
|
6121 | 6121 | * @param int|int[] $start <p> |
6122 | 6122 | * If start is positive, the replacing will begin at the start'th offset |
6123 | 6123 | * into string. |
@@ -6125,7 +6125,7 @@ discard block |
||
6125 | 6125 | * If start is negative, the replacing will begin at the start'th character |
6126 | 6126 | * from the end of string. |
6127 | 6127 | * </p> |
6128 | - * @param int|int[]|void $length [optional] <p>If given and is positive, it represents the length of the |
|
6128 | + * @param integer $length [optional] <p>If given and is positive, it represents the length of the |
|
6129 | 6129 | * portion of string which is to be replaced. If it is negative, it |
6130 | 6130 | * represents the number of characters from the end of string at which to |
6131 | 6131 | * stop replacing. If it is not given, then it will default to strlen( |
@@ -6557,7 +6557,7 @@ discard block |
||
6557 | 6557 | * case.</li> |
6558 | 6558 | * </ul> |
6559 | 6559 | * |
6560 | - * @param string|string[] $str <p>Any string or array.</p> |
|
6560 | + * @param string $str <p>Any string or array.</p> |
|
6561 | 6561 | * @param bool $decodeHtmlEntityToUtf8 <p>Set to true, if you need to decode html-entities.</p> |
6562 | 6562 | * |
6563 | 6563 | * @return string|string[] <p>The UTF-8 encoded string.</p> |
@@ -851,7 +851,7 @@ discard block |
||
851 | 851 | public static function add_bom_to_string($str) |
852 | 852 | { |
853 | 853 | if (self::string_has_bom($str) === false) { |
854 | - $str = self::bom() . $str; |
|
854 | + $str = self::bom().$str; |
|
855 | 855 | } |
856 | 856 | |
857 | 857 | return $str; |
@@ -957,7 +957,7 @@ discard block |
||
957 | 957 | |
958 | 958 | // use static cache, if there is no support for "\IntlChar" |
959 | 959 | static $CHAR_CACHE = array(); |
960 | - $cacheKey = $code_point . $encoding; |
|
960 | + $cacheKey = $code_point.$encoding; |
|
961 | 961 | if (isset($CHAR_CACHE[$cacheKey]) === true) { |
962 | 962 | return $CHAR_CACHE[$cacheKey]; |
963 | 963 | } |
@@ -965,16 +965,16 @@ discard block |
||
965 | 965 | if (0x80 > $code_point %= 0x200000) { |
966 | 966 | $str = chr($code_point); |
967 | 967 | } elseif (0x800 > $code_point) { |
968 | - $str = chr(0xC0 | $code_point >> 6) . |
|
968 | + $str = chr(0xC0 | $code_point >> 6). |
|
969 | 969 | chr(0x80 | $code_point & 0x3F); |
970 | 970 | } elseif (0x10000 > $code_point) { |
971 | - $str = chr(0xE0 | $code_point >> 12) . |
|
972 | - chr(0x80 | $code_point >> 6 & 0x3F) . |
|
971 | + $str = chr(0xE0 | $code_point >> 12). |
|
972 | + chr(0x80 | $code_point >> 6 & 0x3F). |
|
973 | 973 | chr(0x80 | $code_point & 0x3F); |
974 | 974 | } else { |
975 | - $str = chr(0xF0 | $code_point >> 18) . |
|
976 | - chr(0x80 | $code_point >> 12 & 0x3F) . |
|
977 | - chr(0x80 | $code_point >> 6 & 0x3F) . |
|
975 | + $str = chr(0xF0 | $code_point >> 18). |
|
976 | + chr(0x80 | $code_point >> 12 & 0x3F). |
|
977 | + chr(0x80 | $code_point >> 6 & 0x3F). |
|
978 | 978 | chr(0x80 | $code_point & 0x3F); |
979 | 979 | } |
980 | 980 | |
@@ -1255,7 +1255,7 @@ discard block |
||
1255 | 1255 | $flags = ENT_QUOTES; |
1256 | 1256 | } |
1257 | 1257 | |
1258 | - return self::html_entity_decode('&#' . $int . ';', $flags); |
|
1258 | + return self::html_entity_decode('&#'.$int.';', $flags); |
|
1259 | 1259 | } |
1260 | 1260 | |
1261 | 1261 | /** |
@@ -1332,7 +1332,7 @@ discard block |
||
1332 | 1332 | && |
1333 | 1333 | self::$SUPPORT['mbstring'] === false |
1334 | 1334 | ) { |
1335 | - trigger_error('UTF8::encode() without mbstring cannot handle "' . $encoding . '" encoding', E_USER_WARNING); |
|
1335 | + trigger_error('UTF8::encode() without mbstring cannot handle "'.$encoding.'" encoding', E_USER_WARNING); |
|
1336 | 1336 | } |
1337 | 1337 | |
1338 | 1338 | $strEncoded = \mb_convert_encoding( |
@@ -1531,7 +1531,7 @@ discard block |
||
1531 | 1531 | ) { |
1532 | 1532 | // Prevent leading combining chars |
1533 | 1533 | // for NFC-safe concatenations. |
1534 | - $var = $leading_combining . $var; |
|
1534 | + $var = $leading_combining.$var; |
|
1535 | 1535 | } |
1536 | 1536 | } |
1537 | 1537 | |
@@ -1952,7 +1952,7 @@ discard block |
||
1952 | 1952 | */ |
1953 | 1953 | private static function getData($file) |
1954 | 1954 | { |
1955 | - $file = __DIR__ . '/data/' . $file . '.php'; |
|
1955 | + $file = __DIR__.'/data/'.$file.'.php'; |
|
1956 | 1956 | if (file_exists($file)) { |
1957 | 1957 | /** @noinspection PhpIncludeInspection */ |
1958 | 1958 | return require $file; |
@@ -2069,7 +2069,7 @@ discard block |
||
2069 | 2069 | return implode( |
2070 | 2070 | '', |
2071 | 2071 | array_map( |
2072 | - function ($data) use ($keepAsciiChars, $encoding) { |
|
2072 | + function($data) use ($keepAsciiChars, $encoding) { |
|
2073 | 2073 | return UTF8::single_chr_html_encode($data, $keepAsciiChars, $encoding); |
2074 | 2074 | }, |
2075 | 2075 | self::split($str) |
@@ -2188,7 +2188,7 @@ discard block |
||
2188 | 2188 | |
2189 | 2189 | $str = preg_replace_callback( |
2190 | 2190 | "/&#\d{2,6};/", |
2191 | - function ($matches) use ($encoding) { |
|
2191 | + function($matches) use ($encoding) { |
|
2192 | 2192 | $returnTmp = \mb_convert_encoding($matches[0], $encoding, 'HTML-ENTITIES'); |
2193 | 2193 | |
2194 | 2194 | if ($returnTmp !== '"' && $returnTmp !== "'") { |
@@ -2512,9 +2512,9 @@ discard block |
||
2512 | 2512 | if (ctype_digit((string)$int)) { |
2513 | 2513 | $hex = dechex((int)$int); |
2514 | 2514 | |
2515 | - $hex = (strlen($hex) < 4 ? substr('0000' . $hex, -4) : $hex); |
|
2515 | + $hex = (strlen($hex) < 4 ? substr('0000'.$hex, -4) : $hex); |
|
2516 | 2516 | |
2517 | - return $pfix . $hex; |
|
2517 | + return $pfix.$hex; |
|
2518 | 2518 | } |
2519 | 2519 | |
2520 | 2520 | return ''; |
@@ -3224,7 +3224,7 @@ discard block |
||
3224 | 3224 | */ |
3225 | 3225 | public static function lcfirst($str) |
3226 | 3226 | { |
3227 | - return self::strtolower(self::substr($str, 0, 1)) . self::substr($str, 1); |
|
3227 | + return self::strtolower(self::substr($str, 0, 1)).self::substr($str, 1); |
|
3228 | 3228 | } |
3229 | 3229 | |
3230 | 3230 | /** |
@@ -3248,7 +3248,7 @@ discard block |
||
3248 | 3248 | return preg_replace('/^[\pZ\pC]+/u', '', $str); |
3249 | 3249 | } |
3250 | 3250 | |
3251 | - return preg_replace('/^' . self::rxClass($chars) . '+/u', '', $str); |
|
3251 | + return preg_replace('/^'.self::rxClass($chars).'+/u', '', $str); |
|
3252 | 3252 | } |
3253 | 3253 | |
3254 | 3254 | /** |
@@ -3751,7 +3751,7 @@ discard block |
||
3751 | 3751 | if (is_array($what)) { |
3752 | 3752 | /** @noinspection ForeachSourceInspection */ |
3753 | 3753 | foreach ($what as $item) { |
3754 | - $str = preg_replace('/(' . preg_quote($item, '/') . ')+/', $item, $str); |
|
3754 | + $str = preg_replace('/('.preg_quote($item, '/').')+/', $item, $str); |
|
3755 | 3755 | } |
3756 | 3756 | } |
3757 | 3757 | |
@@ -3864,7 +3864,7 @@ discard block |
||
3864 | 3864 | return preg_replace('/[\pZ\pC]+$/u', '', $str); |
3865 | 3865 | } |
3866 | 3866 | |
3867 | - return preg_replace('/' . self::rxClass($chars) . '+$/u', '', $str); |
|
3867 | + return preg_replace('/'.self::rxClass($chars).'+$/u', '', $str); |
|
3868 | 3868 | } |
3869 | 3869 | |
3870 | 3870 | /** |
@@ -3879,7 +3879,7 @@ discard block |
||
3879 | 3879 | { |
3880 | 3880 | static $RX_CLASSS_CACHE = array(); |
3881 | 3881 | |
3882 | - $cacheKey = $s . $class; |
|
3882 | + $cacheKey = $s.$class; |
|
3883 | 3883 | |
3884 | 3884 | if (isset($RX_CLASSS_CACHE[$cacheKey])) { |
3885 | 3885 | return $RX_CLASSS_CACHE[$cacheKey]; |
@@ -3891,7 +3891,7 @@ discard block |
||
3891 | 3891 | /** @noinspection SuspiciousLoopInspection */ |
3892 | 3892 | foreach (self::str_split($s) as $s) { |
3893 | 3893 | if ('-' === $s) { |
3894 | - $class[0] = '-' . $class[0]; |
|
3894 | + $class[0] = '-'.$class[0]; |
|
3895 | 3895 | } elseif (!isset($s[2])) { |
3896 | 3896 | $class[0] .= preg_quote($s, '/'); |
3897 | 3897 | } elseif (1 === self::strlen($s)) { |
@@ -3902,13 +3902,13 @@ discard block |
||
3902 | 3902 | } |
3903 | 3903 | |
3904 | 3904 | if ($class[0]) { |
3905 | - $class[0] = '[' . $class[0] . ']'; |
|
3905 | + $class[0] = '['.$class[0].']'; |
|
3906 | 3906 | } |
3907 | 3907 | |
3908 | 3908 | if (1 === count($class)) { |
3909 | 3909 | $return = $class[0]; |
3910 | 3910 | } else { |
3911 | - $return = '(?:' . implode('|', $class) . ')'; |
|
3911 | + $return = '(?:'.implode('|', $class).')'; |
|
3912 | 3912 | } |
3913 | 3913 | |
3914 | 3914 | $RX_CLASSS_CACHE[$cacheKey] = $return; |
@@ -3926,7 +3926,7 @@ discard block |
||
3926 | 3926 | } |
3927 | 3927 | |
3928 | 3928 | foreach (self::$SUPPORT as $utf8Support) { |
3929 | - echo $utf8Support . "\n<br>"; |
|
3929 | + echo $utf8Support."\n<br>"; |
|
3930 | 3930 | } |
3931 | 3931 | } |
3932 | 3932 | |
@@ -3960,7 +3960,7 @@ discard block |
||
3960 | 3960 | $encoding = self::normalize_encoding($encoding); |
3961 | 3961 | } |
3962 | 3962 | |
3963 | - return '&#' . self::ord($char, $encoding) . ';'; |
|
3963 | + return '&#'.self::ord($char, $encoding).';'; |
|
3964 | 3964 | } |
3965 | 3965 | |
3966 | 3966 | /** |
@@ -4012,19 +4012,19 @@ discard block |
||
4012 | 4012 | $ret[] = $str[$i]; |
4013 | 4013 | } elseif ((($str[$i] & "\xE0") === "\xC0") && isset($str[$i + 1])) { |
4014 | 4014 | if (($str[$i + 1] & "\xC0") === "\x80") { |
4015 | - $ret[] = $str[$i] . $str[$i + 1]; |
|
4015 | + $ret[] = $str[$i].$str[$i + 1]; |
|
4016 | 4016 | |
4017 | 4017 | $i++; |
4018 | 4018 | } |
4019 | 4019 | } elseif ((($str[$i] & "\xF0") === "\xE0") && isset($str[$i + 2])) { |
4020 | 4020 | if ((($str[$i + 1] & "\xC0") === "\x80") && (($str[$i + 2] & "\xC0") === "\x80")) { |
4021 | - $ret[] = $str[$i] . $str[$i + 1] . $str[$i + 2]; |
|
4021 | + $ret[] = $str[$i].$str[$i + 1].$str[$i + 2]; |
|
4022 | 4022 | |
4023 | 4023 | $i += 2; |
4024 | 4024 | } |
4025 | 4025 | } elseif ((($str[$i] & "\xF8") === "\xF0") && isset($str[$i + 3])) { |
4026 | 4026 | if ((($str[$i + 1] & "\xC0") === "\x80") && (($str[$i + 2] & "\xC0") === "\x80") && (($str[$i + 3] & "\xC0") === "\x80")) { |
4027 | - $ret[] = $str[$i] . $str[$i + 1] . $str[$i + 2] . $str[$i + 3]; |
|
4027 | + $ret[] = $str[$i].$str[$i + 1].$str[$i + 2].$str[$i + 3]; |
|
4028 | 4028 | |
4029 | 4029 | $i += 3; |
4030 | 4030 | } |
@@ -4036,7 +4036,7 @@ discard block |
||
4036 | 4036 | $ret = array_chunk($ret, $length); |
4037 | 4037 | |
4038 | 4038 | return array_map( |
4039 | - function ($item) { |
|
4039 | + function($item) { |
|
4040 | 4040 | return implode('', $item); |
4041 | 4041 | }, $ret |
4042 | 4042 | ); |
@@ -4135,7 +4135,7 @@ discard block |
||
4135 | 4135 | foreach (self::$ICONV_ENCODING as $encodingTmp) { |
4136 | 4136 | # INFO: //IGNORE and //TRANSLIT still throw notice |
4137 | 4137 | /** @noinspection PhpUsageOfSilenceOperatorInspection */ |
4138 | - if (md5(@\iconv($encodingTmp, $encodingTmp . '//IGNORE', $str)) === $md5) { |
|
4138 | + if (md5(@\iconv($encodingTmp, $encodingTmp.'//IGNORE', $str)) === $md5) { |
|
4139 | 4139 | return $encodingTmp; |
4140 | 4140 | } |
4141 | 4141 | } |
@@ -4225,7 +4225,7 @@ discard block |
||
4225 | 4225 | if ('' === $s .= '') { |
4226 | 4226 | $s = '/^(?<=.)$/'; |
4227 | 4227 | } else { |
4228 | - $s = '/' . preg_quote($s, '/') . '/ui'; |
|
4228 | + $s = '/'.preg_quote($s, '/').'/ui'; |
|
4229 | 4229 | } |
4230 | 4230 | } |
4231 | 4231 | |
@@ -4283,7 +4283,7 @@ discard block |
||
4283 | 4283 | } |
4284 | 4284 | |
4285 | 4285 | if (self::substr($str, $length - 1, 1) === ' ') { |
4286 | - return self::substr($str, 0, $length - 1) . $strAddOn; |
|
4286 | + return self::substr($str, 0, $length - 1).$strAddOn; |
|
4287 | 4287 | } |
4288 | 4288 | |
4289 | 4289 | $str = self::substr($str, 0, $length); |
@@ -4292,9 +4292,9 @@ discard block |
||
4292 | 4292 | $new_str = implode(' ', $array); |
4293 | 4293 | |
4294 | 4294 | if ($new_str === '') { |
4295 | - $str = self::substr($str, 0, $length - 1) . $strAddOn; |
|
4295 | + $str = self::substr($str, 0, $length - 1).$strAddOn; |
|
4296 | 4296 | } else { |
4297 | - $str = $new_str . $strAddOn; |
|
4297 | + $str = $new_str.$strAddOn; |
|
4298 | 4298 | } |
4299 | 4299 | |
4300 | 4300 | return $str; |
@@ -4349,7 +4349,7 @@ discard block |
||
4349 | 4349 | $pre = ''; |
4350 | 4350 | } |
4351 | 4351 | |
4352 | - return $pre . $str . $post; |
|
4352 | + return $pre.$str.$post; |
|
4353 | 4353 | } |
4354 | 4354 | |
4355 | 4355 | return $str; |
@@ -4499,7 +4499,7 @@ discard block |
||
4499 | 4499 | } |
4500 | 4500 | |
4501 | 4501 | /** @noinspection PhpInternalEntityUsedInspection */ |
4502 | - preg_match_all('/' . Grapheme::GRAPHEME_CLUSTER_RX . '/u', $str, $a); |
|
4502 | + preg_match_all('/'.Grapheme::GRAPHEME_CLUSTER_RX.'/u', $str, $a); |
|
4503 | 4503 | $a = $a[0]; |
4504 | 4504 | |
4505 | 4505 | if ($len === 1) { |
@@ -4694,7 +4694,7 @@ discard block |
||
4694 | 4694 | public static function strcmp($str1, $str2) |
4695 | 4695 | { |
4696 | 4696 | /** @noinspection PhpUndefinedClassInspection */ |
4697 | - return $str1 . '' === $str2 . '' ? 0 : strcmp( |
|
4697 | + return $str1.'' === $str2.'' ? 0 : strcmp( |
|
4698 | 4698 | \Normalizer::normalize($str1, \Normalizer::NFD), |
4699 | 4699 | \Normalizer::normalize($str2, \Normalizer::NFD) |
4700 | 4700 | ); |
@@ -4725,7 +4725,7 @@ discard block |
||
4725 | 4725 | return null; |
4726 | 4726 | } |
4727 | 4727 | |
4728 | - if (preg_match('/^(.*?)' . self::rxClass($charList) . '/us', $str, $length)) { |
|
4728 | + if (preg_match('/^(.*?)'.self::rxClass($charList).'/us', $str, $length)) { |
|
4729 | 4729 | /** @noinspection OffsetOperationsInspection */ |
4730 | 4730 | return self::strlen($length[1]); |
4731 | 4731 | } |
@@ -4932,7 +4932,7 @@ discard block |
||
4932 | 4932 | && |
4933 | 4933 | self::$SUPPORT['mbstring'] === false |
4934 | 4934 | ) { |
4935 | - trigger_error('UTF8::stristr() without mbstring cannot handle "' . $encoding . '" encoding', E_USER_WARNING); |
|
4935 | + trigger_error('UTF8::stristr() without mbstring cannot handle "'.$encoding.'" encoding', E_USER_WARNING); |
|
4936 | 4936 | } |
4937 | 4937 | |
4938 | 4938 | if (self::$SUPPORT['mbstring'] === true) { |
@@ -4943,7 +4943,7 @@ discard block |
||
4943 | 4943 | return \grapheme_stristr($haystack, $needle, $before_needle); |
4944 | 4944 | } |
4945 | 4945 | |
4946 | - preg_match('/^(.*?)' . preg_quote($needle, '/') . '/usi', $haystack, $match); |
|
4946 | + preg_match('/^(.*?)'.preg_quote($needle, '/').'/usi', $haystack, $match); |
|
4947 | 4947 | |
4948 | 4948 | if (!isset($match[1])) { |
4949 | 4949 | return false; |
@@ -5007,7 +5007,7 @@ discard block |
||
5007 | 5007 | && |
5008 | 5008 | self::$SUPPORT['iconv'] === false |
5009 | 5009 | ) { |
5010 | - trigger_error('UTF8::strlen() without mbstring / iconv cannot handle "' . $encoding . '" encoding', E_USER_WARNING); |
|
5010 | + trigger_error('UTF8::strlen() without mbstring / iconv cannot handle "'.$encoding.'" encoding', E_USER_WARNING); |
|
5011 | 5011 | } |
5012 | 5012 | |
5013 | 5013 | if ( |
@@ -5086,7 +5086,7 @@ discard block |
||
5086 | 5086 | */ |
5087 | 5087 | public static function strnatcmp($str1, $str2) |
5088 | 5088 | { |
5089 | - return $str1 . '' === $str2 . '' ? 0 : strnatcmp(self::strtonatfold($str1), self::strtonatfold($str2)); |
|
5089 | + return $str1.'' === $str2.'' ? 0 : strnatcmp(self::strtonatfold($str1), self::strtonatfold($str2)); |
|
5090 | 5090 | } |
5091 | 5091 | |
5092 | 5092 | /** |
@@ -5147,7 +5147,7 @@ discard block |
||
5147 | 5147 | return false; |
5148 | 5148 | } |
5149 | 5149 | |
5150 | - if (preg_match('/' . self::rxClass($char_list) . '/us', $haystack, $m)) { |
|
5150 | + if (preg_match('/'.self::rxClass($char_list).'/us', $haystack, $m)) { |
|
5151 | 5151 | return substr($haystack, strpos($haystack, $m[0])); |
5152 | 5152 | } else { |
5153 | 5153 | return false; |
@@ -5216,7 +5216,7 @@ discard block |
||
5216 | 5216 | && |
5217 | 5217 | self::$SUPPORT['mbstring'] === false |
5218 | 5218 | ) { |
5219 | - trigger_error('UTF8::strpos() without mbstring / iconv cannot handle "' . $encoding . '" encoding', E_USER_WARNING); |
|
5219 | + trigger_error('UTF8::strpos() without mbstring / iconv cannot handle "'.$encoding.'" encoding', E_USER_WARNING); |
|
5220 | 5220 | } |
5221 | 5221 | |
5222 | 5222 | if ( |
@@ -5432,7 +5432,7 @@ discard block |
||
5432 | 5432 | && |
5433 | 5433 | self::$SUPPORT['mbstring'] === false |
5434 | 5434 | ) { |
5435 | - trigger_error('UTF8::strripos() without mbstring cannot handle "' . $encoding . '" encoding', E_USER_WARNING); |
|
5435 | + trigger_error('UTF8::strripos() without mbstring cannot handle "'.$encoding.'" encoding', E_USER_WARNING); |
|
5436 | 5436 | } |
5437 | 5437 | |
5438 | 5438 | if (self::$SUPPORT['mbstring'] === true) { |
@@ -5512,7 +5512,7 @@ discard block |
||
5512 | 5512 | && |
5513 | 5513 | self::$SUPPORT['mbstring'] === false |
5514 | 5514 | ) { |
5515 | - trigger_error('UTF8::strrpos() without mbstring cannot handle "' . $encoding . '" encoding', E_USER_WARNING); |
|
5515 | + trigger_error('UTF8::strrpos() without mbstring cannot handle "'.$encoding.'" encoding', E_USER_WARNING); |
|
5516 | 5516 | } |
5517 | 5517 | |
5518 | 5518 | if (self::$SUPPORT['mbstring'] === true) { |
@@ -5572,7 +5572,7 @@ discard block |
||
5572 | 5572 | return 0; |
5573 | 5573 | } |
5574 | 5574 | |
5575 | - return preg_match('/^' . self::rxClass($mask) . '+/u', $str, $str) ? self::strlen($str[0]) : 0; |
|
5575 | + return preg_match('/^'.self::rxClass($mask).'+/u', $str, $str) ? self::strlen($str[0]) : 0; |
|
5576 | 5576 | } |
5577 | 5577 | |
5578 | 5578 | /** |
@@ -5618,7 +5618,7 @@ discard block |
||
5618 | 5618 | && |
5619 | 5619 | self::$SUPPORT['mbstring'] === false |
5620 | 5620 | ) { |
5621 | - trigger_error('UTF8::strstr() without mbstring cannot handle "' . $encoding . '" encoding', E_USER_WARNING); |
|
5621 | + trigger_error('UTF8::strstr() without mbstring cannot handle "'.$encoding.'" encoding', E_USER_WARNING); |
|
5622 | 5622 | } |
5623 | 5623 | |
5624 | 5624 | if (self::$SUPPORT['mbstring'] === true) { |
@@ -5635,7 +5635,7 @@ discard block |
||
5635 | 5635 | } |
5636 | 5636 | } |
5637 | 5637 | |
5638 | - preg_match('/^(.*?)' . preg_quote($needle, '/') . '/us', $haystack, $match); |
|
5638 | + preg_match('/^(.*?)'.preg_quote($needle, '/').'/us', $haystack, $match); |
|
5639 | 5639 | |
5640 | 5640 | if (!isset($match[1])) { |
5641 | 5641 | return false; |
@@ -5899,7 +5899,7 @@ discard block |
||
5899 | 5899 | && |
5900 | 5900 | self::$SUPPORT['mbstring'] === false |
5901 | 5901 | ) { |
5902 | - trigger_error('UTF8::substr() without mbstring cannot handle "' . $encoding . '" encoding', E_USER_WARNING); |
|
5902 | + trigger_error('UTF8::substr() without mbstring cannot handle "'.$encoding.'" encoding', E_USER_WARNING); |
|
5903 | 5903 | } |
5904 | 5904 | |
5905 | 5905 | if (self::$SUPPORT['mbstring'] === true) { |
@@ -6012,14 +6012,14 @@ discard block |
||
6012 | 6012 | && |
6013 | 6013 | self::$SUPPORT['mbstring'] === false |
6014 | 6014 | ) { |
6015 | - trigger_error('UTF8::substr_count() without mbstring cannot handle "' . $encoding . '" encoding', E_USER_WARNING); |
|
6015 | + trigger_error('UTF8::substr_count() without mbstring cannot handle "'.$encoding.'" encoding', E_USER_WARNING); |
|
6016 | 6016 | } |
6017 | 6017 | |
6018 | 6018 | if (self::$SUPPORT['mbstring'] === true) { |
6019 | 6019 | return \mb_substr_count($haystack, $needle, $encoding); |
6020 | 6020 | } |
6021 | 6021 | |
6022 | - preg_match_all('/' . preg_quote($needle, '/') . '/us', $haystack, $matches, PREG_SET_ORDER); |
|
6022 | + preg_match_all('/'.preg_quote($needle, '/').'/us', $haystack, $matches, PREG_SET_ORDER); |
|
6023 | 6023 | |
6024 | 6024 | return count($matches); |
6025 | 6025 | } |
@@ -6266,7 +6266,7 @@ discard block |
||
6266 | 6266 | |
6267 | 6267 | $strSwappedCase = preg_replace_callback( |
6268 | 6268 | '/[\S]/u', |
6269 | - function ($match) use ($encoding) { |
|
6269 | + function($match) use ($encoding) { |
|
6270 | 6270 | $marchToUpper = UTF8::strtoupper($match[0], $encoding); |
6271 | 6271 | |
6272 | 6272 | if ($match[0] === $marchToUpper) { |
@@ -6596,40 +6596,40 @@ discard block |
||
6596 | 6596 | if ($c1 >= "\xc0" & $c1 <= "\xdf") { // looks like 2 bytes UTF8 |
6597 | 6597 | |
6598 | 6598 | if ($c2 >= "\x80" && $c2 <= "\xbf") { // yeah, almost sure it's UTF8 already |
6599 | - $buf .= $c1 . $c2; |
|
6599 | + $buf .= $c1.$c2; |
|
6600 | 6600 | $i++; |
6601 | 6601 | } else { // not valid UTF8 - convert it |
6602 | 6602 | $cc1 = (chr(ord($c1) / 64) | "\xc0"); |
6603 | 6603 | $cc2 = ($c1 & "\x3f") | "\x80"; |
6604 | - $buf .= $cc1 . $cc2; |
|
6604 | + $buf .= $cc1.$cc2; |
|
6605 | 6605 | } |
6606 | 6606 | |
6607 | 6607 | } elseif ($c1 >= "\xe0" & $c1 <= "\xef") { // looks like 3 bytes UTF8 |
6608 | 6608 | |
6609 | 6609 | if ($c2 >= "\x80" && $c2 <= "\xbf" && $c3 >= "\x80" && $c3 <= "\xbf") { // yeah, almost sure it's UTF8 already |
6610 | - $buf .= $c1 . $c2 . $c3; |
|
6610 | + $buf .= $c1.$c2.$c3; |
|
6611 | 6611 | $i += 2; |
6612 | 6612 | } else { // not valid UTF8 - convert it |
6613 | 6613 | $cc1 = (chr(ord($c1) / 64) | "\xc0"); |
6614 | 6614 | $cc2 = ($c1 & "\x3f") | "\x80"; |
6615 | - $buf .= $cc1 . $cc2; |
|
6615 | + $buf .= $cc1.$cc2; |
|
6616 | 6616 | } |
6617 | 6617 | |
6618 | 6618 | } elseif ($c1 >= "\xf0" & $c1 <= "\xf7") { // looks like 4 bytes UTF8 |
6619 | 6619 | |
6620 | 6620 | if ($c2 >= "\x80" && $c2 <= "\xbf" && $c3 >= "\x80" && $c3 <= "\xbf" && $c4 >= "\x80" && $c4 <= "\xbf") { // yeah, almost sure it's UTF8 already |
6621 | - $buf .= $c1 . $c2 . $c3 . $c4; |
|
6621 | + $buf .= $c1.$c2.$c3.$c4; |
|
6622 | 6622 | $i += 3; |
6623 | 6623 | } else { // not valid UTF8 - convert it |
6624 | 6624 | $cc1 = (chr(ord($c1) / 64) | "\xc0"); |
6625 | 6625 | $cc2 = ($c1 & "\x3f") | "\x80"; |
6626 | - $buf .= $cc1 . $cc2; |
|
6626 | + $buf .= $cc1.$cc2; |
|
6627 | 6627 | } |
6628 | 6628 | |
6629 | 6629 | } else { // doesn't look like UTF8, but should be converted |
6630 | 6630 | $cc1 = (chr(ord($c1) / 64) | "\xc0"); |
6631 | 6631 | $cc2 = (($c1 & "\x3f") | "\x80"); |
6632 | - $buf .= $cc1 . $cc2; |
|
6632 | + $buf .= $cc1.$cc2; |
|
6633 | 6633 | } |
6634 | 6634 | |
6635 | 6635 | } elseif (($c1 & "\xc0") === "\x80") { // needs conversion |
@@ -6640,7 +6640,7 @@ discard block |
||
6640 | 6640 | } else { |
6641 | 6641 | $cc1 = (chr($ordC1 / 64) | "\xc0"); |
6642 | 6642 | $cc2 = (($c1 & "\x3f") | "\x80"); |
6643 | - $buf .= $cc1 . $cc2; |
|
6643 | + $buf .= $cc1.$cc2; |
|
6644 | 6644 | } |
6645 | 6645 | |
6646 | 6646 | } else { // it doesn't need conversion |
@@ -6651,7 +6651,7 @@ discard block |
||
6651 | 6651 | // decode unicode escape sequences |
6652 | 6652 | $buf = preg_replace_callback( |
6653 | 6653 | '/\\\\u([0-9a-f]{4})/i', |
6654 | - function ($match) { |
|
6654 | + function($match) { |
|
6655 | 6655 | return \mb_convert_encoding(pack('H*', $match[1]), 'UTF-8', 'UCS-2BE'); |
6656 | 6656 | }, |
6657 | 6657 | $buf |
@@ -6705,7 +6705,7 @@ discard block |
||
6705 | 6705 | */ |
6706 | 6706 | public static function ucfirst($str, $encoding = 'UTF-8', $cleanUtf8 = false) |
6707 | 6707 | { |
6708 | - return self::strtoupper(self::substr($str, 0, 1, $encoding, $cleanUtf8), $encoding, $cleanUtf8) . self::substr($str, 1, null, $encoding, $cleanUtf8); |
|
6708 | + return self::strtoupper(self::substr($str, 0, 1, $encoding, $cleanUtf8), $encoding, $cleanUtf8).self::substr($str, 1, null, $encoding, $cleanUtf8); |
|
6709 | 6709 | } |
6710 | 6710 | |
6711 | 6711 | /** |
@@ -7180,7 +7180,7 @@ discard block |
||
7180 | 7180 | return ''; |
7181 | 7181 | } |
7182 | 7182 | |
7183 | - preg_match('/^\s*+(?:\S++\s*+){1,' . $words . '}/u', $str, $matches); |
|
7183 | + preg_match('/^\s*+(?:\S++\s*+){1,'.$words.'}/u', $str, $matches); |
|
7184 | 7184 | |
7185 | 7185 | if ( |
7186 | 7186 | !isset($matches[0]) |
@@ -7190,7 +7190,7 @@ discard block |
||
7190 | 7190 | return $str; |
7191 | 7191 | } |
7192 | 7192 | |
7193 | - return self::rtrim($matches[0]) . $strAddOn; |
|
7193 | + return self::rtrim($matches[0]).$strAddOn; |
|
7194 | 7194 | } |
7195 | 7195 | |
7196 | 7196 | /** |
@@ -7258,7 +7258,7 @@ discard block |
||
7258 | 7258 | $strReturn .= $break; |
7259 | 7259 | } |
7260 | 7260 | |
7261 | - return $strReturn . implode('', $chars); |
|
7261 | + return $strReturn.implode('', $chars); |
|
7262 | 7262 | } |
7263 | 7263 | |
7264 | 7264 | /** |