@@ -217,6 +217,6 @@ |
||
217 | 217 | ), |
218 | 218 | ); |
219 | 219 | |
220 | -$result =& $data; |
|
220 | +$result = & $data; |
|
221 | 221 | unset($data); |
222 | 222 | return $result; |
@@ -933,16 +933,16 @@ |
||
933 | 933 | $str = chr($code_point); |
934 | 934 | } elseif (0x800 > $code_point) { |
935 | 935 | $str = chr(0xC0 | $code_point >> 6) . |
936 | - chr(0x80 | $code_point & 0x3F); |
|
936 | + chr(0x80 | $code_point & 0x3F); |
|
937 | 937 | } elseif (0x10000 > $code_point) { |
938 | 938 | $str = chr(0xE0 | $code_point >> 12) . |
939 | - chr(0x80 | $code_point >> 6 & 0x3F) . |
|
940 | - chr(0x80 | $code_point & 0x3F); |
|
939 | + chr(0x80 | $code_point >> 6 & 0x3F) . |
|
940 | + chr(0x80 | $code_point & 0x3F); |
|
941 | 941 | } else { |
942 | 942 | $str = chr(0xF0 | $code_point >> 18) . |
943 | - chr(0x80 | $code_point >> 12 & 0x3F) . |
|
944 | - chr(0x80 | $code_point >> 6 & 0x3F) . |
|
945 | - chr(0x80 | $code_point & 0x3F); |
|
943 | + chr(0x80 | $code_point >> 12 & 0x3F) . |
|
944 | + chr(0x80 | $code_point >> 6 & 0x3F) . |
|
945 | + chr(0x80 | $code_point & 0x3F); |
|
946 | 946 | } |
947 | 947 | |
948 | 948 | if ($encoding !== 'UTF-8') { |
@@ -2730,7 +2730,7 @@ discard block |
||
2730 | 2730 | /** |
2731 | 2731 | * Check if the input is binary... (is look like a hack). |
2732 | 2732 | * |
2733 | - * @param mixed $input |
|
2733 | + * @param string $input |
|
2734 | 2734 | * |
2735 | 2735 | * @return bool |
2736 | 2736 | */ |
@@ -5449,7 +5449,7 @@ discard block |
||
5449 | 5449 | * @link http://php.net/manual/en/function.mb-strrpos.php |
5450 | 5450 | * |
5451 | 5451 | * @param string $haystack <p>The string being checked, for the last occurrence of needle</p> |
5452 | - * @param string|int $needle <p>The string to find in haystack.<br />Or a code point as int.</p> |
|
5452 | + * @param string $needle <p>The string to find in haystack.<br />Or a code point as int.</p> |
|
5453 | 5453 | * @param int $offset [optional] <p>May be specified to begin searching an arbitrary number of characters |
5454 | 5454 | * into the string. Negative values will stop searching at an arbitrary point prior to |
5455 | 5455 | * the end of the string. |
@@ -6108,8 +6108,8 @@ discard block |
||
6108 | 6108 | * |
6109 | 6109 | * source: https://gist.github.com/stemar/8287074 |
6110 | 6110 | * |
6111 | - * @param string|string[] $str <p>The input string or an array of stings.</p> |
|
6112 | - * @param string|string[] $replacement <p>The replacement string or an array of stings.</p> |
|
6111 | + * @param string $str <p>The input string or an array of stings.</p> |
|
6112 | + * @param string $replacement <p>The replacement string or an array of stings.</p> |
|
6113 | 6113 | * @param int|int[] $start <p> |
6114 | 6114 | * If start is positive, the replacing will begin at the start'th offset |
6115 | 6115 | * into string. |
@@ -6117,7 +6117,7 @@ discard block |
||
6117 | 6117 | * If start is negative, the replacing will begin at the start'th character |
6118 | 6118 | * from the end of string. |
6119 | 6119 | * </p> |
6120 | - * @param int|int[]|void $length [optional] <p>If given and is positive, it represents the length of the |
|
6120 | + * @param integer $length [optional] <p>If given and is positive, it represents the length of the |
|
6121 | 6121 | * portion of string which is to be replaced. If it is negative, it |
6122 | 6122 | * represents the number of characters from the end of string at which to |
6123 | 6123 | * stop replacing. If it is not given, then it will default to strlen( |
@@ -6521,7 +6521,7 @@ discard block |
||
6521 | 6521 | * <li>WARNING: It does not remove invalid UTF-8 characters, so you maybe need to use "UTF8::clean()" for this case.</li> |
6522 | 6522 | * </ul> |
6523 | 6523 | * |
6524 | - * @param string|string[] $str <p>Any string or array.</p> |
|
6524 | + * @param string $str <p>Any string or array.</p> |
|
6525 | 6525 | * @param bool $decodeHtmlEntityToUtf8 <p>Set to true, if you need to decode html-entities.</p> |
6526 | 6526 | * |
6527 | 6527 | * @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; |
@@ -956,7 +956,7 @@ discard block |
||
956 | 956 | |
957 | 957 | // use static cache, if there is no support for "IntlChar" |
958 | 958 | static $cache = array(); |
959 | - $cacheKey = $code_point . $encoding; |
|
959 | + $cacheKey = $code_point.$encoding; |
|
960 | 960 | if (isset($cache[$cacheKey]) === true) { |
961 | 961 | return $cache[$cacheKey]; |
962 | 962 | } |
@@ -964,16 +964,16 @@ discard block |
||
964 | 964 | if (0x80 > $code_point %= 0x200000) { |
965 | 965 | $str = chr($code_point); |
966 | 966 | } elseif (0x800 > $code_point) { |
967 | - $str = chr(0xC0 | $code_point >> 6) . |
|
967 | + $str = chr(0xC0 | $code_point >> 6). |
|
968 | 968 | chr(0x80 | $code_point & 0x3F); |
969 | 969 | } elseif (0x10000 > $code_point) { |
970 | - $str = chr(0xE0 | $code_point >> 12) . |
|
971 | - chr(0x80 | $code_point >> 6 & 0x3F) . |
|
970 | + $str = chr(0xE0 | $code_point >> 12). |
|
971 | + chr(0x80 | $code_point >> 6 & 0x3F). |
|
972 | 972 | chr(0x80 | $code_point & 0x3F); |
973 | 973 | } else { |
974 | - $str = chr(0xF0 | $code_point >> 18) . |
|
975 | - chr(0x80 | $code_point >> 12 & 0x3F) . |
|
976 | - chr(0x80 | $code_point >> 6 & 0x3F) . |
|
974 | + $str = chr(0xF0 | $code_point >> 18). |
|
975 | + chr(0x80 | $code_point >> 12 & 0x3F). |
|
976 | + chr(0x80 | $code_point >> 6 & 0x3F). |
|
977 | 977 | chr(0x80 | $code_point & 0x3F); |
978 | 978 | } |
979 | 979 | |
@@ -1254,7 +1254,7 @@ discard block |
||
1254 | 1254 | $flags = ENT_QUOTES; |
1255 | 1255 | } |
1256 | 1256 | |
1257 | - return self::html_entity_decode('&#' . $int . ';', $flags); |
|
1257 | + return self::html_entity_decode('&#'.$int.';', $flags); |
|
1258 | 1258 | } |
1259 | 1259 | |
1260 | 1260 | /** |
@@ -1331,7 +1331,7 @@ discard block |
||
1331 | 1331 | && |
1332 | 1332 | self::$support['mbstring'] === false |
1333 | 1333 | ) { |
1334 | - trigger_error('UTF8::encode() without mbstring cannot handle "' . $encoding . '" encoding', E_USER_WARNING); |
|
1334 | + trigger_error('UTF8::encode() without mbstring cannot handle "'.$encoding.'" encoding', E_USER_WARNING); |
|
1335 | 1335 | } |
1336 | 1336 | |
1337 | 1337 | $strEncoded = \mb_convert_encoding( |
@@ -1530,7 +1530,7 @@ discard block |
||
1530 | 1530 | ) { |
1531 | 1531 | // Prevent leading combining chars |
1532 | 1532 | // for NFC-safe concatenations. |
1533 | - $var = $leading_combining . $var; |
|
1533 | + $var = $leading_combining.$var; |
|
1534 | 1534 | } |
1535 | 1535 | } |
1536 | 1536 | |
@@ -1951,7 +1951,7 @@ discard block |
||
1951 | 1951 | */ |
1952 | 1952 | private static function getData($file) |
1953 | 1953 | { |
1954 | - $file = __DIR__ . '/data/' . $file . '.php'; |
|
1954 | + $file = __DIR__.'/data/'.$file.'.php'; |
|
1955 | 1955 | if (file_exists($file)) { |
1956 | 1956 | /** @noinspection PhpIncludeInspection */ |
1957 | 1957 | return require $file; |
@@ -2068,7 +2068,7 @@ discard block |
||
2068 | 2068 | return implode( |
2069 | 2069 | '', |
2070 | 2070 | array_map( |
2071 | - function ($data) use ($keepAsciiChars, $encoding) { |
|
2071 | + function($data) use ($keepAsciiChars, $encoding) { |
|
2072 | 2072 | return UTF8::single_chr_html_encode($data, $keepAsciiChars, $encoding); |
2073 | 2073 | }, |
2074 | 2074 | self::split($str) |
@@ -2187,7 +2187,7 @@ discard block |
||
2187 | 2187 | |
2188 | 2188 | $str = preg_replace_callback( |
2189 | 2189 | "/&#\d{2,6};/", |
2190 | - function ($matches) use ($encoding) { |
|
2190 | + function($matches) use ($encoding) { |
|
2191 | 2191 | $returnTmp = \mb_convert_encoding($matches[0], $encoding, 'HTML-ENTITIES'); |
2192 | 2192 | |
2193 | 2193 | if ($returnTmp !== '"' && $returnTmp !== "'") { |
@@ -2511,9 +2511,9 @@ discard block |
||
2511 | 2511 | if (ctype_digit((string)$int)) { |
2512 | 2512 | $hex = dechex((int)$int); |
2513 | 2513 | |
2514 | - $hex = (strlen($hex) < 4 ? substr('0000' . $hex, -4) : $hex); |
|
2514 | + $hex = (strlen($hex) < 4 ? substr('0000'.$hex, -4) : $hex); |
|
2515 | 2515 | |
2516 | - return $pfix . $hex; |
|
2516 | + return $pfix.$hex; |
|
2517 | 2517 | } |
2518 | 2518 | |
2519 | 2519 | return ''; |
@@ -3217,7 +3217,7 @@ discard block |
||
3217 | 3217 | */ |
3218 | 3218 | public static function lcfirst($str) |
3219 | 3219 | { |
3220 | - return self::strtolower(self::substr($str, 0, 1)) . self::substr($str, 1); |
|
3220 | + return self::strtolower(self::substr($str, 0, 1)).self::substr($str, 1); |
|
3221 | 3221 | } |
3222 | 3222 | |
3223 | 3223 | /** |
@@ -3241,7 +3241,7 @@ discard block |
||
3241 | 3241 | return preg_replace('/^[\pZ\pC]+/u', '', $str); |
3242 | 3242 | } |
3243 | 3243 | |
3244 | - return preg_replace('/^' . self::rxClass($chars) . '+/u', '', $str); |
|
3244 | + return preg_replace('/^'.self::rxClass($chars).'+/u', '', $str); |
|
3245 | 3245 | } |
3246 | 3246 | |
3247 | 3247 | /** |
@@ -3744,7 +3744,7 @@ discard block |
||
3744 | 3744 | if (is_array($what)) { |
3745 | 3745 | /** @noinspection ForeachSourceInspection */ |
3746 | 3746 | foreach ($what as $item) { |
3747 | - $str = preg_replace('/(' . preg_quote($item, '/') . ')+/', $item, $str); |
|
3747 | + $str = preg_replace('/('.preg_quote($item, '/').')+/', $item, $str); |
|
3748 | 3748 | } |
3749 | 3749 | } |
3750 | 3750 | |
@@ -3857,7 +3857,7 @@ discard block |
||
3857 | 3857 | return preg_replace('/[\pZ\pC]+$/u', '', $str); |
3858 | 3858 | } |
3859 | 3859 | |
3860 | - return preg_replace('/' . self::rxClass($chars) . '+$/u', '', $str); |
|
3860 | + return preg_replace('/'.self::rxClass($chars).'+$/u', '', $str); |
|
3861 | 3861 | } |
3862 | 3862 | |
3863 | 3863 | /** |
@@ -3872,7 +3872,7 @@ discard block |
||
3872 | 3872 | { |
3873 | 3873 | static $rxClassCache = array(); |
3874 | 3874 | |
3875 | - $cacheKey = $s . $class; |
|
3875 | + $cacheKey = $s.$class; |
|
3876 | 3876 | |
3877 | 3877 | if (isset($rxClassCache[$cacheKey])) { |
3878 | 3878 | return $rxClassCache[$cacheKey]; |
@@ -3884,7 +3884,7 @@ discard block |
||
3884 | 3884 | /** @noinspection SuspiciousLoopInspection */ |
3885 | 3885 | foreach (self::str_split($s) as $s) { |
3886 | 3886 | if ('-' === $s) { |
3887 | - $class[0] = '-' . $class[0]; |
|
3887 | + $class[0] = '-'.$class[0]; |
|
3888 | 3888 | } elseif (!isset($s[2])) { |
3889 | 3889 | $class[0] .= preg_quote($s, '/'); |
3890 | 3890 | } elseif (1 === self::strlen($s)) { |
@@ -3895,13 +3895,13 @@ discard block |
||
3895 | 3895 | } |
3896 | 3896 | |
3897 | 3897 | if ($class[0]) { |
3898 | - $class[0] = '[' . $class[0] . ']'; |
|
3898 | + $class[0] = '['.$class[0].']'; |
|
3899 | 3899 | } |
3900 | 3900 | |
3901 | 3901 | if (1 === count($class)) { |
3902 | 3902 | $return = $class[0]; |
3903 | 3903 | } else { |
3904 | - $return = '(?:' . implode('|', $class) . ')'; |
|
3904 | + $return = '(?:'.implode('|', $class).')'; |
|
3905 | 3905 | } |
3906 | 3906 | |
3907 | 3907 | $rxClassCache[$cacheKey] = $return; |
@@ -3919,7 +3919,7 @@ discard block |
||
3919 | 3919 | } |
3920 | 3920 | |
3921 | 3921 | foreach (self::$support as $utf8Support) { |
3922 | - echo $utf8Support . "\n<br>"; |
|
3922 | + echo $utf8Support."\n<br>"; |
|
3923 | 3923 | } |
3924 | 3924 | } |
3925 | 3925 | |
@@ -3953,7 +3953,7 @@ discard block |
||
3953 | 3953 | $encoding = self::normalize_encoding($encoding); |
3954 | 3954 | } |
3955 | 3955 | |
3956 | - return '&#' . self::ord($char, $encoding) . ';'; |
|
3956 | + return '&#'.self::ord($char, $encoding).';'; |
|
3957 | 3957 | } |
3958 | 3958 | |
3959 | 3959 | /** |
@@ -4005,19 +4005,19 @@ discard block |
||
4005 | 4005 | $ret[] = $str[$i]; |
4006 | 4006 | } elseif ((($str[$i] & "\xE0") === "\xC0") && isset($str[$i + 1])) { |
4007 | 4007 | if (($str[$i + 1] & "\xC0") === "\x80") { |
4008 | - $ret[] = $str[$i] . $str[$i + 1]; |
|
4008 | + $ret[] = $str[$i].$str[$i + 1]; |
|
4009 | 4009 | |
4010 | 4010 | $i++; |
4011 | 4011 | } |
4012 | 4012 | } elseif ((($str[$i] & "\xF0") === "\xE0") && isset($str[$i + 2])) { |
4013 | 4013 | if ((($str[$i + 1] & "\xC0") === "\x80") && (($str[$i + 2] & "\xC0") === "\x80")) { |
4014 | - $ret[] = $str[$i] . $str[$i + 1] . $str[$i + 2]; |
|
4014 | + $ret[] = $str[$i].$str[$i + 1].$str[$i + 2]; |
|
4015 | 4015 | |
4016 | 4016 | $i += 2; |
4017 | 4017 | } |
4018 | 4018 | } elseif ((($str[$i] & "\xF8") === "\xF0") && isset($str[$i + 3])) { |
4019 | 4019 | if ((($str[$i + 1] & "\xC0") === "\x80") && (($str[$i + 2] & "\xC0") === "\x80") && (($str[$i + 3] & "\xC0") === "\x80")) { |
4020 | - $ret[] = $str[$i] . $str[$i + 1] . $str[$i + 2] . $str[$i + 3]; |
|
4020 | + $ret[] = $str[$i].$str[$i + 1].$str[$i + 2].$str[$i + 3]; |
|
4021 | 4021 | |
4022 | 4022 | $i += 3; |
4023 | 4023 | } |
@@ -4029,7 +4029,7 @@ discard block |
||
4029 | 4029 | $ret = array_chunk($ret, $length); |
4030 | 4030 | |
4031 | 4031 | return array_map( |
4032 | - function ($item) { |
|
4032 | + function($item) { |
|
4033 | 4033 | return implode('', $item); |
4034 | 4034 | }, $ret |
4035 | 4035 | ); |
@@ -4128,7 +4128,7 @@ discard block |
||
4128 | 4128 | foreach (self::$iconvEncoding as $encodingTmp) { |
4129 | 4129 | # INFO: //IGNORE and //TRANSLIT still throw notice |
4130 | 4130 | /** @noinspection PhpUsageOfSilenceOperatorInspection */ |
4131 | - if (md5(@\iconv($encodingTmp, $encodingTmp . '//IGNORE', $str)) === $md5) { |
|
4131 | + if (md5(@\iconv($encodingTmp, $encodingTmp.'//IGNORE', $str)) === $md5) { |
|
4132 | 4132 | return $encodingTmp; |
4133 | 4133 | } |
4134 | 4134 | } |
@@ -4218,7 +4218,7 @@ discard block |
||
4218 | 4218 | if ('' === $s .= '') { |
4219 | 4219 | $s = '/^(?<=.)$/'; |
4220 | 4220 | } else { |
4221 | - $s = '/' . preg_quote($s, '/') . '/ui'; |
|
4221 | + $s = '/'.preg_quote($s, '/').'/ui'; |
|
4222 | 4222 | } |
4223 | 4223 | } |
4224 | 4224 | |
@@ -4276,7 +4276,7 @@ discard block |
||
4276 | 4276 | } |
4277 | 4277 | |
4278 | 4278 | if (self::substr($str, $length - 1, 1) === ' ') { |
4279 | - return self::substr($str, 0, $length - 1) . $strAddOn; |
|
4279 | + return self::substr($str, 0, $length - 1).$strAddOn; |
|
4280 | 4280 | } |
4281 | 4281 | |
4282 | 4282 | $str = self::substr($str, 0, $length); |
@@ -4285,9 +4285,9 @@ discard block |
||
4285 | 4285 | $new_str = implode(' ', $array); |
4286 | 4286 | |
4287 | 4287 | if ($new_str === '') { |
4288 | - $str = self::substr($str, 0, $length - 1) . $strAddOn; |
|
4288 | + $str = self::substr($str, 0, $length - 1).$strAddOn; |
|
4289 | 4289 | } else { |
4290 | - $str = $new_str . $strAddOn; |
|
4290 | + $str = $new_str.$strAddOn; |
|
4291 | 4291 | } |
4292 | 4292 | |
4293 | 4293 | return $str; |
@@ -4342,7 +4342,7 @@ discard block |
||
4342 | 4342 | $pre = ''; |
4343 | 4343 | } |
4344 | 4344 | |
4345 | - return $pre . $str . $post; |
|
4345 | + return $pre.$str.$post; |
|
4346 | 4346 | } |
4347 | 4347 | |
4348 | 4348 | return $str; |
@@ -4492,7 +4492,7 @@ discard block |
||
4492 | 4492 | } |
4493 | 4493 | |
4494 | 4494 | /** @noinspection PhpInternalEntityUsedInspection */ |
4495 | - preg_match_all('/' . Grapheme::GRAPHEME_CLUSTER_RX . '/u', $str, $a); |
|
4495 | + preg_match_all('/'.Grapheme::GRAPHEME_CLUSTER_RX.'/u', $str, $a); |
|
4496 | 4496 | $a = $a[0]; |
4497 | 4497 | |
4498 | 4498 | if ($len === 1) { |
@@ -4687,7 +4687,7 @@ discard block |
||
4687 | 4687 | public static function strcmp($str1, $str2) |
4688 | 4688 | { |
4689 | 4689 | /** @noinspection PhpUndefinedClassInspection */ |
4690 | - return $str1 . '' === $str2 . '' ? 0 : strcmp( |
|
4690 | + return $str1.'' === $str2.'' ? 0 : strcmp( |
|
4691 | 4691 | \Normalizer::normalize($str1, \Normalizer::NFD), |
4692 | 4692 | \Normalizer::normalize($str2, \Normalizer::NFD) |
4693 | 4693 | ); |
@@ -4718,7 +4718,7 @@ discard block |
||
4718 | 4718 | return null; |
4719 | 4719 | } |
4720 | 4720 | |
4721 | - if (preg_match('/^(.*?)' . self::rxClass($charList) . '/us', $str, $length)) { |
|
4721 | + if (preg_match('/^(.*?)'.self::rxClass($charList).'/us', $str, $length)) { |
|
4722 | 4722 | /** @noinspection OffsetOperationsInspection */ |
4723 | 4723 | return self::strlen($length[1]); |
4724 | 4724 | } |
@@ -4925,7 +4925,7 @@ discard block |
||
4925 | 4925 | && |
4926 | 4926 | self::$support['mbstring'] === false |
4927 | 4927 | ) { |
4928 | - trigger_error('UTF8::stristr() without mbstring cannot handle "' . $encoding . '" encoding', E_USER_WARNING); |
|
4928 | + trigger_error('UTF8::stristr() without mbstring cannot handle "'.$encoding.'" encoding', E_USER_WARNING); |
|
4929 | 4929 | } |
4930 | 4930 | |
4931 | 4931 | if (self::$support['mbstring'] === true) { |
@@ -4936,7 +4936,7 @@ discard block |
||
4936 | 4936 | return \grapheme_stristr($haystack, $needle, $before_needle); |
4937 | 4937 | } |
4938 | 4938 | |
4939 | - preg_match('/^(.*?)' . preg_quote($needle, '/') . '/usi', $haystack, $match); |
|
4939 | + preg_match('/^(.*?)'.preg_quote($needle, '/').'/usi', $haystack, $match); |
|
4940 | 4940 | |
4941 | 4941 | if (!isset($match[1])) { |
4942 | 4942 | return false; |
@@ -5000,7 +5000,7 @@ discard block |
||
5000 | 5000 | && |
5001 | 5001 | self::$support['iconv'] === false |
5002 | 5002 | ) { |
5003 | - trigger_error('UTF8::strlen() without mbstring / iconv cannot handle "' . $encoding . '" encoding', E_USER_WARNING); |
|
5003 | + trigger_error('UTF8::strlen() without mbstring / iconv cannot handle "'.$encoding.'" encoding', E_USER_WARNING); |
|
5004 | 5004 | } |
5005 | 5005 | |
5006 | 5006 | if ( |
@@ -5079,7 +5079,7 @@ discard block |
||
5079 | 5079 | */ |
5080 | 5080 | public static function strnatcmp($str1, $str2) |
5081 | 5081 | { |
5082 | - return $str1 . '' === $str2 . '' ? 0 : strnatcmp(self::strtonatfold($str1), self::strtonatfold($str2)); |
|
5082 | + return $str1.'' === $str2.'' ? 0 : strnatcmp(self::strtonatfold($str1), self::strtonatfold($str2)); |
|
5083 | 5083 | } |
5084 | 5084 | |
5085 | 5085 | /** |
@@ -5140,7 +5140,7 @@ discard block |
||
5140 | 5140 | return false; |
5141 | 5141 | } |
5142 | 5142 | |
5143 | - if (preg_match('/' . self::rxClass($char_list) . '/us', $haystack, $m)) { |
|
5143 | + if (preg_match('/'.self::rxClass($char_list).'/us', $haystack, $m)) { |
|
5144 | 5144 | return substr($haystack, strpos($haystack, $m[0])); |
5145 | 5145 | } else { |
5146 | 5146 | return false; |
@@ -5209,7 +5209,7 @@ discard block |
||
5209 | 5209 | && |
5210 | 5210 | self::$support['mbstring'] === false |
5211 | 5211 | ) { |
5212 | - trigger_error('UTF8::strpos() without mbstring / iconv cannot handle "' . $encoding . '" encoding', E_USER_WARNING); |
|
5212 | + trigger_error('UTF8::strpos() without mbstring / iconv cannot handle "'.$encoding.'" encoding', E_USER_WARNING); |
|
5213 | 5213 | } |
5214 | 5214 | |
5215 | 5215 | if ( |
@@ -5425,7 +5425,7 @@ discard block |
||
5425 | 5425 | && |
5426 | 5426 | self::$support['mbstring'] === false |
5427 | 5427 | ) { |
5428 | - trigger_error('UTF8::strripos() without mbstring cannot handle "' . $encoding . '" encoding', E_USER_WARNING); |
|
5428 | + trigger_error('UTF8::strripos() without mbstring cannot handle "'.$encoding.'" encoding', E_USER_WARNING); |
|
5429 | 5429 | } |
5430 | 5430 | |
5431 | 5431 | if (self::$support['mbstring'] === true) { |
@@ -5505,7 +5505,7 @@ discard block |
||
5505 | 5505 | && |
5506 | 5506 | self::$support['mbstring'] === false |
5507 | 5507 | ) { |
5508 | - trigger_error('UTF8::strrpos() without mbstring cannot handle "' . $encoding . '" encoding', E_USER_WARNING); |
|
5508 | + trigger_error('UTF8::strrpos() without mbstring cannot handle "'.$encoding.'" encoding', E_USER_WARNING); |
|
5509 | 5509 | } |
5510 | 5510 | |
5511 | 5511 | if (self::$support['mbstring'] === true) { |
@@ -5565,7 +5565,7 @@ discard block |
||
5565 | 5565 | return 0; |
5566 | 5566 | } |
5567 | 5567 | |
5568 | - return preg_match('/^' . self::rxClass($mask) . '+/u', $str, $str) ? self::strlen($str[0]) : 0; |
|
5568 | + return preg_match('/^'.self::rxClass($mask).'+/u', $str, $str) ? self::strlen($str[0]) : 0; |
|
5569 | 5569 | } |
5570 | 5570 | |
5571 | 5571 | /** |
@@ -5611,7 +5611,7 @@ discard block |
||
5611 | 5611 | && |
5612 | 5612 | self::$support['mbstring'] === false |
5613 | 5613 | ) { |
5614 | - trigger_error('UTF8::strstr() without mbstring cannot handle "' . $encoding . '" encoding', E_USER_WARNING); |
|
5614 | + trigger_error('UTF8::strstr() without mbstring cannot handle "'.$encoding.'" encoding', E_USER_WARNING); |
|
5615 | 5615 | } |
5616 | 5616 | |
5617 | 5617 | if (self::$support['mbstring'] === true) { |
@@ -5628,7 +5628,7 @@ discard block |
||
5628 | 5628 | } |
5629 | 5629 | } |
5630 | 5630 | |
5631 | - preg_match('/^(.*?)' . preg_quote($needle, '/') . '/us', $haystack, $match); |
|
5631 | + preg_match('/^(.*?)'.preg_quote($needle, '/').'/us', $haystack, $match); |
|
5632 | 5632 | |
5633 | 5633 | if (!isset($match[1])) { |
5634 | 5634 | return false; |
@@ -5892,7 +5892,7 @@ discard block |
||
5892 | 5892 | && |
5893 | 5893 | self::$support['mbstring'] === false |
5894 | 5894 | ) { |
5895 | - trigger_error('UTF8::substr() without mbstring cannot handle "' . $encoding . '" encoding', E_USER_WARNING); |
|
5895 | + trigger_error('UTF8::substr() without mbstring cannot handle "'.$encoding.'" encoding', E_USER_WARNING); |
|
5896 | 5896 | } |
5897 | 5897 | |
5898 | 5898 | if (self::$support['mbstring'] === true) { |
@@ -6005,14 +6005,14 @@ discard block |
||
6005 | 6005 | && |
6006 | 6006 | self::$support['mbstring'] === false |
6007 | 6007 | ) { |
6008 | - trigger_error('UTF8::substr_count() without mbstring cannot handle "' . $encoding . '" encoding', E_USER_WARNING); |
|
6008 | + trigger_error('UTF8::substr_count() without mbstring cannot handle "'.$encoding.'" encoding', E_USER_WARNING); |
|
6009 | 6009 | } |
6010 | 6010 | |
6011 | 6011 | if (self::$support['mbstring'] === true) { |
6012 | 6012 | return \mb_substr_count($haystack, $needle, $encoding); |
6013 | 6013 | } |
6014 | 6014 | |
6015 | - preg_match_all('/' . preg_quote($needle, '/') . '/us', $haystack, $matches, PREG_SET_ORDER); |
|
6015 | + preg_match_all('/'.preg_quote($needle, '/').'/us', $haystack, $matches, PREG_SET_ORDER); |
|
6016 | 6016 | |
6017 | 6017 | return count($matches); |
6018 | 6018 | } |
@@ -6259,7 +6259,7 @@ discard block |
||
6259 | 6259 | |
6260 | 6260 | $strSwappedCase = preg_replace_callback( |
6261 | 6261 | '/[\S]/u', |
6262 | - function ($match) use ($encoding) { |
|
6262 | + function($match) use ($encoding) { |
|
6263 | 6263 | $marchToUpper = UTF8::strtoupper($match[0], $encoding); |
6264 | 6264 | |
6265 | 6265 | if ($match[0] === $marchToUpper) { |
@@ -6589,40 +6589,40 @@ discard block |
||
6589 | 6589 | if ($c1 >= "\xc0" & $c1 <= "\xdf") { // looks like 2 bytes UTF8 |
6590 | 6590 | |
6591 | 6591 | if ($c2 >= "\x80" && $c2 <= "\xbf") { // yeah, almost sure it's UTF8 already |
6592 | - $buf .= $c1 . $c2; |
|
6592 | + $buf .= $c1.$c2; |
|
6593 | 6593 | $i++; |
6594 | 6594 | } else { // not valid UTF8 - convert it |
6595 | 6595 | $cc1 = (chr(ord($c1) / 64) | "\xc0"); |
6596 | 6596 | $cc2 = ($c1 & "\x3f") | "\x80"; |
6597 | - $buf .= $cc1 . $cc2; |
|
6597 | + $buf .= $cc1.$cc2; |
|
6598 | 6598 | } |
6599 | 6599 | |
6600 | 6600 | } elseif ($c1 >= "\xe0" & $c1 <= "\xef") { // looks like 3 bytes UTF8 |
6601 | 6601 | |
6602 | 6602 | if ($c2 >= "\x80" && $c2 <= "\xbf" && $c3 >= "\x80" && $c3 <= "\xbf") { // yeah, almost sure it's UTF8 already |
6603 | - $buf .= $c1 . $c2 . $c3; |
|
6603 | + $buf .= $c1.$c2.$c3; |
|
6604 | 6604 | $i += 2; |
6605 | 6605 | } else { // not valid UTF8 - convert it |
6606 | 6606 | $cc1 = (chr(ord($c1) / 64) | "\xc0"); |
6607 | 6607 | $cc2 = ($c1 & "\x3f") | "\x80"; |
6608 | - $buf .= $cc1 . $cc2; |
|
6608 | + $buf .= $cc1.$cc2; |
|
6609 | 6609 | } |
6610 | 6610 | |
6611 | 6611 | } elseif ($c1 >= "\xf0" & $c1 <= "\xf7") { // looks like 4 bytes UTF8 |
6612 | 6612 | |
6613 | 6613 | if ($c2 >= "\x80" && $c2 <= "\xbf" && $c3 >= "\x80" && $c3 <= "\xbf" && $c4 >= "\x80" && $c4 <= "\xbf") { // yeah, almost sure it's UTF8 already |
6614 | - $buf .= $c1 . $c2 . $c3 . $c4; |
|
6614 | + $buf .= $c1.$c2.$c3.$c4; |
|
6615 | 6615 | $i += 3; |
6616 | 6616 | } else { // not valid UTF8 - convert it |
6617 | 6617 | $cc1 = (chr(ord($c1) / 64) | "\xc0"); |
6618 | 6618 | $cc2 = ($c1 & "\x3f") | "\x80"; |
6619 | - $buf .= $cc1 . $cc2; |
|
6619 | + $buf .= $cc1.$cc2; |
|
6620 | 6620 | } |
6621 | 6621 | |
6622 | 6622 | } else { // doesn't look like UTF8, but should be converted |
6623 | 6623 | $cc1 = (chr(ord($c1) / 64) | "\xc0"); |
6624 | 6624 | $cc2 = (($c1 & "\x3f") | "\x80"); |
6625 | - $buf .= $cc1 . $cc2; |
|
6625 | + $buf .= $cc1.$cc2; |
|
6626 | 6626 | } |
6627 | 6627 | |
6628 | 6628 | } elseif (($c1 & "\xc0") === "\x80") { // needs conversion |
@@ -6633,7 +6633,7 @@ discard block |
||
6633 | 6633 | } else { |
6634 | 6634 | $cc1 = (chr($ordC1 / 64) | "\xc0"); |
6635 | 6635 | $cc2 = (($c1 & "\x3f") | "\x80"); |
6636 | - $buf .= $cc1 . $cc2; |
|
6636 | + $buf .= $cc1.$cc2; |
|
6637 | 6637 | } |
6638 | 6638 | |
6639 | 6639 | } else { // it doesn't need conversion |
@@ -6644,7 +6644,7 @@ discard block |
||
6644 | 6644 | // decode unicode escape sequences |
6645 | 6645 | $buf = preg_replace_callback( |
6646 | 6646 | '/\\\\u([0-9a-f]{4})/i', |
6647 | - function ($match) { |
|
6647 | + function($match) { |
|
6648 | 6648 | return \mb_convert_encoding(pack('H*', $match[1]), 'UTF-8', 'UCS-2BE'); |
6649 | 6649 | }, |
6650 | 6650 | $buf |
@@ -6698,7 +6698,7 @@ discard block |
||
6698 | 6698 | */ |
6699 | 6699 | public static function ucfirst($str, $encoding = 'UTF-8', $cleanUtf8 = false) |
6700 | 6700 | { |
6701 | - return self::strtoupper(self::substr($str, 0, 1, $encoding, $cleanUtf8), $encoding, $cleanUtf8) . self::substr($str, 1, null, $encoding, $cleanUtf8); |
|
6701 | + return self::strtoupper(self::substr($str, 0, 1, $encoding, $cleanUtf8), $encoding, $cleanUtf8).self::substr($str, 1, null, $encoding, $cleanUtf8); |
|
6702 | 6702 | } |
6703 | 6703 | |
6704 | 6704 | /** |
@@ -7175,7 +7175,7 @@ discard block |
||
7175 | 7175 | return ''; |
7176 | 7176 | } |
7177 | 7177 | |
7178 | - preg_match('/^\s*+(?:\S++\s*+){1,' . $words . '}/u', $str, $matches); |
|
7178 | + preg_match('/^\s*+(?:\S++\s*+){1,'.$words.'}/u', $str, $matches); |
|
7179 | 7179 | |
7180 | 7180 | if ( |
7181 | 7181 | !isset($matches[0]) |
@@ -7185,7 +7185,7 @@ discard block |
||
7185 | 7185 | return $str; |
7186 | 7186 | } |
7187 | 7187 | |
7188 | - return self::rtrim($matches[0]) . $strAddOn; |
|
7188 | + return self::rtrim($matches[0]).$strAddOn; |
|
7189 | 7189 | } |
7190 | 7190 | |
7191 | 7191 | /** |
@@ -7253,7 +7253,7 @@ discard block |
||
7253 | 7253 | $strReturn .= $break; |
7254 | 7254 | } |
7255 | 7255 | |
7256 | - return $strReturn . implode('', $chars); |
|
7256 | + return $strReturn.implode('', $chars); |
|
7257 | 7257 | } |
7258 | 7258 | |
7259 | 7259 | /** |
@@ -94,7 +94,7 @@ discard block |
||
94 | 94 | |
95 | 95 | $uri = preg_replace_callback( |
96 | 96 | '/[\x80-\xFF]+/', |
97 | - function ($m) { |
|
97 | + function($m) { |
|
98 | 98 | return urlencode($m[0]); |
99 | 99 | }, |
100 | 100 | $uri |
@@ -102,7 +102,7 @@ discard block |
||
102 | 102 | |
103 | 103 | $uri = preg_replace_callback( |
104 | 104 | '/(?:%[89A-F][0-9A-F])+/i', |
105 | - function ($m) { |
|
105 | + function($m) { |
|
106 | 106 | return urlencode(UTF8::encode('UTF-8', urldecode($m[0]))); |
107 | 107 | }, |
108 | 108 | $uri |
@@ -117,8 +117,8 @@ discard block |
||
117 | 117 | ) { |
118 | 118 | // Use ob_start() to buffer content and avoid problem of headers already sent... |
119 | 119 | $severProtocol = (isset($_SERVER['SERVER_PROTOCOL']) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.1'); |
120 | - header($severProtocol . ' 301 Moved Permanently'); |
|
121 | - header('Location: ' . $uri); |
|
120 | + header($severProtocol.' 301 Moved Permanently'); |
|
121 | + header('Location: '.$uri); |
|
122 | 122 | exit(); |
123 | 123 | } |
124 | 124 |
@@ -217,6 +217,6 @@ |
||
217 | 217 | ), |
218 | 218 | ); |
219 | 219 | |
220 | -$result =& $data; |
|
220 | +$result = & $data; |
|
221 | 221 | unset($data); |
222 | 222 | return $result; |
@@ -217,6 +217,6 @@ |
||
217 | 217 | ), |
218 | 218 | ); |
219 | 219 | |
220 | -$result =& $data; |
|
220 | +$result = & $data; |
|
221 | 221 | unset($data); |
222 | 222 | return $result; |
@@ -217,6 +217,6 @@ |
||
217 | 217 | ), |
218 | 218 | ); |
219 | 219 | |
220 | -$result =& $data; |
|
220 | +$result = & $data; |
|
221 | 221 | unset($data); |
222 | 222 | return $result; |
@@ -217,6 +217,6 @@ |
||
217 | 217 | ), |
218 | 218 | ); |
219 | 219 | |
220 | -$result =& $data; |
|
220 | +$result = & $data; |
|
221 | 221 | unset($data); |
222 | 222 | return $result; |
@@ -217,6 +217,6 @@ |
||
217 | 217 | ), |
218 | 218 | ); |
219 | 219 | |
220 | -$result =& $data; |
|
220 | +$result = & $data; |
|
221 | 221 | unset($data); |
222 | 222 | return $result; |
@@ -217,6 +217,6 @@ |
||
217 | 217 | ), |
218 | 218 | ); |
219 | 219 | |
220 | -$result =& $data; |
|
220 | +$result = & $data; |
|
221 | 221 | unset($data); |
222 | 222 | return $result; |