@@ -19,6 +19,6 @@ |
||
| 19 | 19 | 'mu', 'me', 'mo', 'ya', 'yu', 'yo', 'ra', 'ri', 'ru', 're', 'ro', 'wa', 'wi', 'we', 'wo', |
| 20 | 20 | ); |
| 21 | 21 | |
| 22 | -$result =& $data; |
|
| 22 | +$result = & $data; |
|
| 23 | 23 | unset($data); |
| 24 | 24 | return $result; |
@@ -19,6 +19,6 @@ |
||
| 19 | 19 | 'Lao ', 'Bo ', 'Zhe ', 'Zha ', 'Liang ', 'Ba ', 'Mie ', 'Le ', 'Sui ', 'Fou ', 'Bu ', 'Han ', 'Heng ', 'Geng ', 'Shuo ', 'Ge ', |
| 20 | 20 | ); |
| 21 | 21 | |
| 22 | -$result =& $data; |
|
| 22 | +$result = & $data; |
|
| 23 | 23 | unset($data); |
| 24 | 24 | return $result; |
@@ -19,6 +19,6 @@ |
||
| 19 | 19 | 'maels', 'maelt', 'maelp', 'maelh', 'maem', 'maeb', 'maebs', 'maes', 'maess', 'maeng', 'maej', 'maec', 'maek', 'maet', 'maep', 'maeh', |
| 20 | 20 | ); |
| 21 | 21 | |
| 22 | -$result =& $data; |
|
| 22 | +$result = & $data; |
|
| 23 | 23 | unset($data); |
| 24 | 24 | return $result; |
@@ -19,6 +19,6 @@ |
||
| 19 | 19 | 'ggek', 'gget', 'ggep', 'ggeh', 'ggyeo', 'ggyeog', 'ggyeogg', 'ggyeogs', 'ggyeon', 'ggyeonj', 'ggyeonh', 'ggyeod', 'ggyeol', 'ggyeolg', 'ggyeolm', 'ggyeolb', |
| 20 | 20 | ); |
| 21 | 21 | |
| 22 | -$result =& $data; |
|
| 22 | +$result = & $data; |
|
| 23 | 23 | unset($data); |
| 24 | 24 | return $result; |
@@ -19,6 +19,6 @@ |
||
| 19 | 19 | 'jjass', 'jjang', 'jjaj', 'jjac', 'jjak', 'jjat', 'jjap', 'jjah', 'jjae', 'jjaeg', 'jjaegg', 'jjaegs', 'jjaen', 'jjaenj', 'jjaenh', 'jjaed', |
| 20 | 20 | ); |
| 21 | 21 | |
| 22 | -$result =& $data; |
|
| 22 | +$result = & $data; |
|
| 23 | 23 | unset($data); |
| 24 | 24 | return $result; |
@@ -19,6 +19,6 @@ |
||
| 19 | 19 | 'siss', 'sing', 'sij', 'sic', 'sik', 'sit', 'sip', 'sih', 'ssa', 'ssag', 'ssagg', 'ssags', 'ssan', 'ssanj', 'ssanh', 'ssad', |
| 20 | 20 | ); |
| 21 | 21 | |
| 22 | -$result =& $data; |
|
| 22 | +$result = & $data; |
|
| 23 | 23 | unset($data); |
| 24 | 24 | return $result; |
@@ -95,7 +95,7 @@ discard block |
||
| 95 | 95 | |
| 96 | 96 | $uri = preg_replace_callback( |
| 97 | 97 | '/[\x80-\xFF]+/', |
| 98 | - function ($m) { |
|
| 98 | + function($m) { |
|
| 99 | 99 | return urlencode($m[0]); |
| 100 | 100 | }, |
| 101 | 101 | $uri |
@@ -103,7 +103,7 @@ discard block |
||
| 103 | 103 | |
| 104 | 104 | $uri = preg_replace_callback( |
| 105 | 105 | '/(?:%[89A-F][0-9A-F])+/i', |
| 106 | - function ($m) { |
|
| 106 | + function($m) { |
|
| 107 | 107 | return urlencode(UTF8::encode('UTF-8', urldecode($m[0]))); |
| 108 | 108 | }, |
| 109 | 109 | $uri |
@@ -118,8 +118,8 @@ discard block |
||
| 118 | 118 | ) { |
| 119 | 119 | // Use ob_start() to buffer content and avoid problem of headers already sent... |
| 120 | 120 | $severProtocol = (isset($_SERVER['SERVER_PROTOCOL']) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.1'); |
| 121 | - header($severProtocol . ' 301 Moved Permanently'); |
|
| 122 | - header('Location: ' . $uri); |
|
| 121 | + header($severProtocol.' 301 Moved Permanently'); |
|
| 122 | + header('Location: '.$uri); |
|
| 123 | 123 | exit(); |
| 124 | 124 | } |
| 125 | 125 | |
@@ -155,7 +155,7 @@ discard block |
||
| 155 | 155 | return false; |
| 156 | 156 | } |
| 157 | 157 | |
| 158 | - $length = (int)$length; |
|
| 158 | + $length = (int) $length; |
|
| 159 | 159 | |
| 160 | 160 | if ($length <= 0) { |
| 161 | 161 | return false; |
@@ -185,7 +185,7 @@ discard block |
||
| 185 | 185 | { |
| 186 | 186 | static $_IS_PHP; |
| 187 | 187 | |
| 188 | - $version = (string)$version; |
|
| 188 | + $version = (string) $version; |
|
| 189 | 189 | |
| 190 | 190 | if (!isset($_IS_PHP[$version])) { |
| 191 | 191 | $_IS_PHP[$version] = version_compare(PHP_VERSION, $version, '>='); |
@@ -828,19 +828,19 @@ discard block |
||
| 828 | 828 | */ |
| 829 | 829 | public static function access($str, $pos) |
| 830 | 830 | { |
| 831 | - $str = (string)$str; |
|
| 831 | + $str = (string) $str; |
|
| 832 | 832 | |
| 833 | 833 | if (!isset($str[0])) { |
| 834 | 834 | return ''; |
| 835 | 835 | } |
| 836 | 836 | |
| 837 | - $pos = (int)$pos; |
|
| 837 | + $pos = (int) $pos; |
|
| 838 | 838 | |
| 839 | 839 | if ($pos < 0) { |
| 840 | 840 | return ''; |
| 841 | 841 | } |
| 842 | 842 | |
| 843 | - return (string)self::substr($str, $pos, 1); |
|
| 843 | + return (string) self::substr($str, $pos, 1); |
|
| 844 | 844 | } |
| 845 | 845 | |
| 846 | 846 | /** |
@@ -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; |
@@ -973,14 +973,14 @@ discard block |
||
| 973 | 973 | } |
| 974 | 974 | |
| 975 | 975 | // check type of code_point, only if there is no support for "\IntlChar" |
| 976 | - $i = (int)$code_point; |
|
| 976 | + $i = (int) $code_point; |
|
| 977 | 977 | if ($i !== $code_point) { |
| 978 | 978 | return null; |
| 979 | 979 | } |
| 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 | |
@@ -1018,7 +1018,7 @@ discard block |
||
| 1018 | 1018 | */ |
| 1019 | 1019 | private static function chr_and_parse_int($int) |
| 1020 | 1020 | { |
| 1021 | - return chr((int)$int); |
|
| 1021 | + return chr((int) $int); |
|
| 1022 | 1022 | } |
| 1023 | 1023 | |
| 1024 | 1024 | /** |
@@ -1050,14 +1050,14 @@ discard block |
||
| 1050 | 1050 | */ |
| 1051 | 1051 | public static function chr_size_list($str) |
| 1052 | 1052 | { |
| 1053 | - $str = (string)$str; |
|
| 1053 | + $str = (string) $str; |
|
| 1054 | 1054 | |
| 1055 | 1055 | if (!isset($str[0])) { |
| 1056 | 1056 | return array(); |
| 1057 | 1057 | } |
| 1058 | 1058 | |
| 1059 | 1059 | return array_map( |
| 1060 | - function ($data) { |
|
| 1060 | + function($data) { |
|
| 1061 | 1061 | return UTF8::strlen($data, '8BIT'); |
| 1062 | 1062 | }, |
| 1063 | 1063 | self::split($str) |
@@ -1073,7 +1073,7 @@ discard block |
||
| 1073 | 1073 | */ |
| 1074 | 1074 | public static function chr_to_decimal($char) |
| 1075 | 1075 | { |
| 1076 | - $char = (string)$char; |
|
| 1076 | + $char = (string) $char; |
|
| 1077 | 1077 | $code = self::ord($char[0]); |
| 1078 | 1078 | $bytes = 1; |
| 1079 | 1079 | |
@@ -1114,7 +1114,7 @@ discard block |
||
| 1114 | 1114 | */ |
| 1115 | 1115 | public static function chr_to_hex($char, $pfix = 'U+') |
| 1116 | 1116 | { |
| 1117 | - $char = (string)$char; |
|
| 1117 | + $char = (string) $char; |
|
| 1118 | 1118 | |
| 1119 | 1119 | if (!isset($char[0])) { |
| 1120 | 1120 | return ''; |
@@ -1213,7 +1213,7 @@ discard block |
||
| 1213 | 1213 | */ |
| 1214 | 1214 | public static function cleanup($str) |
| 1215 | 1215 | { |
| 1216 | - $str = (string)$str; |
|
| 1216 | + $str = (string) $str; |
|
| 1217 | 1217 | |
| 1218 | 1218 | if (!isset($str[0])) { |
| 1219 | 1219 | return ''; |
@@ -1229,7 +1229,7 @@ discard block |
||
| 1229 | 1229 | // && normalize whitespace chars (but keep non-breaking-spaces) |
| 1230 | 1230 | $str = self::clean($str, true, true, false, true); |
| 1231 | 1231 | |
| 1232 | - return (string)$str; |
|
| 1232 | + return (string) $str; |
|
| 1233 | 1233 | } |
| 1234 | 1234 | |
| 1235 | 1235 | /** |
@@ -1299,7 +1299,7 @@ discard block |
||
| 1299 | 1299 | $flags = ENT_QUOTES; |
| 1300 | 1300 | } |
| 1301 | 1301 | |
| 1302 | - return self::html_entity_decode('&#' . $int . ';', $flags); |
|
| 1302 | + return self::html_entity_decode('&#'.$int.';', $flags); |
|
| 1303 | 1303 | } |
| 1304 | 1304 | |
| 1305 | 1305 | /** |
@@ -1317,8 +1317,8 @@ discard block |
||
| 1317 | 1317 | */ |
| 1318 | 1318 | public static function encode($encoding, $str, $force = true) |
| 1319 | 1319 | { |
| 1320 | - $str = (string)$str; |
|
| 1321 | - $encoding = (string)$encoding; |
|
| 1320 | + $str = (string) $str; |
|
| 1321 | + $encoding = (string) $encoding; |
|
| 1322 | 1322 | |
| 1323 | 1323 | if (!isset($str[0], $encoding[0])) { |
| 1324 | 1324 | return $str; |
@@ -1376,7 +1376,7 @@ discard block |
||
| 1376 | 1376 | && |
| 1377 | 1377 | self::$SUPPORT['mbstring'] === false |
| 1378 | 1378 | ) { |
| 1379 | - trigger_error('UTF8::encode() without mbstring cannot handle "' . $encoding . '" encoding', E_USER_WARNING); |
|
| 1379 | + trigger_error('UTF8::encode() without mbstring cannot handle "'.$encoding.'" encoding', E_USER_WARNING); |
|
| 1380 | 1380 | } |
| 1381 | 1381 | |
| 1382 | 1382 | $strEncoded = \mb_convert_encoding( |
@@ -1478,7 +1478,7 @@ discard block |
||
| 1478 | 1478 | public static function file_get_contents($filename, $flags = null, $context = null, $offset = null, $maxLength = null, $timeout = 10, $convertToUtf8 = true) |
| 1479 | 1479 | { |
| 1480 | 1480 | // init |
| 1481 | - $timeout = (int)$timeout; |
|
| 1481 | + $timeout = (int) $timeout; |
|
| 1482 | 1482 | $filename = filter_var($filename, FILTER_SANITIZE_STRING); |
| 1483 | 1483 | |
| 1484 | 1484 | if ($timeout && $context === null) { |
@@ -1585,7 +1585,7 @@ discard block |
||
| 1585 | 1585 | ) { |
| 1586 | 1586 | // Prevent leading combining chars |
| 1587 | 1587 | // for NFC-safe concatenations. |
| 1588 | - $var = $leading_combining . $var; |
|
| 1588 | + $var = $leading_combining.$var; |
|
| 1589 | 1589 | } |
| 1590 | 1590 | } |
| 1591 | 1591 | |
@@ -1828,7 +1828,7 @@ discard block |
||
| 1828 | 1828 | public static function fix_simple_utf8($str) |
| 1829 | 1829 | { |
| 1830 | 1830 | // init |
| 1831 | - $str = (string)$str; |
|
| 1831 | + $str = (string) $str; |
|
| 1832 | 1832 | |
| 1833 | 1833 | if (!isset($str[0])) { |
| 1834 | 1834 | return ''; |
@@ -2009,7 +2009,7 @@ discard block |
||
| 2009 | 2009 | */ |
| 2010 | 2010 | private static function getData($file) |
| 2011 | 2011 | { |
| 2012 | - $file = __DIR__ . '/data/' . $file . '.php'; |
|
| 2012 | + $file = __DIR__.'/data/'.$file.'.php'; |
|
| 2013 | 2013 | if (file_exists($file)) { |
| 2014 | 2014 | /** @noinspection PhpIncludeInspection */ |
| 2015 | 2015 | return require $file; |
@@ -2083,7 +2083,7 @@ discard block |
||
| 2083 | 2083 | */ |
| 2084 | 2084 | public static function hex_to_int($hexDec) |
| 2085 | 2085 | { |
| 2086 | - $hexDec = (string)$hexDec; |
|
| 2086 | + $hexDec = (string) $hexDec; |
|
| 2087 | 2087 | |
| 2088 | 2088 | if (!isset($hexDec[0])) { |
| 2089 | 2089 | return false; |
@@ -2126,7 +2126,7 @@ discard block |
||
| 2126 | 2126 | public static function html_encode($str, $keepAsciiChars = false, $encoding = 'UTF-8') |
| 2127 | 2127 | { |
| 2128 | 2128 | // init |
| 2129 | - $str = (string)$str; |
|
| 2129 | + $str = (string) $str; |
|
| 2130 | 2130 | |
| 2131 | 2131 | if (!isset($str[0])) { |
| 2132 | 2132 | return ''; |
@@ -2154,7 +2154,7 @@ discard block |
||
| 2154 | 2154 | return implode( |
| 2155 | 2155 | '', |
| 2156 | 2156 | array_map( |
| 2157 | - function ($data) use ($keepAsciiChars, $encoding) { |
|
| 2157 | + function($data) use ($keepAsciiChars, $encoding) { |
|
| 2158 | 2158 | return UTF8::single_chr_html_encode($data, $keepAsciiChars, $encoding); |
| 2159 | 2159 | }, |
| 2160 | 2160 | self::split($str) |
@@ -2234,7 +2234,7 @@ discard block |
||
| 2234 | 2234 | public static function html_entity_decode($str, $flags = null, $encoding = 'UTF-8') |
| 2235 | 2235 | { |
| 2236 | 2236 | // init |
| 2237 | - $str = (string)$str; |
|
| 2237 | + $str = (string) $str; |
|
| 2238 | 2238 | |
| 2239 | 2239 | if (!isset($str[0])) { |
| 2240 | 2240 | return ''; |
@@ -2273,7 +2273,7 @@ discard block |
||
| 2273 | 2273 | |
| 2274 | 2274 | $str = preg_replace_callback( |
| 2275 | 2275 | "/&#\d{2,6};/", |
| 2276 | - function ($matches) use ($encoding) { |
|
| 2276 | + function($matches) use ($encoding) { |
|
| 2277 | 2277 | $returnTmp = \mb_convert_encoding($matches[0], $encoding, 'HTML-ENTITIES'); |
| 2278 | 2278 | |
| 2279 | 2279 | if ($returnTmp !== '"' && $returnTmp !== "'") { |
@@ -2594,12 +2594,12 @@ discard block |
||
| 2594 | 2594 | */ |
| 2595 | 2595 | public static function int_to_hex($int, $pfix = 'U+') |
| 2596 | 2596 | { |
| 2597 | - if ((int)$int === $int) { |
|
| 2597 | + if ((int) $int === $int) { |
|
| 2598 | 2598 | $hex = dechex($int); |
| 2599 | 2599 | |
| 2600 | - $hex = (strlen($hex) < 4 ? substr('0000' . $hex, -4) : $hex); |
|
| 2600 | + $hex = (strlen($hex) < 4 ? substr('0000'.$hex, -4) : $hex); |
|
| 2601 | 2601 | |
| 2602 | - return $pfix . $hex; |
|
| 2602 | + return $pfix.$hex; |
|
| 2603 | 2603 | } |
| 2604 | 2604 | |
| 2605 | 2605 | return ''; |
@@ -2786,13 +2786,13 @@ discard block |
||
| 2786 | 2786 | */ |
| 2787 | 2787 | public static function is_ascii($str) |
| 2788 | 2788 | { |
| 2789 | - $str = (string)$str; |
|
| 2789 | + $str = (string) $str; |
|
| 2790 | 2790 | |
| 2791 | 2791 | if (!isset($str[0])) { |
| 2792 | 2792 | return true; |
| 2793 | 2793 | } |
| 2794 | 2794 | |
| 2795 | - return (bool)!preg_match('/[^\x09\x10\x13\x0A\x0D\x20-\x7E]/', $str); |
|
| 2795 | + return (bool) !preg_match('/[^\x09\x10\x13\x0A\x0D\x20-\x7E]/', $str); |
|
| 2796 | 2796 | } |
| 2797 | 2797 | |
| 2798 | 2798 | /** |
@@ -2804,13 +2804,13 @@ discard block |
||
| 2804 | 2804 | */ |
| 2805 | 2805 | public static function is_base64($str) |
| 2806 | 2806 | { |
| 2807 | - $str = (string)$str; |
|
| 2807 | + $str = (string) $str; |
|
| 2808 | 2808 | |
| 2809 | 2809 | if (!isset($str[0])) { |
| 2810 | 2810 | return false; |
| 2811 | 2811 | } |
| 2812 | 2812 | |
| 2813 | - $base64String = (string)base64_decode($str, true); |
|
| 2813 | + $base64String = (string) base64_decode($str, true); |
|
| 2814 | 2814 | if ($base64String && base64_encode($base64String) === $str) { |
| 2815 | 2815 | return true; |
| 2816 | 2816 | } |
@@ -2827,7 +2827,7 @@ discard block |
||
| 2827 | 2827 | */ |
| 2828 | 2828 | public static function is_binary($input) |
| 2829 | 2829 | { |
| 2830 | - $input = (string)$input; |
|
| 2830 | + $input = (string) $input; |
|
| 2831 | 2831 | |
| 2832 | 2832 | if (!isset($input[0])) { |
| 2833 | 2833 | return false; |
@@ -2898,7 +2898,7 @@ discard block |
||
| 2898 | 2898 | */ |
| 2899 | 2899 | public static function is_html($str) |
| 2900 | 2900 | { |
| 2901 | - $str = (string)$str; |
|
| 2901 | + $str = (string) $str; |
|
| 2902 | 2902 | |
| 2903 | 2903 | if (!isset($str[0])) { |
| 2904 | 2904 | return false; |
@@ -2925,7 +2925,7 @@ discard block |
||
| 2925 | 2925 | */ |
| 2926 | 2926 | public static function is_json($str) |
| 2927 | 2927 | { |
| 2928 | - $str = (string)$str; |
|
| 2928 | + $str = (string) $str; |
|
| 2929 | 2929 | |
| 2930 | 2930 | if (!isset($str[0])) { |
| 2931 | 2931 | return false; |
@@ -3080,7 +3080,7 @@ discard block |
||
| 3080 | 3080 | */ |
| 3081 | 3081 | public static function is_utf8($str, $strict = false) |
| 3082 | 3082 | { |
| 3083 | - $str = (string)$str; |
|
| 3083 | + $str = (string) $str; |
|
| 3084 | 3084 | |
| 3085 | 3085 | if (!isset($str[0])) { |
| 3086 | 3086 | return true; |
@@ -3258,7 +3258,7 @@ discard block |
||
| 3258 | 3258 | */ |
| 3259 | 3259 | public static function json_decode($json, $assoc = false, $depth = 512, $options = 0) |
| 3260 | 3260 | { |
| 3261 | - $json = (string)self::filter($json); |
|
| 3261 | + $json = (string) self::filter($json); |
|
| 3262 | 3262 | |
| 3263 | 3263 | if (Bootup::is_php('5.4') === true) { |
| 3264 | 3264 | $json = json_decode($json, $assoc, $depth, $options); |
@@ -3335,12 +3335,12 @@ discard block |
||
| 3335 | 3335 | } |
| 3336 | 3336 | |
| 3337 | 3337 | $strPartOne = self::strtolower( |
| 3338 | - (string)self::substr($str, 0, 1, $encoding, $cleanUtf8), |
|
| 3338 | + (string) self::substr($str, 0, 1, $encoding, $cleanUtf8), |
|
| 3339 | 3339 | $encoding, |
| 3340 | 3340 | $cleanUtf8 |
| 3341 | 3341 | ); |
| 3342 | 3342 | |
| 3343 | - return $strPartOne . $strPartTwo; |
|
| 3343 | + return $strPartOne.$strPartTwo; |
|
| 3344 | 3344 | } |
| 3345 | 3345 | |
| 3346 | 3346 | /** |
@@ -3419,7 +3419,7 @@ discard block |
||
| 3419 | 3419 | */ |
| 3420 | 3420 | public static function ltrim($str = '', $chars = INF) |
| 3421 | 3421 | { |
| 3422 | - $str = (string)$str; |
|
| 3422 | + $str = (string) $str; |
|
| 3423 | 3423 | |
| 3424 | 3424 | if (!isset($str[0])) { |
| 3425 | 3425 | return ''; |
@@ -3430,7 +3430,7 @@ discard block |
||
| 3430 | 3430 | return preg_replace('/^[\pZ\pC]+/u', '', $str); |
| 3431 | 3431 | } |
| 3432 | 3432 | |
| 3433 | - return preg_replace('/^' . self::rxClass($chars) . '+/u', '', $str); |
|
| 3433 | + return preg_replace('/^'.self::rxClass($chars).'+/u', '', $str); |
|
| 3434 | 3434 | } |
| 3435 | 3435 | |
| 3436 | 3436 | /** |
@@ -3461,7 +3461,7 @@ discard block |
||
| 3461 | 3461 | { |
| 3462 | 3462 | $bytes = self::chr_size_list($str); |
| 3463 | 3463 | if (count($bytes) > 0) { |
| 3464 | - return (int)max($bytes); |
|
| 3464 | + return (int) max($bytes); |
|
| 3465 | 3465 | } |
| 3466 | 3466 | |
| 3467 | 3467 | return 0; |
@@ -3583,7 +3583,7 @@ discard block |
||
| 3583 | 3583 | */ |
| 3584 | 3584 | public static function normalize_msword($str) |
| 3585 | 3585 | { |
| 3586 | - $str = (string)$str; |
|
| 3586 | + $str = (string) $str; |
|
| 3587 | 3587 | |
| 3588 | 3588 | if (!isset($str[0])) { |
| 3589 | 3589 | return ''; |
@@ -3612,14 +3612,14 @@ discard block |
||
| 3612 | 3612 | */ |
| 3613 | 3613 | public static function normalize_whitespace($str, $keepNonBreakingSpace = false, $keepBidiUnicodeControls = false) |
| 3614 | 3614 | { |
| 3615 | - $str = (string)$str; |
|
| 3615 | + $str = (string) $str; |
|
| 3616 | 3616 | |
| 3617 | 3617 | if (!isset($str[0])) { |
| 3618 | 3618 | return ''; |
| 3619 | 3619 | } |
| 3620 | 3620 | |
| 3621 | 3621 | static $WHITESPACE_CACHE = array(); |
| 3622 | - $cacheKey = (int)$keepNonBreakingSpace; |
|
| 3622 | + $cacheKey = (int) $keepNonBreakingSpace; |
|
| 3623 | 3623 | |
| 3624 | 3624 | if (!isset($WHITESPACE_CACHE[$cacheKey])) { |
| 3625 | 3625 | |
@@ -3657,13 +3657,13 @@ discard block |
||
| 3657 | 3657 | */ |
| 3658 | 3658 | public static function strip_whitespace($str) |
| 3659 | 3659 | { |
| 3660 | - $str = (string)$str; |
|
| 3660 | + $str = (string) $str; |
|
| 3661 | 3661 | |
| 3662 | 3662 | if (!isset($str[0])) { |
| 3663 | 3663 | return ''; |
| 3664 | 3664 | } |
| 3665 | 3665 | |
| 3666 | - return (string)preg_replace('/[[:space:]]+/u', '', $str); |
|
| 3666 | + return (string) preg_replace('/[[:space:]]+/u', '', $str); |
|
| 3667 | 3667 | } |
| 3668 | 3668 | |
| 3669 | 3669 | /** |
@@ -3680,9 +3680,9 @@ discard block |
||
| 3680 | 3680 | */ |
| 3681 | 3681 | public static function number_format($number, $decimals = 0, $dec_point = '.', $thousands_sep = ',') |
| 3682 | 3682 | { |
| 3683 | - $thousands_sep = (string)$thousands_sep; |
|
| 3684 | - $dec_point = (string)$dec_point; |
|
| 3685 | - $number = (float)$number; |
|
| 3683 | + $thousands_sep = (string) $thousands_sep; |
|
| 3684 | + $dec_point = (string) $dec_point; |
|
| 3685 | + $number = (float) $number; |
|
| 3686 | 3686 | |
| 3687 | 3687 | if ( |
| 3688 | 3688 | isset($thousands_sep[1], $dec_point[1]) |
@@ -3727,7 +3727,7 @@ discard block |
||
| 3727 | 3727 | // check again, if it's still not UTF-8 |
| 3728 | 3728 | /** @noinspection NotOptimalIfConditionsInspection */ |
| 3729 | 3729 | if ($encoding !== 'UTF-8') { |
| 3730 | - $chr = (string)\mb_convert_encoding($chr, 'UTF-8', $encoding); |
|
| 3730 | + $chr = (string) \mb_convert_encoding($chr, 'UTF-8', $encoding); |
|
| 3731 | 3731 | } |
| 3732 | 3732 | } |
| 3733 | 3733 | |
@@ -3750,7 +3750,7 @@ discard block |
||
| 3750 | 3750 | |
| 3751 | 3751 | $chr_orig = $chr; |
| 3752 | 3752 | /** @noinspection CallableParameterUseCaseInTypeContextInspection */ |
| 3753 | - $chr = unpack('C*', (string)self::substr($chr, 0, 4, '8BIT')); |
|
| 3753 | + $chr = unpack('C*', (string) self::substr($chr, 0, 4, '8BIT')); |
|
| 3754 | 3754 | $code = $chr ? $chr[1] : 0; |
| 3755 | 3755 | |
| 3756 | 3756 | if (0xF0 <= $code && isset($chr[4])) { |
@@ -3806,7 +3806,7 @@ discard block |
||
| 3806 | 3806 | { |
| 3807 | 3807 | /** @noinspection PhpUsageOfSilenceOperatorInspection */ |
| 3808 | 3808 | /** @noinspection UsageOfSilenceOperatorInspection */ |
| 3809 | - return (bool)@preg_match('//u', ''); |
|
| 3809 | + return (bool) @preg_match('//u', ''); |
|
| 3810 | 3810 | } |
| 3811 | 3811 | |
| 3812 | 3812 | /** |
@@ -3823,10 +3823,10 @@ discard block |
||
| 3823 | 3823 | return array(); |
| 3824 | 3824 | } |
| 3825 | 3825 | |
| 3826 | - if (ctype_digit((string)$var1)) { |
|
| 3827 | - $start = (int)$var1; |
|
| 3826 | + if (ctype_digit((string) $var1)) { |
|
| 3827 | + $start = (int) $var1; |
|
| 3828 | 3828 | } elseif (ctype_xdigit($var1)) { |
| 3829 | - $start = (int)self::hex_to_int($var1); |
|
| 3829 | + $start = (int) self::hex_to_int($var1); |
|
| 3830 | 3830 | } else { |
| 3831 | 3831 | $start = self::ord($var1); |
| 3832 | 3832 | } |
@@ -3835,10 +3835,10 @@ discard block |
||
| 3835 | 3835 | return array(); |
| 3836 | 3836 | } |
| 3837 | 3837 | |
| 3838 | - if (ctype_digit((string)$var2)) { |
|
| 3839 | - $end = (int)$var2; |
|
| 3838 | + if (ctype_digit((string) $var2)) { |
|
| 3839 | + $end = (int) $var2; |
|
| 3840 | 3840 | } elseif (ctype_xdigit($var2)) { |
| 3841 | - $end = (int)self::hex_to_int($var2); |
|
| 3841 | + $end = (int) self::hex_to_int($var2); |
|
| 3842 | 3842 | } else { |
| 3843 | 3843 | $end = self::ord($var2); |
| 3844 | 3844 | } |
@@ -3877,7 +3877,7 @@ discard block |
||
| 3877 | 3877 | */ |
| 3878 | 3878 | public static function rawurldecode($str, $multi_decode = true) |
| 3879 | 3879 | { |
| 3880 | - $str = (string)$str; |
|
| 3880 | + $str = (string) $str; |
|
| 3881 | 3881 | |
| 3882 | 3882 | if (!isset($str[0])) { |
| 3883 | 3883 | return ''; |
@@ -3904,7 +3904,7 @@ discard block |
||
| 3904 | 3904 | |
| 3905 | 3905 | } while ($multi_decode === true && $str_compare !== $str); |
| 3906 | 3906 | |
| 3907 | - return (string)$str; |
|
| 3907 | + return (string) $str; |
|
| 3908 | 3908 | } |
| 3909 | 3909 | |
| 3910 | 3910 | /** |
@@ -3932,7 +3932,7 @@ discard block |
||
| 3932 | 3932 | */ |
| 3933 | 3933 | public static function remove_bom($str) |
| 3934 | 3934 | { |
| 3935 | - $str = (string)$str; |
|
| 3935 | + $str = (string) $str; |
|
| 3936 | 3936 | |
| 3937 | 3937 | if (!isset($str[0])) { |
| 3938 | 3938 | return ''; |
@@ -3944,7 +3944,7 @@ discard block |
||
| 3944 | 3944 | if ($strTmp === false) { |
| 3945 | 3945 | $strTmp = ''; |
| 3946 | 3946 | } |
| 3947 | - $str = (string)$strTmp; |
|
| 3947 | + $str = (string) $strTmp; |
|
| 3948 | 3948 | } |
| 3949 | 3949 | } |
| 3950 | 3950 | |
@@ -3968,7 +3968,7 @@ discard block |
||
| 3968 | 3968 | if (is_array($what) === true) { |
| 3969 | 3969 | /** @noinspection ForeachSourceInspection */ |
| 3970 | 3970 | foreach ($what as $item) { |
| 3971 | - $str = preg_replace('/(' . preg_quote($item, '/') . ')+/', $item, $str); |
|
| 3971 | + $str = preg_replace('/('.preg_quote($item, '/').')+/', $item, $str); |
|
| 3972 | 3972 | } |
| 3973 | 3973 | } |
| 3974 | 3974 | |
@@ -4020,7 +4020,7 @@ discard block |
||
| 4020 | 4020 | */ |
| 4021 | 4021 | public static function replace_diamond_question_mark($str, $replacementChar = '', $processInvalidUtf8 = true) |
| 4022 | 4022 | { |
| 4023 | - $str = (string)$str; |
|
| 4023 | + $str = (string) $str; |
|
| 4024 | 4024 | |
| 4025 | 4025 | if (!isset($str[0])) { |
| 4026 | 4026 | return ''; |
@@ -4066,7 +4066,7 @@ discard block |
||
| 4066 | 4066 | */ |
| 4067 | 4067 | public static function rtrim($str = '', $chars = INF) |
| 4068 | 4068 | { |
| 4069 | - $str = (string)$str; |
|
| 4069 | + $str = (string) $str; |
|
| 4070 | 4070 | |
| 4071 | 4071 | if (!isset($str[0])) { |
| 4072 | 4072 | return ''; |
@@ -4077,7 +4077,7 @@ discard block |
||
| 4077 | 4077 | return preg_replace('/[\pZ\pC]+$/u', '', $str); |
| 4078 | 4078 | } |
| 4079 | 4079 | |
| 4080 | - return preg_replace('/' . self::rxClass($chars) . '+$/u', '', $str); |
|
| 4080 | + return preg_replace('/'.self::rxClass($chars).'+$/u', '', $str); |
|
| 4081 | 4081 | } |
| 4082 | 4082 | |
| 4083 | 4083 | /** |
@@ -4092,7 +4092,7 @@ discard block |
||
| 4092 | 4092 | { |
| 4093 | 4093 | static $RX_CLASSS_CACHE = array(); |
| 4094 | 4094 | |
| 4095 | - $cacheKey = $s . $class; |
|
| 4095 | + $cacheKey = $s.$class; |
|
| 4096 | 4096 | |
| 4097 | 4097 | if (isset($RX_CLASSS_CACHE[$cacheKey])) { |
| 4098 | 4098 | return $RX_CLASSS_CACHE[$cacheKey]; |
@@ -4104,7 +4104,7 @@ discard block |
||
| 4104 | 4104 | /** @noinspection SuspiciousLoopInspection */ |
| 4105 | 4105 | foreach (self::str_split($s) as $s) { |
| 4106 | 4106 | if ('-' === $s) { |
| 4107 | - $class[0] = '-' . $class[0]; |
|
| 4107 | + $class[0] = '-'.$class[0]; |
|
| 4108 | 4108 | } elseif (!isset($s[2])) { |
| 4109 | 4109 | $class[0] .= preg_quote($s, '/'); |
| 4110 | 4110 | } elseif (1 === self::strlen($s)) { |
@@ -4115,13 +4115,13 @@ discard block |
||
| 4115 | 4115 | } |
| 4116 | 4116 | |
| 4117 | 4117 | if ($class[0]) { |
| 4118 | - $class[0] = '[' . $class[0] . ']'; |
|
| 4118 | + $class[0] = '['.$class[0].']'; |
|
| 4119 | 4119 | } |
| 4120 | 4120 | |
| 4121 | 4121 | if (1 === count($class)) { |
| 4122 | 4122 | $return = $class[0]; |
| 4123 | 4123 | } else { |
| 4124 | - $return = '(?:' . implode('|', $class) . ')'; |
|
| 4124 | + $return = '(?:'.implode('|', $class).')'; |
|
| 4125 | 4125 | } |
| 4126 | 4126 | |
| 4127 | 4127 | $RX_CLASSS_CACHE[$cacheKey] = $return; |
@@ -4139,7 +4139,7 @@ discard block |
||
| 4139 | 4139 | } |
| 4140 | 4140 | |
| 4141 | 4141 | foreach (self::$SUPPORT as $utf8Support) { |
| 4142 | - echo $utf8Support . "\n<br>"; |
|
| 4142 | + echo $utf8Support."\n<br>"; |
|
| 4143 | 4143 | } |
| 4144 | 4144 | } |
| 4145 | 4145 | |
@@ -4154,7 +4154,7 @@ discard block |
||
| 4154 | 4154 | */ |
| 4155 | 4155 | public static function single_chr_html_encode($char, $keepAsciiChars = false, $encoding = 'UTF-8') |
| 4156 | 4156 | { |
| 4157 | - $char = (string)$char; |
|
| 4157 | + $char = (string) $char; |
|
| 4158 | 4158 | |
| 4159 | 4159 | if (!isset($char[0])) { |
| 4160 | 4160 | return ''; |
@@ -4172,7 +4172,7 @@ discard block |
||
| 4172 | 4172 | $encoding = self::normalize_encoding($encoding, 'UTF-8'); |
| 4173 | 4173 | } |
| 4174 | 4174 | |
| 4175 | - return '&#' . self::ord($char, $encoding) . ';'; |
|
| 4175 | + return '&#'.self::ord($char, $encoding).';'; |
|
| 4176 | 4176 | } |
| 4177 | 4177 | |
| 4178 | 4178 | /** |
@@ -4186,7 +4186,7 @@ discard block |
||
| 4186 | 4186 | */ |
| 4187 | 4187 | public static function split($str, $length = 1, $cleanUtf8 = false) |
| 4188 | 4188 | { |
| 4189 | - $str = (string)$str; |
|
| 4189 | + $str = (string) $str; |
|
| 4190 | 4190 | |
| 4191 | 4191 | if (!isset($str[0])) { |
| 4192 | 4192 | return array(); |
@@ -4239,7 +4239,7 @@ discard block |
||
| 4239 | 4239 | ) { |
| 4240 | 4240 | |
| 4241 | 4241 | if (($str[$i + 1] & "\xC0") === "\x80") { |
| 4242 | - $ret[] = $str[$i] . $str[$i + 1]; |
|
| 4242 | + $ret[] = $str[$i].$str[$i + 1]; |
|
| 4243 | 4243 | |
| 4244 | 4244 | $i++; |
| 4245 | 4245 | } |
@@ -4255,7 +4255,7 @@ discard block |
||
| 4255 | 4255 | && |
| 4256 | 4256 | ($str[$i + 2] & "\xC0") === "\x80" |
| 4257 | 4257 | ) { |
| 4258 | - $ret[] = $str[$i] . $str[$i + 1] . $str[$i + 2]; |
|
| 4258 | + $ret[] = $str[$i].$str[$i + 1].$str[$i + 2]; |
|
| 4259 | 4259 | |
| 4260 | 4260 | $i += 2; |
| 4261 | 4261 | } |
@@ -4273,7 +4273,7 @@ discard block |
||
| 4273 | 4273 | && |
| 4274 | 4274 | ($str[$i + 3] & "\xC0") === "\x80" |
| 4275 | 4275 | ) { |
| 4276 | - $ret[] = $str[$i] . $str[$i + 1] . $str[$i + 2] . $str[$i + 3]; |
|
| 4276 | + $ret[] = $str[$i].$str[$i + 1].$str[$i + 2].$str[$i + 3]; |
|
| 4277 | 4277 | |
| 4278 | 4278 | $i += 3; |
| 4279 | 4279 | } |
@@ -4286,7 +4286,7 @@ discard block |
||
| 4286 | 4286 | $ret = array_chunk($ret, $length); |
| 4287 | 4287 | |
| 4288 | 4288 | return array_map( |
| 4289 | - function ($item) { |
|
| 4289 | + function($item) { |
|
| 4290 | 4290 | return implode('', $item); |
| 4291 | 4291 | }, $ret |
| 4292 | 4292 | ); |
@@ -4393,7 +4393,7 @@ discard block |
||
| 4393 | 4393 | foreach (self::$ICONV_ENCODING as $encodingTmp) { |
| 4394 | 4394 | # INFO: //IGNORE and //TRANSLIT still throw notice |
| 4395 | 4395 | /** @noinspection PhpUsageOfSilenceOperatorInspection */ |
| 4396 | - if (md5(@\iconv($encodingTmp, $encodingTmp . '//IGNORE', $str)) === $md5) { |
|
| 4396 | + if (md5(@\iconv($encodingTmp, $encodingTmp.'//IGNORE', $str)) === $md5) { |
|
| 4397 | 4397 | return $encodingTmp; |
| 4398 | 4398 | } |
| 4399 | 4399 | } |
@@ -4411,8 +4411,8 @@ discard block |
||
| 4411 | 4411 | */ |
| 4412 | 4412 | public static function str_ends_with($haystack, $needle) |
| 4413 | 4413 | { |
| 4414 | - $haystack = (string)$haystack; |
|
| 4415 | - $needle = (string)$needle; |
|
| 4414 | + $haystack = (string) $haystack; |
|
| 4415 | + $needle = (string) $needle; |
|
| 4416 | 4416 | |
| 4417 | 4417 | if (!isset($haystack[0], $needle[0])) { |
| 4418 | 4418 | return false; |
@@ -4440,8 +4440,8 @@ discard block |
||
| 4440 | 4440 | */ |
| 4441 | 4441 | public static function str_iends_with($haystack, $needle) |
| 4442 | 4442 | { |
| 4443 | - $haystack = (string)$haystack; |
|
| 4444 | - $needle = (string)$needle; |
|
| 4443 | + $haystack = (string) $haystack; |
|
| 4444 | + $needle = (string) $needle; |
|
| 4445 | 4445 | |
| 4446 | 4446 | if (!isset($haystack[0], $needle[0])) { |
| 4447 | 4447 | return false; |
@@ -4481,14 +4481,14 @@ discard block |
||
| 4481 | 4481 | */ |
| 4482 | 4482 | public static function str_ireplace($search, $replace, $subject, &$count = null) |
| 4483 | 4483 | { |
| 4484 | - $search = (array)$search; |
|
| 4484 | + $search = (array) $search; |
|
| 4485 | 4485 | |
| 4486 | 4486 | /** @noinspection AlterInForeachInspection */ |
| 4487 | 4487 | foreach ($search as &$s) { |
| 4488 | 4488 | if ('' === $s .= '') { |
| 4489 | 4489 | $s = '/^(?<=.)$/'; |
| 4490 | 4490 | } else { |
| 4491 | - $s = '/' . preg_quote($s, '/') . '/ui'; |
|
| 4491 | + $s = '/'.preg_quote($s, '/').'/ui'; |
|
| 4492 | 4492 | } |
| 4493 | 4493 | } |
| 4494 | 4494 | |
@@ -4508,8 +4508,8 @@ discard block |
||
| 4508 | 4508 | */ |
| 4509 | 4509 | public static function str_istarts_with($haystack, $needle) |
| 4510 | 4510 | { |
| 4511 | - $haystack = (string)$haystack; |
|
| 4512 | - $needle = (string)$needle; |
|
| 4511 | + $haystack = (string) $haystack; |
|
| 4512 | + $needle = (string) $needle; |
|
| 4513 | 4513 | |
| 4514 | 4514 | if (!isset($haystack[0], $needle[0])) { |
| 4515 | 4515 | return false; |
@@ -4533,31 +4533,31 @@ discard block |
||
| 4533 | 4533 | */ |
| 4534 | 4534 | public static function str_limit_after_word($str, $length = 100, $strAddOn = '...') |
| 4535 | 4535 | { |
| 4536 | - $str = (string)$str; |
|
| 4536 | + $str = (string) $str; |
|
| 4537 | 4537 | |
| 4538 | 4538 | if (!isset($str[0])) { |
| 4539 | 4539 | return ''; |
| 4540 | 4540 | } |
| 4541 | 4541 | |
| 4542 | - $length = (int)$length; |
|
| 4542 | + $length = (int) $length; |
|
| 4543 | 4543 | |
| 4544 | 4544 | if (self::strlen($str) <= $length) { |
| 4545 | 4545 | return $str; |
| 4546 | 4546 | } |
| 4547 | 4547 | |
| 4548 | 4548 | if (self::substr($str, $length - 1, 1) === ' ') { |
| 4549 | - return (string)self::substr($str, 0, $length - 1) . $strAddOn; |
|
| 4549 | + return (string) self::substr($str, 0, $length - 1).$strAddOn; |
|
| 4550 | 4550 | } |
| 4551 | 4551 | |
| 4552 | - $str = (string)self::substr($str, 0, $length); |
|
| 4552 | + $str = (string) self::substr($str, 0, $length); |
|
| 4553 | 4553 | $array = explode(' ', $str); |
| 4554 | 4554 | array_pop($array); |
| 4555 | 4555 | $new_str = implode(' ', $array); |
| 4556 | 4556 | |
| 4557 | 4557 | if ($new_str === '') { |
| 4558 | - $str = (string)self::substr($str, 0, $length - 1) . $strAddOn; |
|
| 4558 | + $str = (string) self::substr($str, 0, $length - 1).$strAddOn; |
|
| 4559 | 4559 | } else { |
| 4560 | - $str = $new_str . $strAddOn; |
|
| 4560 | + $str = $new_str.$strAddOn; |
|
| 4561 | 4561 | } |
| 4562 | 4562 | |
| 4563 | 4563 | return $str; |
@@ -4593,26 +4593,26 @@ discard block |
||
| 4593 | 4593 | |
| 4594 | 4594 | switch ($pad_type) { |
| 4595 | 4595 | case STR_PAD_LEFT: |
| 4596 | - $pre = str_repeat($pad_string, (int)ceil($diff / $ps_length)); |
|
| 4597 | - $pre = (string)self::substr($pre, 0, $diff); |
|
| 4596 | + $pre = str_repeat($pad_string, (int) ceil($diff / $ps_length)); |
|
| 4597 | + $pre = (string) self::substr($pre, 0, $diff); |
|
| 4598 | 4598 | $post = ''; |
| 4599 | 4599 | break; |
| 4600 | 4600 | |
| 4601 | 4601 | case STR_PAD_BOTH: |
| 4602 | - $pre = str_repeat($pad_string, (int)ceil($diff / $ps_length / 2)); |
|
| 4603 | - $pre = (string)self::substr($pre, 0, (int)$diff / 2); |
|
| 4604 | - $post = str_repeat($pad_string, (int)ceil($diff / $ps_length / 2)); |
|
| 4605 | - $post = (string)self::substr($post, 0, (int)ceil($diff / 2)); |
|
| 4602 | + $pre = str_repeat($pad_string, (int) ceil($diff / $ps_length / 2)); |
|
| 4603 | + $pre = (string) self::substr($pre, 0, (int) $diff / 2); |
|
| 4604 | + $post = str_repeat($pad_string, (int) ceil($diff / $ps_length / 2)); |
|
| 4605 | + $post = (string) self::substr($post, 0, (int) ceil($diff / 2)); |
|
| 4606 | 4606 | break; |
| 4607 | 4607 | |
| 4608 | 4608 | case STR_PAD_RIGHT: |
| 4609 | 4609 | default: |
| 4610 | - $post = str_repeat($pad_string, (int)ceil($diff / $ps_length)); |
|
| 4611 | - $post = (string)self::substr($post, 0, $diff); |
|
| 4610 | + $post = str_repeat($pad_string, (int) ceil($diff / $ps_length)); |
|
| 4611 | + $post = (string) self::substr($post, 0, $diff); |
|
| 4612 | 4612 | $pre = ''; |
| 4613 | 4613 | } |
| 4614 | 4614 | |
| 4615 | - return $pre . $str . $post; |
|
| 4615 | + return $pre.$str.$post; |
|
| 4616 | 4616 | } |
| 4617 | 4617 | |
| 4618 | 4618 | return $str; |
@@ -4749,20 +4749,20 @@ discard block |
||
| 4749 | 4749 | */ |
| 4750 | 4750 | public static function str_split($str, $len = 1) |
| 4751 | 4751 | { |
| 4752 | - $str = (string)$str; |
|
| 4752 | + $str = (string) $str; |
|
| 4753 | 4753 | |
| 4754 | 4754 | if (!isset($str[0])) { |
| 4755 | 4755 | return array(); |
| 4756 | 4756 | } |
| 4757 | 4757 | |
| 4758 | - $len = (int)$len; |
|
| 4758 | + $len = (int) $len; |
|
| 4759 | 4759 | |
| 4760 | 4760 | if ($len < 1) { |
| 4761 | 4761 | return str_split($str, $len); |
| 4762 | 4762 | } |
| 4763 | 4763 | |
| 4764 | 4764 | /** @noinspection PhpInternalEntityUsedInspection */ |
| 4765 | - preg_match_all('/' . self::GRAPHEME_CLUSTER_RX . '/u', $str, $a); |
|
| 4765 | + preg_match_all('/'.self::GRAPHEME_CLUSTER_RX.'/u', $str, $a); |
|
| 4766 | 4766 | $a = $a[0]; |
| 4767 | 4767 | |
| 4768 | 4768 | if ($len === 1) { |
@@ -4794,8 +4794,8 @@ discard block |
||
| 4794 | 4794 | */ |
| 4795 | 4795 | public static function str_starts_with($haystack, $needle) |
| 4796 | 4796 | { |
| 4797 | - $haystack = (string)$haystack; |
|
| 4798 | - $needle = (string)$needle; |
|
| 4797 | + $haystack = (string) $haystack; |
|
| 4798 | + $needle = (string) $needle; |
|
| 4799 | 4799 | |
| 4800 | 4800 | if (!isset($haystack[0], $needle[0])) { |
| 4801 | 4801 | return false; |
@@ -4817,7 +4817,7 @@ discard block |
||
| 4817 | 4817 | */ |
| 4818 | 4818 | public static function str_to_binary($str) |
| 4819 | 4819 | { |
| 4820 | - $str = (string)$str; |
|
| 4820 | + $str = (string) $str; |
|
| 4821 | 4821 | |
| 4822 | 4822 | $value = unpack('H*', $str); |
| 4823 | 4823 | |
@@ -4836,10 +4836,10 @@ discard block |
||
| 4836 | 4836 | */ |
| 4837 | 4837 | public static function str_to_words($str, $charList = '', $removeEmptyValues = false, $removeShortValues = null) |
| 4838 | 4838 | { |
| 4839 | - $str = (string)$str; |
|
| 4839 | + $str = (string) $str; |
|
| 4840 | 4840 | |
| 4841 | 4841 | if ($removeShortValues !== null) { |
| 4842 | - $removeShortValues = (int)$removeShortValues; |
|
| 4842 | + $removeShortValues = (int) $removeShortValues; |
|
| 4843 | 4843 | } |
| 4844 | 4844 | |
| 4845 | 4845 | if (!isset($str[0])) { |
@@ -4998,7 +4998,7 @@ discard block |
||
| 4998 | 4998 | public static function strcmp($str1, $str2) |
| 4999 | 4999 | { |
| 5000 | 5000 | /** @noinspection PhpUndefinedClassInspection */ |
| 5001 | - return $str1 . '' === $str2 . '' ? 0 : strcmp( |
|
| 5001 | + return $str1.'' === $str2.'' ? 0 : strcmp( |
|
| 5002 | 5002 | \Normalizer::normalize($str1, \Normalizer::NFD), |
| 5003 | 5003 | \Normalizer::normalize($str2, \Normalizer::NFD) |
| 5004 | 5004 | ); |
@@ -5025,15 +5025,15 @@ discard block |
||
| 5025 | 5025 | if ($strTmp === false) { |
| 5026 | 5026 | return null; |
| 5027 | 5027 | } |
| 5028 | - $str = (string)$strTmp; |
|
| 5028 | + $str = (string) $strTmp; |
|
| 5029 | 5029 | } |
| 5030 | 5030 | |
| 5031 | - $str = (string)$str; |
|
| 5031 | + $str = (string) $str; |
|
| 5032 | 5032 | if (!isset($str[0])) { |
| 5033 | 5033 | return null; |
| 5034 | 5034 | } |
| 5035 | 5035 | |
| 5036 | - if (preg_match('/^(.*?)' . self::rxClass($charList) . '/us', $str, $length)) { |
|
| 5036 | + if (preg_match('/^(.*?)'.self::rxClass($charList).'/us', $str, $length)) { |
|
| 5037 | 5037 | /** @noinspection OffsetOperationsInspection */ |
| 5038 | 5038 | return self::strlen($length[1]); |
| 5039 | 5039 | } |
@@ -5122,7 +5122,7 @@ discard block |
||
| 5122 | 5122 | */ |
| 5123 | 5123 | public static function strip_tags($str, $allowable_tags = null, $cleanUtf8 = false) |
| 5124 | 5124 | { |
| 5125 | - $str = (string)$str; |
|
| 5125 | + $str = (string) $str; |
|
| 5126 | 5126 | |
| 5127 | 5127 | if (!isset($str[0])) { |
| 5128 | 5128 | return ''; |
@@ -5153,9 +5153,9 @@ discard block |
||
| 5153 | 5153 | */ |
| 5154 | 5154 | public static function stripos($haystack, $needle, $offset = null, $encoding = 'UTF-8', $cleanUtf8 = false) |
| 5155 | 5155 | { |
| 5156 | - $haystack = (string)$haystack; |
|
| 5157 | - $needle = (string)$needle; |
|
| 5158 | - $offset = (int)$offset; |
|
| 5156 | + $haystack = (string) $haystack; |
|
| 5157 | + $needle = (string) $needle; |
|
| 5158 | + $offset = (int) $offset; |
|
| 5159 | 5159 | |
| 5160 | 5160 | if (!isset($haystack[0], $needle[0])) { |
| 5161 | 5161 | return false; |
@@ -5212,9 +5212,9 @@ discard block |
||
| 5212 | 5212 | */ |
| 5213 | 5213 | public static function stristr($haystack, $needle, $before_needle = false, $encoding = 'UTF-8', $cleanUtf8 = false) |
| 5214 | 5214 | { |
| 5215 | - $haystack = (string)$haystack; |
|
| 5216 | - $needle = (string)$needle; |
|
| 5217 | - $before_needle = (bool)$before_needle; |
|
| 5215 | + $haystack = (string) $haystack; |
|
| 5216 | + $needle = (string) $needle; |
|
| 5217 | + $before_needle = (bool) $before_needle; |
|
| 5218 | 5218 | |
| 5219 | 5219 | if (!isset($haystack[0], $needle[0])) { |
| 5220 | 5220 | return false; |
@@ -5240,7 +5240,7 @@ discard block |
||
| 5240 | 5240 | && |
| 5241 | 5241 | self::$SUPPORT['mbstring'] === false |
| 5242 | 5242 | ) { |
| 5243 | - trigger_error('UTF8::stristr() without mbstring cannot handle "' . $encoding . '" encoding', E_USER_WARNING); |
|
| 5243 | + trigger_error('UTF8::stristr() without mbstring cannot handle "'.$encoding.'" encoding', E_USER_WARNING); |
|
| 5244 | 5244 | } |
| 5245 | 5245 | |
| 5246 | 5246 | if (self::$SUPPORT['mbstring'] === true) { |
@@ -5257,7 +5257,7 @@ discard block |
||
| 5257 | 5257 | return \grapheme_stristr($haystack, $needle, $before_needle); |
| 5258 | 5258 | } |
| 5259 | 5259 | |
| 5260 | - preg_match('/^(.*?)' . preg_quote($needle, '/') . '/usi', $haystack, $match); |
|
| 5260 | + preg_match('/^(.*?)'.preg_quote($needle, '/').'/usi', $haystack, $match); |
|
| 5261 | 5261 | |
| 5262 | 5262 | if (!isset($match[1])) { |
| 5263 | 5263 | return false; |
@@ -5284,7 +5284,7 @@ discard block |
||
| 5284 | 5284 | */ |
| 5285 | 5285 | public static function strlen($str, $encoding = 'UTF-8', $cleanUtf8 = false) |
| 5286 | 5286 | { |
| 5287 | - $str = (string)$str; |
|
| 5287 | + $str = (string) $str; |
|
| 5288 | 5288 | |
| 5289 | 5289 | if (!isset($str[0])) { |
| 5290 | 5290 | return 0; |
@@ -5331,7 +5331,7 @@ discard block |
||
| 5331 | 5331 | && |
| 5332 | 5332 | self::$SUPPORT['iconv'] === false |
| 5333 | 5333 | ) { |
| 5334 | - trigger_error('UTF8::strlen() without mbstring / iconv cannot handle "' . $encoding . '" encoding', E_USER_WARNING); |
|
| 5334 | + trigger_error('UTF8::strlen() without mbstring / iconv cannot handle "'.$encoding.'" encoding', E_USER_WARNING); |
|
| 5335 | 5335 | } |
| 5336 | 5336 | |
| 5337 | 5337 | if ( |
@@ -5406,7 +5406,7 @@ discard block |
||
| 5406 | 5406 | */ |
| 5407 | 5407 | public static function strnatcmp($str1, $str2) |
| 5408 | 5408 | { |
| 5409 | - return $str1 . '' === $str2 . '' ? 0 : strnatcmp(self::strtonatfold($str1), self::strtonatfold($str2)); |
|
| 5409 | + return $str1.'' === $str2.'' ? 0 : strnatcmp(self::strtonatfold($str1), self::strtonatfold($str2)); |
|
| 5410 | 5410 | } |
| 5411 | 5411 | |
| 5412 | 5412 | /** |
@@ -5442,8 +5442,8 @@ discard block |
||
| 5442 | 5442 | */ |
| 5443 | 5443 | public static function strncmp($str1, $str2, $len) |
| 5444 | 5444 | { |
| 5445 | - $str1 = (string)self::substr($str1, 0, $len); |
|
| 5446 | - $str2 = (string)self::substr($str2, 0, $len); |
|
| 5445 | + $str1 = (string) self::substr($str1, 0, $len); |
|
| 5446 | + $str2 = (string) self::substr($str2, 0, $len); |
|
| 5447 | 5447 | |
| 5448 | 5448 | return self::strcmp($str1, $str2); |
| 5449 | 5449 | } |
@@ -5460,14 +5460,14 @@ discard block |
||
| 5460 | 5460 | */ |
| 5461 | 5461 | public static function strpbrk($haystack, $char_list) |
| 5462 | 5462 | { |
| 5463 | - $haystack = (string)$haystack; |
|
| 5464 | - $char_list = (string)$char_list; |
|
| 5463 | + $haystack = (string) $haystack; |
|
| 5464 | + $char_list = (string) $char_list; |
|
| 5465 | 5465 | |
| 5466 | 5466 | if (!isset($haystack[0], $char_list[0])) { |
| 5467 | 5467 | return false; |
| 5468 | 5468 | } |
| 5469 | 5469 | |
| 5470 | - if (preg_match('/' . self::rxClass($char_list) . '/us', $haystack, $m)) { |
|
| 5470 | + if (preg_match('/'.self::rxClass($char_list).'/us', $haystack, $m)) { |
|
| 5471 | 5471 | return substr($haystack, strpos($haystack, $m[0])); |
| 5472 | 5472 | } |
| 5473 | 5473 | |
@@ -5492,20 +5492,20 @@ discard block |
||
| 5492 | 5492 | */ |
| 5493 | 5493 | public static function strpos($haystack, $needle, $offset = 0, $encoding = 'UTF-8', $cleanUtf8 = false) |
| 5494 | 5494 | { |
| 5495 | - $haystack = (string)$haystack; |
|
| 5496 | - $needle = (string)$needle; |
|
| 5495 | + $haystack = (string) $haystack; |
|
| 5496 | + $needle = (string) $needle; |
|
| 5497 | 5497 | |
| 5498 | 5498 | if (!isset($haystack[0], $needle[0])) { |
| 5499 | 5499 | return false; |
| 5500 | 5500 | } |
| 5501 | 5501 | |
| 5502 | 5502 | // init |
| 5503 | - $offset = (int)$offset; |
|
| 5503 | + $offset = (int) $offset; |
|
| 5504 | 5504 | |
| 5505 | 5505 | // iconv and mbstring do not support integer $needle |
| 5506 | 5506 | |
| 5507 | - if ((int)$needle === $needle && $needle >= 0) { |
|
| 5508 | - $needle = (string)self::chr($needle); |
|
| 5507 | + if ((int) $needle === $needle && $needle >= 0) { |
|
| 5508 | + $needle = (string) self::chr($needle); |
|
| 5509 | 5509 | } |
| 5510 | 5510 | |
| 5511 | 5511 | if ($cleanUtf8 === true) { |
@@ -5544,7 +5544,7 @@ discard block |
||
| 5544 | 5544 | && |
| 5545 | 5545 | self::$SUPPORT['mbstring'] === false |
| 5546 | 5546 | ) { |
| 5547 | - trigger_error('UTF8::strpos() without mbstring / iconv cannot handle "' . $encoding . '" encoding', E_USER_WARNING); |
|
| 5547 | + trigger_error('UTF8::strpos() without mbstring / iconv cannot handle "'.$encoding.'" encoding', E_USER_WARNING); |
|
| 5548 | 5548 | } |
| 5549 | 5549 | |
| 5550 | 5550 | if ( |
@@ -5591,7 +5591,7 @@ discard block |
||
| 5591 | 5591 | if ($haystackTmp === false) { |
| 5592 | 5592 | $haystackTmp = ''; |
| 5593 | 5593 | } |
| 5594 | - $haystack = (string)$haystackTmp; |
|
| 5594 | + $haystack = (string) $haystackTmp; |
|
| 5595 | 5595 | |
| 5596 | 5596 | if ($offset < 0) { |
| 5597 | 5597 | $offset = 0; |
@@ -5660,7 +5660,7 @@ discard block |
||
| 5660 | 5660 | */ |
| 5661 | 5661 | public static function strrev($str) |
| 5662 | 5662 | { |
| 5663 | - $str = (string)$str; |
|
| 5663 | + $str = (string) $str; |
|
| 5664 | 5664 | |
| 5665 | 5665 | if (!isset($str[0])) { |
| 5666 | 5666 | return ''; |
@@ -5724,14 +5724,14 @@ discard block |
||
| 5724 | 5724 | */ |
| 5725 | 5725 | public static function strripos($haystack, $needle, $offset = 0, $encoding = 'UTF-8', $cleanUtf8 = false) |
| 5726 | 5726 | { |
| 5727 | - if ((int)$needle === $needle && $needle >= 0) { |
|
| 5728 | - $needle = (string)self::chr($needle); |
|
| 5727 | + if ((int) $needle === $needle && $needle >= 0) { |
|
| 5728 | + $needle = (string) self::chr($needle); |
|
| 5729 | 5729 | } |
| 5730 | 5730 | |
| 5731 | 5731 | // init |
| 5732 | - $haystack = (string)$haystack; |
|
| 5733 | - $needle = (string)$needle; |
|
| 5734 | - $offset = (int)$offset; |
|
| 5732 | + $haystack = (string) $haystack; |
|
| 5733 | + $needle = (string) $needle; |
|
| 5734 | + $offset = (int) $offset; |
|
| 5735 | 5735 | |
| 5736 | 5736 | if (!isset($haystack[0], $needle[0])) { |
| 5737 | 5737 | return false; |
@@ -5767,7 +5767,7 @@ discard block |
||
| 5767 | 5767 | && |
| 5768 | 5768 | self::$SUPPORT['mbstring'] === false |
| 5769 | 5769 | ) { |
| 5770 | - trigger_error('UTF8::strripos() without mbstring cannot handle "' . $encoding . '" encoding', E_USER_WARNING); |
|
| 5770 | + trigger_error('UTF8::strripos() without mbstring cannot handle "'.$encoding.'" encoding', E_USER_WARNING); |
|
| 5771 | 5771 | } |
| 5772 | 5772 | |
| 5773 | 5773 | if (self::$SUPPORT['mbstring'] === true) { |
@@ -5808,14 +5808,14 @@ discard block |
||
| 5808 | 5808 | */ |
| 5809 | 5809 | public static function strrpos($haystack, $needle, $offset = null, $encoding = 'UTF-8', $cleanUtf8 = false) |
| 5810 | 5810 | { |
| 5811 | - if ((int)$needle === $needle && $needle >= 0) { |
|
| 5812 | - $needle = (string)self::chr($needle); |
|
| 5811 | + if ((int) $needle === $needle && $needle >= 0) { |
|
| 5812 | + $needle = (string) self::chr($needle); |
|
| 5813 | 5813 | } |
| 5814 | 5814 | |
| 5815 | 5815 | // init |
| 5816 | - $haystack = (string)$haystack; |
|
| 5817 | - $needle = (string)$needle; |
|
| 5818 | - $offset = (int)$offset; |
|
| 5816 | + $haystack = (string) $haystack; |
|
| 5817 | + $needle = (string) $needle; |
|
| 5818 | + $offset = (int) $offset; |
|
| 5819 | 5819 | |
| 5820 | 5820 | if (!isset($haystack[0], $needle[0])) { |
| 5821 | 5821 | return false; |
@@ -5850,7 +5850,7 @@ discard block |
||
| 5850 | 5850 | && |
| 5851 | 5851 | self::$SUPPORT['mbstring'] === false |
| 5852 | 5852 | ) { |
| 5853 | - trigger_error('UTF8::strrpos() without mbstring cannot handle "' . $encoding . '" encoding', E_USER_WARNING); |
|
| 5853 | + trigger_error('UTF8::strrpos() without mbstring cannot handle "'.$encoding.'" encoding', E_USER_WARNING); |
|
| 5854 | 5854 | } |
| 5855 | 5855 | |
| 5856 | 5856 | if (self::$SUPPORT['mbstring'] === true) { |
@@ -5881,7 +5881,7 @@ discard block |
||
| 5881 | 5881 | if ($haystackTmp === false) { |
| 5882 | 5882 | $haystackTmp = ''; |
| 5883 | 5883 | } |
| 5884 | - $haystack = (string)$haystackTmp; |
|
| 5884 | + $haystack = (string) $haystackTmp; |
|
| 5885 | 5885 | } |
| 5886 | 5886 | |
| 5887 | 5887 | $pos = strrpos($haystack, $needle); |
@@ -5910,15 +5910,15 @@ discard block |
||
| 5910 | 5910 | if ($strTmp === false) { |
| 5911 | 5911 | $strTmp = ''; |
| 5912 | 5912 | } |
| 5913 | - $str = (string)$strTmp; |
|
| 5913 | + $str = (string) $strTmp; |
|
| 5914 | 5914 | } |
| 5915 | 5915 | |
| 5916 | - $str = (string)$str; |
|
| 5916 | + $str = (string) $str; |
|
| 5917 | 5917 | if (!isset($str[0], $mask[0])) { |
| 5918 | 5918 | return 0; |
| 5919 | 5919 | } |
| 5920 | 5920 | |
| 5921 | - return preg_match('/^' . self::rxClass($mask) . '+/u', $str, $str) ? self::strlen($str[0]) : 0; |
|
| 5921 | + return preg_match('/^'.self::rxClass($mask).'+/u', $str, $str) ? self::strlen($str[0]) : 0; |
|
| 5922 | 5922 | } |
| 5923 | 5923 | |
| 5924 | 5924 | /** |
@@ -5937,8 +5937,8 @@ discard block |
||
| 5937 | 5937 | */ |
| 5938 | 5938 | public static function strstr($haystack, $needle, $before_needle = false, $encoding = 'UTF-8', $cleanUtf8 = false) |
| 5939 | 5939 | { |
| 5940 | - $haystack = (string)$haystack; |
|
| 5941 | - $needle = (string)$needle; |
|
| 5940 | + $haystack = (string) $haystack; |
|
| 5941 | + $needle = (string) $needle; |
|
| 5942 | 5942 | |
| 5943 | 5943 | if (!isset($haystack[0], $needle[0])) { |
| 5944 | 5944 | return false; |
@@ -5964,7 +5964,7 @@ discard block |
||
| 5964 | 5964 | && |
| 5965 | 5965 | self::$SUPPORT['mbstring'] === false |
| 5966 | 5966 | ) { |
| 5967 | - trigger_error('UTF8::strstr() without mbstring cannot handle "' . $encoding . '" encoding', E_USER_WARNING); |
|
| 5967 | + trigger_error('UTF8::strstr() without mbstring cannot handle "'.$encoding.'" encoding', E_USER_WARNING); |
|
| 5968 | 5968 | } |
| 5969 | 5969 | |
| 5970 | 5970 | if (self::$SUPPORT['mbstring'] === true) { |
@@ -5981,7 +5981,7 @@ discard block |
||
| 5981 | 5981 | return \grapheme_strstr($haystack, $needle, $before_needle); |
| 5982 | 5982 | } |
| 5983 | 5983 | |
| 5984 | - preg_match('/^(.*?)' . preg_quote($needle, '/') . '/us', $haystack, $match); |
|
| 5984 | + preg_match('/^(.*?)'.preg_quote($needle, '/').'/us', $haystack, $match); |
|
| 5985 | 5985 | |
| 5986 | 5986 | if (!isset($match[1])) { |
| 5987 | 5987 | return false; |
@@ -6011,7 +6011,7 @@ discard block |
||
| 6011 | 6011 | public static function strtocasefold($str, $full = true, $cleanUtf8 = false) |
| 6012 | 6012 | { |
| 6013 | 6013 | // init |
| 6014 | - $str = (string)$str; |
|
| 6014 | + $str = (string) $str; |
|
| 6015 | 6015 | |
| 6016 | 6016 | if (!isset($str[0])) { |
| 6017 | 6017 | return ''; |
@@ -6025,7 +6025,7 @@ discard block |
||
| 6025 | 6025 | $COMMAN_CASE_FOLD_VALUES_CACHE = array_values(self::$COMMON_CASE_FOLD); |
| 6026 | 6026 | } |
| 6027 | 6027 | |
| 6028 | - $str = (string)str_replace($COMMON_CASE_FOLD_KEYS_CACHE, $COMMAN_CASE_FOLD_VALUES_CACHE, $str); |
|
| 6028 | + $str = (string) str_replace($COMMON_CASE_FOLD_KEYS_CACHE, $COMMAN_CASE_FOLD_VALUES_CACHE, $str); |
|
| 6029 | 6029 | |
| 6030 | 6030 | if ($full) { |
| 6031 | 6031 | |
@@ -6036,7 +6036,7 @@ discard block |
||
| 6036 | 6036 | } |
| 6037 | 6037 | |
| 6038 | 6038 | /** @noinspection OffsetOperationsInspection */ |
| 6039 | - $str = (string)str_replace($FULL_CASE_FOLD[0], $FULL_CASE_FOLD[1], $str); |
|
| 6039 | + $str = (string) str_replace($FULL_CASE_FOLD[0], $FULL_CASE_FOLD[1], $str); |
|
| 6040 | 6040 | } |
| 6041 | 6041 | |
| 6042 | 6042 | if ($cleanUtf8 === true) { |
@@ -6061,7 +6061,7 @@ discard block |
||
| 6061 | 6061 | public static function strtolower($str, $encoding = 'UTF-8', $cleanUtf8 = false, $lang = null) |
| 6062 | 6062 | { |
| 6063 | 6063 | // init |
| 6064 | - $str = (string)$str; |
|
| 6064 | + $str = (string) $str; |
|
| 6065 | 6065 | |
| 6066 | 6066 | if (!isset($str[0])) { |
| 6067 | 6067 | return ''; |
@@ -6088,9 +6088,9 @@ discard block |
||
| 6088 | 6088 | Bootup::is_php('5.4') === true |
| 6089 | 6089 | ) { |
| 6090 | 6090 | |
| 6091 | - $langCode = $lang . '-Lower'; |
|
| 6091 | + $langCode = $lang.'-Lower'; |
|
| 6092 | 6092 | if (!in_array($langCode, self::$SUPPORT['intl__transliterator_list_ids'], true)) { |
| 6093 | - trigger_error('UTF8::strtolower() without intl for special language: ' . $lang, E_USER_WARNING); |
|
| 6093 | + trigger_error('UTF8::strtolower() without intl for special language: '.$lang, E_USER_WARNING); |
|
| 6094 | 6094 | |
| 6095 | 6095 | $langCode = 'Any-Lower'; |
| 6096 | 6096 | } |
@@ -6098,7 +6098,7 @@ discard block |
||
| 6098 | 6098 | return transliterator_transliterate($langCode, $str); |
| 6099 | 6099 | } |
| 6100 | 6100 | |
| 6101 | - trigger_error('UTF8::strtolower() without intl + PHP >= 5.4 cannot handle the "lang"-parameter: ' . $lang, E_USER_WARNING); |
|
| 6101 | + trigger_error('UTF8::strtolower() without intl + PHP >= 5.4 cannot handle the "lang"-parameter: '.$lang, E_USER_WARNING); |
|
| 6102 | 6102 | } |
| 6103 | 6103 | |
| 6104 | 6104 | return \mb_strtolower($str, $encoding); |
@@ -6131,7 +6131,7 @@ discard block |
||
| 6131 | 6131 | */ |
| 6132 | 6132 | public static function strtoupper($str, $encoding = 'UTF-8', $cleanUtf8 = false, $lang = null) |
| 6133 | 6133 | { |
| 6134 | - $str = (string)$str; |
|
| 6134 | + $str = (string) $str; |
|
| 6135 | 6135 | |
| 6136 | 6136 | if (!isset($str[0])) { |
| 6137 | 6137 | return ''; |
@@ -6158,9 +6158,9 @@ discard block |
||
| 6158 | 6158 | Bootup::is_php('5.4') === true |
| 6159 | 6159 | ) { |
| 6160 | 6160 | |
| 6161 | - $langCode = $lang . '-Upper'; |
|
| 6161 | + $langCode = $lang.'-Upper'; |
|
| 6162 | 6162 | if (!in_array($langCode, self::$SUPPORT['intl__transliterator_list_ids'], true)) { |
| 6163 | - trigger_error('UTF8::strtoupper() without intl for special language: ' . $lang, E_USER_WARNING); |
|
| 6163 | + trigger_error('UTF8::strtoupper() without intl for special language: '.$lang, E_USER_WARNING); |
|
| 6164 | 6164 | |
| 6165 | 6165 | $langCode = 'Any-Upper'; |
| 6166 | 6166 | } |
@@ -6168,7 +6168,7 @@ discard block |
||
| 6168 | 6168 | return transliterator_transliterate($langCode, $str); |
| 6169 | 6169 | } |
| 6170 | 6170 | |
| 6171 | - trigger_error('UTF8::strtolower() without intl + PHP >= 5.4 cannot handle the "lang"-parameter: ' . $lang, E_USER_WARNING); |
|
| 6171 | + trigger_error('UTF8::strtolower() without intl + PHP >= 5.4 cannot handle the "lang"-parameter: '.$lang, E_USER_WARNING); |
|
| 6172 | 6172 | } |
| 6173 | 6173 | |
| 6174 | 6174 | return \mb_strtoupper($str, $encoding); |
@@ -6190,7 +6190,7 @@ discard block |
||
| 6190 | 6190 | */ |
| 6191 | 6191 | public static function strtr($str, $from, $to = INF) |
| 6192 | 6192 | { |
| 6193 | - $str = (string)$str; |
|
| 6193 | + $str = (string) $str; |
|
| 6194 | 6194 | |
| 6195 | 6195 | if (!isset($str[0])) { |
| 6196 | 6196 | return ''; |
@@ -6273,7 +6273,7 @@ discard block |
||
| 6273 | 6273 | |
| 6274 | 6274 | $return = array(); |
| 6275 | 6275 | foreach ($array as $key => $value) { |
| 6276 | - if ($case === CASE_LOWER) { |
|
| 6276 | + if ($case === CASE_LOWER) { |
|
| 6277 | 6277 | $key = self::strtolower($key); |
| 6278 | 6278 | } else { |
| 6279 | 6279 | $key = self::strtoupper($key); |
@@ -6303,7 +6303,7 @@ discard block |
||
| 6303 | 6303 | public static function substr($str, $offset = 0, $length = null, $encoding = 'UTF-8', $cleanUtf8 = false) |
| 6304 | 6304 | { |
| 6305 | 6305 | // init |
| 6306 | - $str = (string)$str; |
|
| 6306 | + $str = (string) $str; |
|
| 6307 | 6307 | |
| 6308 | 6308 | if (!isset($str[0])) { |
| 6309 | 6309 | return ''; |
@@ -6317,7 +6317,7 @@ discard block |
||
| 6317 | 6317 | |
| 6318 | 6318 | $str_length = 0; |
| 6319 | 6319 | if ($offset || $length === null) { |
| 6320 | - $str_length = (int)self::strlen($str, $encoding); |
|
| 6320 | + $str_length = (int) self::strlen($str, $encoding); |
|
| 6321 | 6321 | } |
| 6322 | 6322 | |
| 6323 | 6323 | if ($offset && $offset > $str_length) { |
@@ -6327,7 +6327,7 @@ discard block |
||
| 6327 | 6327 | if ($length === null) { |
| 6328 | 6328 | $length = $str_length; |
| 6329 | 6329 | } else { |
| 6330 | - $length = (int)$length; |
|
| 6330 | + $length = (int) $length; |
|
| 6331 | 6331 | } |
| 6332 | 6332 | |
| 6333 | 6333 | if ( |
@@ -6357,7 +6357,7 @@ discard block |
||
| 6357 | 6357 | && |
| 6358 | 6358 | self::$SUPPORT['mbstring'] === false |
| 6359 | 6359 | ) { |
| 6360 | - trigger_error('UTF8::substr() without mbstring cannot handle "' . $encoding . '" encoding', E_USER_WARNING); |
|
| 6360 | + trigger_error('UTF8::substr() without mbstring cannot handle "'.$encoding.'" encoding', E_USER_WARNING); |
|
| 6361 | 6361 | } |
| 6362 | 6362 | |
| 6363 | 6363 | if (self::$SUPPORT['mbstring'] === true) { |
@@ -6420,13 +6420,13 @@ discard block |
||
| 6420 | 6420 | if ($str1Tmp === false) { |
| 6421 | 6421 | $str1Tmp = ''; |
| 6422 | 6422 | } |
| 6423 | - $str1 = (string)$str1Tmp; |
|
| 6423 | + $str1 = (string) $str1Tmp; |
|
| 6424 | 6424 | |
| 6425 | 6425 | $str2Tmp = self::substr($str2, 0, self::strlen($str1)); |
| 6426 | 6426 | if ($str2Tmp === false) { |
| 6427 | 6427 | $str2Tmp = ''; |
| 6428 | 6428 | } |
| 6429 | - $str2 = (string)$str2Tmp; |
|
| 6429 | + $str2 = (string) $str2Tmp; |
|
| 6430 | 6430 | } |
| 6431 | 6431 | |
| 6432 | 6432 | if ($case_insensitivity === true) { |
@@ -6457,8 +6457,8 @@ discard block |
||
| 6457 | 6457 | public static function substr_count($haystack, $needle, $offset = 0, $length = null, $encoding = 'UTF-8', $cleanUtf8 = false) |
| 6458 | 6458 | { |
| 6459 | 6459 | // init |
| 6460 | - $haystack = (string)$haystack; |
|
| 6461 | - $needle = (string)$needle; |
|
| 6460 | + $haystack = (string) $haystack; |
|
| 6461 | + $needle = (string) $needle; |
|
| 6462 | 6462 | |
| 6463 | 6463 | if (!isset($haystack[0], $needle[0])) { |
| 6464 | 6464 | return false; |
@@ -6467,11 +6467,11 @@ discard block |
||
| 6467 | 6467 | if ($offset || $length !== null) { |
| 6468 | 6468 | |
| 6469 | 6469 | if ($length === null) { |
| 6470 | - $length = (int)self::strlen($haystack); |
|
| 6470 | + $length = (int) self::strlen($haystack); |
|
| 6471 | 6471 | } |
| 6472 | 6472 | |
| 6473 | - $offset = (int)$offset; |
|
| 6474 | - $length = (int)$length; |
|
| 6473 | + $offset = (int) $offset; |
|
| 6474 | + $length = (int) $length; |
|
| 6475 | 6475 | |
| 6476 | 6476 | if ( |
| 6477 | 6477 | ( |
@@ -6491,7 +6491,7 @@ discard block |
||
| 6491 | 6491 | if ($haystackTmp === false) { |
| 6492 | 6492 | $haystackTmp = ''; |
| 6493 | 6493 | } |
| 6494 | - $haystack = (string)$haystackTmp; |
|
| 6494 | + $haystack = (string) $haystackTmp; |
|
| 6495 | 6495 | } |
| 6496 | 6496 | |
| 6497 | 6497 | if ($encoding !== 'UTF-8') { |
@@ -6514,14 +6514,14 @@ discard block |
||
| 6514 | 6514 | && |
| 6515 | 6515 | self::$SUPPORT['mbstring'] === false |
| 6516 | 6516 | ) { |
| 6517 | - trigger_error('UTF8::substr_count() without mbstring cannot handle "' . $encoding . '" encoding', E_USER_WARNING); |
|
| 6517 | + trigger_error('UTF8::substr_count() without mbstring cannot handle "'.$encoding.'" encoding', E_USER_WARNING); |
|
| 6518 | 6518 | } |
| 6519 | 6519 | |
| 6520 | 6520 | if (self::$SUPPORT['mbstring'] === true) { |
| 6521 | 6521 | return \mb_substr_count($haystack, $needle, $encoding); |
| 6522 | 6522 | } |
| 6523 | 6523 | |
| 6524 | - preg_match_all('/' . preg_quote($needle, '/') . '/us', $haystack, $matches, PREG_SET_ORDER); |
|
| 6524 | + preg_match_all('/'.preg_quote($needle, '/').'/us', $haystack, $matches, PREG_SET_ORDER); |
|
| 6525 | 6525 | |
| 6526 | 6526 | return count($matches); |
| 6527 | 6527 | } |
@@ -6537,8 +6537,8 @@ discard block |
||
| 6537 | 6537 | public static function substr_ileft($haystack, $needle) |
| 6538 | 6538 | { |
| 6539 | 6539 | // init |
| 6540 | - $haystack = (string)$haystack; |
|
| 6541 | - $needle = (string)$needle; |
|
| 6540 | + $haystack = (string) $haystack; |
|
| 6541 | + $needle = (string) $needle; |
|
| 6542 | 6542 | |
| 6543 | 6543 | if (!isset($haystack[0])) { |
| 6544 | 6544 | return ''; |
@@ -6553,7 +6553,7 @@ discard block |
||
| 6553 | 6553 | if ($haystackTmp === false) { |
| 6554 | 6554 | $haystackTmp = ''; |
| 6555 | 6555 | } |
| 6556 | - $haystack = (string)$haystackTmp; |
|
| 6556 | + $haystack = (string) $haystackTmp; |
|
| 6557 | 6557 | } |
| 6558 | 6558 | |
| 6559 | 6559 | return $haystack; |
@@ -6570,8 +6570,8 @@ discard block |
||
| 6570 | 6570 | public static function substr_iright($haystack, $needle) |
| 6571 | 6571 | { |
| 6572 | 6572 | // init |
| 6573 | - $haystack = (string)$haystack; |
|
| 6574 | - $needle = (string)$needle; |
|
| 6573 | + $haystack = (string) $haystack; |
|
| 6574 | + $needle = (string) $needle; |
|
| 6575 | 6575 | |
| 6576 | 6576 | if (!isset($haystack[0])) { |
| 6577 | 6577 | return ''; |
@@ -6586,7 +6586,7 @@ discard block |
||
| 6586 | 6586 | if ($haystackTmp === false) { |
| 6587 | 6587 | $haystackTmp = ''; |
| 6588 | 6588 | } |
| 6589 | - $haystack = (string)$haystackTmp; |
|
| 6589 | + $haystack = (string) $haystackTmp; |
|
| 6590 | 6590 | } |
| 6591 | 6591 | |
| 6592 | 6592 | return $haystack; |
@@ -6603,8 +6603,8 @@ discard block |
||
| 6603 | 6603 | public static function substr_left($haystack, $needle) |
| 6604 | 6604 | { |
| 6605 | 6605 | // init |
| 6606 | - $haystack = (string)$haystack; |
|
| 6607 | - $needle = (string)$needle; |
|
| 6606 | + $haystack = (string) $haystack; |
|
| 6607 | + $needle = (string) $needle; |
|
| 6608 | 6608 | |
| 6609 | 6609 | if (!isset($haystack[0])) { |
| 6610 | 6610 | return ''; |
@@ -6619,7 +6619,7 @@ discard block |
||
| 6619 | 6619 | if ($haystackTmp === false) { |
| 6620 | 6620 | $haystackTmp = ''; |
| 6621 | 6621 | } |
| 6622 | - $haystack = (string)$haystackTmp; |
|
| 6622 | + $haystack = (string) $haystackTmp; |
|
| 6623 | 6623 | } |
| 6624 | 6624 | |
| 6625 | 6625 | return $haystack; |
@@ -6665,7 +6665,7 @@ discard block |
||
| 6665 | 6665 | if (is_array($offset) === true) { |
| 6666 | 6666 | $offset = array_slice($offset, 0, $num); |
| 6667 | 6667 | foreach ($offset as &$valueTmp) { |
| 6668 | - $valueTmp = (int)$valueTmp === $valueTmp ? $valueTmp : 0; |
|
| 6668 | + $valueTmp = (int) $valueTmp === $valueTmp ? $valueTmp : 0; |
|
| 6669 | 6669 | } |
| 6670 | 6670 | unset($valueTmp); |
| 6671 | 6671 | } else { |
@@ -6679,7 +6679,7 @@ discard block |
||
| 6679 | 6679 | $length = array_slice($length, 0, $num); |
| 6680 | 6680 | foreach ($length as &$valueTmpV2) { |
| 6681 | 6681 | if (isset($valueTmpV2)) { |
| 6682 | - $valueTmpV2 = (int)$valueTmpV2 === $valueTmpV2 ? $valueTmpV2 : $num; |
|
| 6682 | + $valueTmpV2 = (int) $valueTmpV2 === $valueTmpV2 ? $valueTmpV2 : $num; |
|
| 6683 | 6683 | } else { |
| 6684 | 6684 | $valueTmpV2 = 0; |
| 6685 | 6685 | } |
@@ -6703,8 +6703,8 @@ discard block |
||
| 6703 | 6703 | } |
| 6704 | 6704 | |
| 6705 | 6705 | // init |
| 6706 | - $str = (string)$str; |
|
| 6707 | - $replacement = (string)$replacement; |
|
| 6706 | + $str = (string) $str; |
|
| 6707 | + $replacement = (string) $replacement; |
|
| 6708 | 6708 | |
| 6709 | 6709 | if (!isset($str[0])) { |
| 6710 | 6710 | return $replacement; |
@@ -6714,7 +6714,7 @@ discard block |
||
| 6714 | 6714 | preg_match_all('/./us', $replacement, $rmatches); |
| 6715 | 6715 | |
| 6716 | 6716 | if ($length === null) { |
| 6717 | - $length = (int)self::strlen($str); |
|
| 6717 | + $length = (int) self::strlen($str); |
|
| 6718 | 6718 | } |
| 6719 | 6719 | |
| 6720 | 6720 | array_splice($smatches[0], $offset, $length, $rmatches[0]); |
@@ -6732,8 +6732,8 @@ discard block |
||
| 6732 | 6732 | */ |
| 6733 | 6733 | public static function substr_right($haystack, $needle) |
| 6734 | 6734 | { |
| 6735 | - $haystack = (string)$haystack; |
|
| 6736 | - $needle = (string)$needle; |
|
| 6735 | + $haystack = (string) $haystack; |
|
| 6736 | + $needle = (string) $needle; |
|
| 6737 | 6737 | |
| 6738 | 6738 | if (!isset($haystack[0])) { |
| 6739 | 6739 | return ''; |
@@ -6748,7 +6748,7 @@ discard block |
||
| 6748 | 6748 | if ($haystackTmp === false) { |
| 6749 | 6749 | $haystackTmp = ''; |
| 6750 | 6750 | } |
| 6751 | - $haystack = (string)$haystackTmp; |
|
| 6751 | + $haystack = (string) $haystackTmp; |
|
| 6752 | 6752 | } |
| 6753 | 6753 | |
| 6754 | 6754 | return $haystack; |
@@ -6765,7 +6765,7 @@ discard block |
||
| 6765 | 6765 | */ |
| 6766 | 6766 | public static function swapCase($str, $encoding = 'UTF-8', $cleanUtf8 = false) |
| 6767 | 6767 | { |
| 6768 | - $str = (string)$str; |
|
| 6768 | + $str = (string) $str; |
|
| 6769 | 6769 | |
| 6770 | 6770 | if (!isset($str[0])) { |
| 6771 | 6771 | return ''; |
@@ -6783,7 +6783,7 @@ discard block |
||
| 6783 | 6783 | |
| 6784 | 6784 | $strSwappedCase = preg_replace_callback( |
| 6785 | 6785 | '/[\S]/u', |
| 6786 | - function ($match) use ($encoding) { |
|
| 6786 | + function($match) use ($encoding) { |
|
| 6787 | 6787 | $marchToUpper = UTF8::strtoupper($match[0], $encoding); |
| 6788 | 6788 | |
| 6789 | 6789 | if ($match[0] === $marchToUpper) { |
@@ -6879,7 +6879,7 @@ discard block |
||
| 6879 | 6879 | static $UTF8_TO_ASCII; |
| 6880 | 6880 | |
| 6881 | 6881 | // init |
| 6882 | - $str = (string)$str; |
|
| 6882 | + $str = (string) $str; |
|
| 6883 | 6883 | |
| 6884 | 6884 | if (!isset($str[0])) { |
| 6885 | 6885 | return ''; |
@@ -7046,7 +7046,7 @@ discard block |
||
| 7046 | 7046 | return $str; |
| 7047 | 7047 | } |
| 7048 | 7048 | |
| 7049 | - $str = (string)$str; |
|
| 7049 | + $str = (string) $str; |
|
| 7050 | 7050 | |
| 7051 | 7051 | if (!isset($str[0])) { |
| 7052 | 7052 | return ''; |
@@ -7097,7 +7097,7 @@ discard block |
||
| 7097 | 7097 | return $str; |
| 7098 | 7098 | } |
| 7099 | 7099 | |
| 7100 | - $str = (string)$str; |
|
| 7100 | + $str = (string) $str; |
|
| 7101 | 7101 | |
| 7102 | 7102 | if (!isset($str[0])) { |
| 7103 | 7103 | return $str; |
@@ -7126,7 +7126,7 @@ discard block |
||
| 7126 | 7126 | $c2 = $i + 1 >= $max ? "\x00" : $str[$i + 1]; |
| 7127 | 7127 | |
| 7128 | 7128 | if ($c2 >= "\x80" && $c2 <= "\xBF") { // yeah, almost sure it's UTF8 already |
| 7129 | - $buf .= $c1 . $c2; |
|
| 7129 | + $buf .= $c1.$c2; |
|
| 7130 | 7130 | $i++; |
| 7131 | 7131 | } else { // not valid UTF8 - convert it |
| 7132 | 7132 | $buf .= self::to_utf8_convert($c1); |
@@ -7138,7 +7138,7 @@ discard block |
||
| 7138 | 7138 | $c3 = $i + 2 >= $max ? "\x00" : $str[$i + 2]; |
| 7139 | 7139 | |
| 7140 | 7140 | if ($c2 >= "\x80" && $c2 <= "\xBF" && $c3 >= "\x80" && $c3 <= "\xBF") { // yeah, almost sure it's UTF8 already |
| 7141 | - $buf .= $c1 . $c2 . $c3; |
|
| 7141 | + $buf .= $c1.$c2.$c3; |
|
| 7142 | 7142 | $i += 2; |
| 7143 | 7143 | } else { // not valid UTF8 - convert it |
| 7144 | 7144 | $buf .= self::to_utf8_convert($c1); |
@@ -7151,7 +7151,7 @@ discard block |
||
| 7151 | 7151 | $c4 = $i + 3 >= $max ? "\x00" : $str[$i + 3]; |
| 7152 | 7152 | |
| 7153 | 7153 | if ($c2 >= "\x80" && $c2 <= "\xBF" && $c3 >= "\x80" && $c3 <= "\xBF" && $c4 >= "\x80" && $c4 <= "\xBF") { // yeah, almost sure it's UTF8 already |
| 7154 | - $buf .= $c1 . $c2 . $c3 . $c4; |
|
| 7154 | + $buf .= $c1.$c2.$c3.$c4; |
|
| 7155 | 7155 | $i += 3; |
| 7156 | 7156 | } else { // not valid UTF8 - convert it |
| 7157 | 7157 | $buf .= self::to_utf8_convert($c1); |
@@ -7173,7 +7173,7 @@ discard block |
||
| 7173 | 7173 | // decode unicode escape sequences |
| 7174 | 7174 | $buf = preg_replace_callback( |
| 7175 | 7175 | '/\\\\u([0-9a-f]{4})/i', |
| 7176 | - function ($match) { |
|
| 7176 | + function($match) { |
|
| 7177 | 7177 | return \mb_convert_encoding(pack('H*', $match[1]), 'UTF-8', 'UCS-2BE'); |
| 7178 | 7178 | }, |
| 7179 | 7179 | $buf |
@@ -7202,7 +7202,7 @@ discard block |
||
| 7202 | 7202 | } else { |
| 7203 | 7203 | $cc1 = self::chr_and_parse_int($ordC1 / 64) | "\xC0"; |
| 7204 | 7204 | $cc2 = ($int & "\x3F") | "\x80"; |
| 7205 | - $buf .= $cc1 . $cc2; |
|
| 7205 | + $buf .= $cc1.$cc2; |
|
| 7206 | 7206 | } |
| 7207 | 7207 | |
| 7208 | 7208 | return $buf; |
@@ -7223,7 +7223,7 @@ discard block |
||
| 7223 | 7223 | */ |
| 7224 | 7224 | public static function trim($str = '', $chars = INF) |
| 7225 | 7225 | { |
| 7226 | - $str = (string)$str; |
|
| 7226 | + $str = (string) $str; |
|
| 7227 | 7227 | |
| 7228 | 7228 | if (!isset($str[0])) { |
| 7229 | 7229 | return ''; |
@@ -7254,12 +7254,12 @@ discard block |
||
| 7254 | 7254 | } |
| 7255 | 7255 | |
| 7256 | 7256 | $strPartOne = self::strtoupper( |
| 7257 | - (string)self::substr($str, 0, 1, $encoding, $cleanUtf8), |
|
| 7257 | + (string) self::substr($str, 0, 1, $encoding, $cleanUtf8), |
|
| 7258 | 7258 | $encoding, |
| 7259 | 7259 | $cleanUtf8 |
| 7260 | 7260 | ); |
| 7261 | 7261 | |
| 7262 | - return $strPartOne . $strPartTwo; |
|
| 7262 | + return $strPartOne.$strPartTwo; |
|
| 7263 | 7263 | } |
| 7264 | 7264 | |
| 7265 | 7265 | /** |
@@ -7349,7 +7349,7 @@ discard block |
||
| 7349 | 7349 | */ |
| 7350 | 7350 | public static function urldecode($str, $multi_decode = true) |
| 7351 | 7351 | { |
| 7352 | - $str = (string)$str; |
|
| 7352 | + $str = (string) $str; |
|
| 7353 | 7353 | |
| 7354 | 7354 | if (!isset($str[0])) { |
| 7355 | 7355 | return ''; |
@@ -7376,7 +7376,7 @@ discard block |
||
| 7376 | 7376 | |
| 7377 | 7377 | } while ($multi_decode === true && $str_compare !== $str); |
| 7378 | 7378 | |
| 7379 | - return (string)$str; |
|
| 7379 | + return (string) $str; |
|
| 7380 | 7380 | } |
| 7381 | 7381 | |
| 7382 | 7382 | /** |
@@ -7626,13 +7626,13 @@ discard block |
||
| 7626 | 7626 | public static function utf8_decode($str) |
| 7627 | 7627 | { |
| 7628 | 7628 | // init |
| 7629 | - $str = (string)$str; |
|
| 7629 | + $str = (string) $str; |
|
| 7630 | 7630 | |
| 7631 | 7631 | if (!isset($str[0])) { |
| 7632 | 7632 | return ''; |
| 7633 | 7633 | } |
| 7634 | 7634 | |
| 7635 | - $str = (string)self::to_utf8($str); |
|
| 7635 | + $str = (string) self::to_utf8($str); |
|
| 7636 | 7636 | |
| 7637 | 7637 | static $UTF8_TO_WIN1252_KEYS_CACHE = null; |
| 7638 | 7638 | static $UTF8_TO_WIN1252_VALUES_CACHE = null; |
@@ -7677,7 +7677,7 @@ discard block |
||
| 7677 | 7677 | } |
| 7678 | 7678 | } |
| 7679 | 7679 | |
| 7680 | - return (string)self::substr($str, 0, $j, '8BIT'); |
|
| 7680 | + return (string) self::substr($str, 0, $j, '8BIT'); |
|
| 7681 | 7681 | } |
| 7682 | 7682 | |
| 7683 | 7683 | /** |
@@ -7690,7 +7690,7 @@ discard block |
||
| 7690 | 7690 | public static function utf8_encode($str) |
| 7691 | 7691 | { |
| 7692 | 7692 | // init |
| 7693 | - $str = (string)$str; |
|
| 7693 | + $str = (string) $str; |
|
| 7694 | 7694 | |
| 7695 | 7695 | if (!isset($str[0])) { |
| 7696 | 7696 | return ''; |
@@ -7701,7 +7701,7 @@ discard block |
||
| 7701 | 7701 | return ''; |
| 7702 | 7702 | } |
| 7703 | 7703 | |
| 7704 | - $str = (string)$strTmp; |
|
| 7704 | + $str = (string) $strTmp; |
|
| 7705 | 7705 | if (false === strpos($str, "\xC2")) { |
| 7706 | 7706 | return $str; |
| 7707 | 7707 | } |
@@ -7759,20 +7759,20 @@ discard block |
||
| 7759 | 7759 | */ |
| 7760 | 7760 | public static function words_limit($str, $limit = 100, $strAddOn = '...') |
| 7761 | 7761 | { |
| 7762 | - $str = (string)$str; |
|
| 7762 | + $str = (string) $str; |
|
| 7763 | 7763 | |
| 7764 | 7764 | if (!isset($str[0])) { |
| 7765 | 7765 | return ''; |
| 7766 | 7766 | } |
| 7767 | 7767 | |
| 7768 | 7768 | // init |
| 7769 | - $limit = (int)$limit; |
|
| 7769 | + $limit = (int) $limit; |
|
| 7770 | 7770 | |
| 7771 | 7771 | if ($limit < 1) { |
| 7772 | 7772 | return ''; |
| 7773 | 7773 | } |
| 7774 | 7774 | |
| 7775 | - preg_match('/^\s*+(?:\S++\s*+){1,' . $limit . '}/u', $str, $matches); |
|
| 7775 | + preg_match('/^\s*+(?:\S++\s*+){1,'.$limit.'}/u', $str, $matches); |
|
| 7776 | 7776 | |
| 7777 | 7777 | if ( |
| 7778 | 7778 | !isset($matches[0]) |
@@ -7782,7 +7782,7 @@ discard block |
||
| 7782 | 7782 | return $str; |
| 7783 | 7783 | } |
| 7784 | 7784 | |
| 7785 | - return self::rtrim($matches[0]) . $strAddOn; |
|
| 7785 | + return self::rtrim($matches[0]).$strAddOn; |
|
| 7786 | 7786 | } |
| 7787 | 7787 | |
| 7788 | 7788 | /** |
@@ -7803,8 +7803,8 @@ discard block |
||
| 7803 | 7803 | */ |
| 7804 | 7804 | public static function wordwrap($str, $width = 75, $break = "\n", $cut = false) |
| 7805 | 7805 | { |
| 7806 | - $str = (string)$str; |
|
| 7807 | - $break = (string)$break; |
|
| 7806 | + $str = (string) $str; |
|
| 7807 | + $break = (string) $break; |
|
| 7808 | 7808 | |
| 7809 | 7809 | if (!isset($str[0], $break[0])) { |
| 7810 | 7810 | return ''; |
@@ -7850,7 +7850,7 @@ discard block |
||
| 7850 | 7850 | $strReturn .= $break; |
| 7851 | 7851 | } |
| 7852 | 7852 | |
| 7853 | - return $strReturn . implode('', $chars); |
|
| 7853 | + return $strReturn.implode('', $chars); |
|
| 7854 | 7854 | } |
| 7855 | 7855 | |
| 7856 | 7856 | /** |
@@ -24,6 +24,6 @@ |
||
| 24 | 24 | 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', |
| 25 | 25 | ); |
| 26 | 26 | |
| 27 | -$result =& $data; |
|
| 27 | +$result = & $data; |
|
| 28 | 28 | unset($data); |
| 29 | 29 | return $result; |