Completed
Push — master ( a87fa0...1847a1 )
by Lars
06:18
created
src/voku/helper/UTF8.php 1 patch
Spacing   +77 added lines, -79 removed lines patch added patch discarded remove patch
@@ -855,7 +855,7 @@  discard block
 block discarded – undo
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;
@@ -985,10 +985,10 @@  discard block
 block discarded – undo
985 985
         &&
986 986
         self::$SUPPORT['mbstring'] === false
987 987
     ) {
988
-      trigger_error('UTF8::chr() without mbstring cannot handle "' . $encoding . '" encoding', E_USER_WARNING);
988
+      trigger_error('UTF8::chr() without mbstring cannot handle "'.$encoding.'" encoding', E_USER_WARNING);
989 989
     }
990 990
 
991
-    $cacheKey = $code_point . $encoding;
991
+    $cacheKey = $code_point.$encoding;
992 992
     if (isset($CHAR_CACHE[$cacheKey]) === true) {
993 993
       return $CHAR_CACHE[$cacheKey];
994 994
     }
@@ -1013,16 +1013,16 @@  discard block
 block discarded – undo
1013 1013
     if ($code_point <= 0x7F) {
1014 1014
       $str = self::chr_and_parse_int($code_point);
1015 1015
     } elseif ($code_point <= 0x7FF) {
1016
-      $str = self::chr_and_parse_int(($code_point >> 6) + 0xC0) .
1016
+      $str = self::chr_and_parse_int(($code_point >> 6) + 0xC0).
1017 1017
              self::chr_and_parse_int(($code_point & 0x3F) + 0x80);
1018 1018
     } elseif ($code_point <= 0xFFFF) {
1019
-      $str = self::chr_and_parse_int(($code_point >> 12) + 0xE0) .
1020
-             self::chr_and_parse_int((($code_point >> 6) & 0x3F) + 0x80) .
1019
+      $str = self::chr_and_parse_int(($code_point >> 12) + 0xE0).
1020
+             self::chr_and_parse_int((($code_point >> 6) & 0x3F) + 0x80).
1021 1021
              self::chr_and_parse_int(($code_point & 0x3F) + 0x80);
1022 1022
     } else {
1023
-      $str = self::chr_and_parse_int(($code_point >> 18) + 0xF0) .
1024
-             self::chr_and_parse_int((($code_point >> 12) & 0x3F) + 0x80) .
1025
-             self::chr_and_parse_int((($code_point >> 6) & 0x3F) + 0x80) .
1023
+      $str = self::chr_and_parse_int(($code_point >> 18) + 0xF0).
1024
+             self::chr_and_parse_int((($code_point >> 12) & 0x3F) + 0x80).
1025
+             self::chr_and_parse_int((($code_point >> 6) & 0x3F) + 0x80).
1026 1026
              self::chr_and_parse_int(($code_point & 0x3F) + 0x80);
1027 1027
     }
1028 1028
 
@@ -1082,7 +1082,7 @@  discard block
 block discarded – undo
1082 1082
     }
1083 1083
 
1084 1084
     return array_map(
1085
-        function ($data) {
1085
+        function($data) {
1086 1086
           return UTF8::strlen($data, '8BIT');
1087 1087
         },
1088 1088
         self::split($str)
@@ -1324,7 +1324,7 @@  discard block
 block discarded – undo
1324 1324
       $flags = ENT_QUOTES;
1325 1325
     }
1326 1326
 
1327
-    return self::html_entity_decode('&#' . $int . ';', $flags);
1327
+    return self::html_entity_decode('&#'.$int.';', $flags);
1328 1328
   }
1329 1329
 
1330 1330
   /**
@@ -1402,7 +1402,7 @@  discard block
 block discarded – undo
1402 1402
           &&
1403 1403
           self::$SUPPORT['mbstring'] === false
1404 1404
       ) {
1405
-        trigger_error('UTF8::encode() without mbstring cannot handle "' . $encoding . '" encoding', E_USER_WARNING);
1405
+        trigger_error('UTF8::encode() without mbstring cannot handle "'.$encoding.'" encoding', E_USER_WARNING);
1406 1406
       }
1407 1407
 
1408 1408
       $strEncoded = \mb_convert_encoding(
@@ -1611,7 +1611,7 @@  discard block
 block discarded – undo
1611 1611
           ) {
1612 1612
             // Prevent leading combining chars
1613 1613
             // for NFC-safe concatenations.
1614
-            $var = $leading_combining . $var;
1614
+            $var = $leading_combining.$var;
1615 1615
           }
1616 1616
         }
1617 1617
 
@@ -2035,7 +2035,7 @@  discard block
 block discarded – undo
2035 2035
    */
2036 2036
   private static function getData($file)
2037 2037
   {
2038
-    $file = __DIR__ . '/data/' . $file . '.php';
2038
+    $file = __DIR__.'/data/'.$file.'.php';
2039 2039
     if (file_exists($file)) {
2040 2040
       /** @noinspection PhpIncludeInspection */
2041 2041
       return require $file;
@@ -2180,7 +2180,7 @@  discard block
 block discarded – undo
2180 2180
     return implode(
2181 2181
         '',
2182 2182
         array_map(
2183
-            function ($data) use ($keepAsciiChars, $encoding) {
2183
+            function($data) use ($keepAsciiChars, $encoding) {
2184 2184
               return UTF8::single_chr_html_encode($data, $keepAsciiChars, $encoding);
2185 2185
             },
2186 2186
             self::split($str)
@@ -2301,7 +2301,7 @@  discard block
 block discarded – undo
2301 2301
         &&
2302 2302
         self::$SUPPORT['mbstring'] === false
2303 2303
     ) {
2304
-      trigger_error('UTF8::html_entity_decode() without mbstring cannot handle "' . $encoding . '" encoding', E_USER_WARNING);
2304
+      trigger_error('UTF8::html_entity_decode() without mbstring cannot handle "'.$encoding.'" encoding', E_USER_WARNING);
2305 2305
     }
2306 2306
 
2307 2307
     do {
@@ -2309,7 +2309,7 @@  discard block
 block discarded – undo
2309 2309
 
2310 2310
       $str = preg_replace_callback(
2311 2311
           "/&#\d{2,6};/",
2312
-          function ($matches) use ($encoding) {
2312
+          function($matches) use ($encoding) {
2313 2313
             $returnTmp = \mb_convert_encoding($matches[0], $encoding, 'HTML-ENTITIES');
2314 2314
 
2315 2315
             if ($returnTmp !== '"' && $returnTmp !== "'") {
@@ -2643,9 +2643,9 @@  discard block
 block discarded – undo
2643 2643
     if ((int)$int === $int) {
2644 2644
       $hex = dechex($int);
2645 2645
 
2646
-      $hex = (strlen($hex) < 4 ? substr('0000' . $hex, -4) : $hex);
2646
+      $hex = (strlen($hex) < 4 ? substr('0000'.$hex, -4) : $hex);
2647 2647
 
2648
-      return $pfix . $hex;
2648
+      return $pfix.$hex;
2649 2649
     }
2650 2650
 
2651 2651
     return '';
@@ -3386,7 +3386,7 @@  discard block
 block discarded – undo
3386 3386
         $cleanUtf8
3387 3387
     );
3388 3388
 
3389
-    return $strPartOne . $strPartTwo;
3389
+    return $strPartOne.$strPartTwo;
3390 3390
   }
3391 3391
 
3392 3392
   /**
@@ -3476,7 +3476,7 @@  discard block
 block discarded – undo
3476 3476
       return preg_replace('/^[\pZ\pC]+/u', '', $str);
3477 3477
     }
3478 3478
 
3479
-    return preg_replace('/^' . self::rxClass($chars) . '+/u', '', $str);
3479
+    return preg_replace('/^'.self::rxClass($chars).'+/u', '', $str);
3480 3480
   }
3481 3481
 
3482 3482
   /**
@@ -3832,7 +3832,7 @@  discard block
 block discarded – undo
3832 3832
       }
3833 3833
     }
3834 3834
 
3835
-    $cacheKey = $chr_orig . $encoding;
3835
+    $cacheKey = $chr_orig.$encoding;
3836 3836
     if (isset($CHAR_CACHE[$cacheKey]) === true) {
3837 3837
       return $CHAR_CACHE[$cacheKey];
3838 3838
     }
@@ -4066,7 +4066,7 @@  discard block
 block discarded – undo
4066 4066
     if (is_array($what) === true) {
4067 4067
       /** @noinspection ForeachSourceInspection */
4068 4068
       foreach ($what as $item) {
4069
-        $str = preg_replace('/(' . preg_quote($item, '/') . ')+/', $item, $str);
4069
+        $str = preg_replace('/('.preg_quote($item, '/').')+/', $item, $str);
4070 4070
       }
4071 4071
     }
4072 4072
 
@@ -4174,7 +4174,7 @@  discard block
 block discarded – undo
4174 4174
       return preg_replace('/[\pZ\pC]+$/u', '', $str);
4175 4175
     }
4176 4176
 
4177
-    return preg_replace('/' . self::rxClass($chars) . '+$/u', '', $str);
4177
+    return preg_replace('/'.self::rxClass($chars).'+$/u', '', $str);
4178 4178
   }
4179 4179
 
4180 4180
   /**
@@ -4189,7 +4189,7 @@  discard block
 block discarded – undo
4189 4189
   {
4190 4190
     static $RX_CLASSS_CACHE = array();
4191 4191
 
4192
-    $cacheKey = $s . $class;
4192
+    $cacheKey = $s.$class;
4193 4193
 
4194 4194
     if (isset($RX_CLASSS_CACHE[$cacheKey])) {
4195 4195
       return $RX_CLASSS_CACHE[$cacheKey];
@@ -4201,7 +4201,7 @@  discard block
 block discarded – undo
4201 4201
     /** @noinspection SuspiciousLoopInspection */
4202 4202
     foreach (self::str_split($s) as $s) {
4203 4203
       if ('-' === $s) {
4204
-        $class[0] = '-' . $class[0];
4204
+        $class[0] = '-'.$class[0];
4205 4205
       } elseif (!isset($s[2])) {
4206 4206
         $class[0] .= preg_quote($s, '/');
4207 4207
       } elseif (1 === self::strlen($s)) {
@@ -4212,13 +4212,13 @@  discard block
 block discarded – undo
4212 4212
     }
4213 4213
 
4214 4214
     if ($class[0]) {
4215
-      $class[0] = '[' . $class[0] . ']';
4215
+      $class[0] = '['.$class[0].']';
4216 4216
     }
4217 4217
 
4218 4218
     if (1 === count($class)) {
4219 4219
       $return = $class[0];
4220 4220
     } else {
4221
-      $return = '(?:' . implode('|', $class) . ')';
4221
+      $return = '(?:'.implode('|', $class).')';
4222 4222
     }
4223 4223
 
4224 4224
     $RX_CLASSS_CACHE[$cacheKey] = $return;
@@ -4237,7 +4237,7 @@  discard block
 block discarded – undo
4237 4237
 
4238 4238
     echo '<pre>';
4239 4239
     foreach (self::$SUPPORT as $key => $value) {
4240
-      echo $key . ' - ' . print_r($value, true) . "\n<br>";
4240
+      echo $key.' - '.print_r($value, true)."\n<br>";
4241 4241
     }
4242 4242
     echo '</pre>';
4243 4243
   }
@@ -4271,7 +4271,7 @@  discard block
 block discarded – undo
4271 4271
       $encoding = self::normalize_encoding($encoding, 'UTF-8');
4272 4272
     }
4273 4273
 
4274
-    return '&#' . self::ord($char, $encoding) . ';';
4274
+    return '&#'.self::ord($char, $encoding).';';
4275 4275
   }
4276 4276
 
4277 4277
   /**
@@ -4338,7 +4338,7 @@  discard block
 block discarded – undo
4338 4338
         ) {
4339 4339
 
4340 4340
           if (($str[$i + 1] & "\xC0") === "\x80") {
4341
-            $ret[] = $str[$i] . $str[$i + 1];
4341
+            $ret[] = $str[$i].$str[$i + 1];
4342 4342
 
4343 4343
             $i++;
4344 4344
           }
@@ -4354,7 +4354,7 @@  discard block
 block discarded – undo
4354 4354
               &&
4355 4355
               ($str[$i + 2] & "\xC0") === "\x80"
4356 4356
           ) {
4357
-            $ret[] = $str[$i] . $str[$i + 1] . $str[$i + 2];
4357
+            $ret[] = $str[$i].$str[$i + 1].$str[$i + 2];
4358 4358
 
4359 4359
             $i += 2;
4360 4360
           }
@@ -4372,7 +4372,7 @@  discard block
 block discarded – undo
4372 4372
               &&
4373 4373
               ($str[$i + 3] & "\xC0") === "\x80"
4374 4374
           ) {
4375
-            $ret[] = $str[$i] . $str[$i + 1] . $str[$i + 2] . $str[$i + 3];
4375
+            $ret[] = $str[$i].$str[$i + 1].$str[$i + 2].$str[$i + 3];
4376 4376
 
4377 4377
             $i += 3;
4378 4378
           }
@@ -4385,7 +4385,7 @@  discard block
 block discarded – undo
4385 4385
       $ret = array_chunk($ret, $length);
4386 4386
 
4387 4387
       return array_map(
4388
-          function ($item) {
4388
+          function($item) {
4389 4389
             return implode('', $item);
4390 4390
           }, $ret
4391 4391
       );
@@ -4491,7 +4491,7 @@  discard block
 block discarded – undo
4491 4491
     foreach (self::$ICONV_ENCODING as $encodingTmp) {
4492 4492
       # INFO: //IGNORE and //TRANSLIT still throw notice
4493 4493
       /** @noinspection PhpUsageOfSilenceOperatorInspection */
4494
-      if (md5(@\iconv($encodingTmp, $encodingTmp . '//IGNORE', $str)) === $md5) {
4494
+      if (md5(@\iconv($encodingTmp, $encodingTmp.'//IGNORE', $str)) === $md5) {
4495 4495
         return $encodingTmp;
4496 4496
       }
4497 4497
     }
@@ -4581,7 +4581,7 @@  discard block
 block discarded – undo
4581 4581
       if ('' === $s .= '') {
4582 4582
         $s = '/^(?<=.)$/';
4583 4583
       } else {
4584
-        $s = '/' . preg_quote($s, '/') . '/ui';
4584
+        $s = '/'.preg_quote($s, '/').'/ui';
4585 4585
       }
4586 4586
     }
4587 4587
 
@@ -4639,7 +4639,7 @@  discard block
 block discarded – undo
4639 4639
     }
4640 4640
 
4641 4641
     if (self::substr($str, $length - 1, 1) === ' ') {
4642
-      return (string)self::substr($str, 0, $length - 1) . $strAddOn;
4642
+      return (string)self::substr($str, 0, $length - 1).$strAddOn;
4643 4643
     }
4644 4644
 
4645 4645
     $str = (string)self::substr($str, 0, $length);
@@ -4648,9 +4648,9 @@  discard block
 block discarded – undo
4648 4648
     $new_str = implode(' ', $array);
4649 4649
 
4650 4650
     if ($new_str === '') {
4651
-      $str = (string)self::substr($str, 0, $length - 1) . $strAddOn;
4651
+      $str = (string)self::substr($str, 0, $length - 1).$strAddOn;
4652 4652
     } else {
4653
-      $str = $new_str . $strAddOn;
4653
+      $str = $new_str.$strAddOn;
4654 4654
     }
4655 4655
 
4656 4656
     return $str;
@@ -4705,7 +4705,7 @@  discard block
 block discarded – undo
4705 4705
           $pre = '';
4706 4706
       }
4707 4707
 
4708
-      return $pre . $str . $post;
4708
+      return $pre.$str.$post;
4709 4709
     }
4710 4710
 
4711 4711
     return $str;
@@ -4855,7 +4855,7 @@  discard block
 block discarded – undo
4855 4855
     }
4856 4856
 
4857 4857
     /** @noinspection PhpInternalEntityUsedInspection */
4858
-    preg_match_all('/' . self::GRAPHEME_CLUSTER_RX . '/u', $str, $a);
4858
+    preg_match_all('/'.self::GRAPHEME_CLUSTER_RX.'/u', $str, $a);
4859 4859
     $a = $a[0];
4860 4860
 
4861 4861
     if ($len === 1) {
@@ -5091,7 +5091,7 @@  discard block
 block discarded – undo
5091 5091
   public static function strcmp($str1, $str2)
5092 5092
   {
5093 5093
     /** @noinspection PhpUndefinedClassInspection */
5094
-    return $str1 . '' === $str2 . '' ? 0 : strcmp(
5094
+    return $str1.'' === $str2.'' ? 0 : strcmp(
5095 5095
         \Normalizer::normalize($str1, \Normalizer::NFD),
5096 5096
         \Normalizer::normalize($str2, \Normalizer::NFD)
5097 5097
     );
@@ -5126,7 +5126,7 @@  discard block
 block discarded – undo
5126 5126
       return null;
5127 5127
     }
5128 5128
 
5129
-    if (preg_match('/^(.*?)' . self::rxClass($charList) . '/us', $str, $length)) {
5129
+    if (preg_match('/^(.*?)'.self::rxClass($charList).'/us', $str, $length)) {
5130 5130
       /** @noinspection OffsetOperationsInspection */
5131 5131
       return self::strlen($length[1]);
5132 5132
     }
@@ -5337,7 +5337,7 @@  discard block
 block discarded – undo
5337 5337
         &&
5338 5338
         self::$SUPPORT['mbstring'] === false
5339 5339
     ) {
5340
-      trigger_error('UTF8::stristr() without mbstring cannot handle "' . $encoding . '" encoding', E_USER_WARNING);
5340
+      trigger_error('UTF8::stristr() without mbstring cannot handle "'.$encoding.'" encoding', E_USER_WARNING);
5341 5341
     }
5342 5342
 
5343 5343
     if (self::$SUPPORT['mbstring'] === true) {
@@ -5358,7 +5358,7 @@  discard block
 block discarded – undo
5358 5358
       return stristr($haystack, $needle, $before_needle);
5359 5359
     }
5360 5360
 
5361
-    preg_match('/^(.*?)' . preg_quote($needle, '/') . '/usi', $haystack, $match);
5361
+    preg_match('/^(.*?)'.preg_quote($needle, '/').'/usi', $haystack, $match);
5362 5362
 
5363 5363
     if (!isset($match[1])) {
5364 5364
       return false;
@@ -5433,7 +5433,7 @@  discard block
 block discarded – undo
5433 5433
         &&
5434 5434
         self::$SUPPORT['iconv'] === false
5435 5435
     ) {
5436
-      trigger_error('UTF8::strlen() without mbstring / iconv cannot handle "' . $encoding . '" encoding', E_USER_WARNING);
5436
+      trigger_error('UTF8::strlen() without mbstring / iconv cannot handle "'.$encoding.'" encoding', E_USER_WARNING);
5437 5437
     }
5438 5438
 
5439 5439
     if (
@@ -5512,7 +5512,7 @@  discard block
 block discarded – undo
5512 5512
    */
5513 5513
   public static function strnatcmp($str1, $str2)
5514 5514
   {
5515
-    return $str1 . '' === $str2 . '' ? 0 : strnatcmp(self::strtonatfold($str1), self::strtonatfold($str2));
5515
+    return $str1.'' === $str2.'' ? 0 : strnatcmp(self::strtonatfold($str1), self::strtonatfold($str2));
5516 5516
   }
5517 5517
 
5518 5518
   /**
@@ -5573,7 +5573,7 @@  discard block
 block discarded – undo
5573 5573
       return false;
5574 5574
     }
5575 5575
 
5576
-    if (preg_match('/' . self::rxClass($char_list) . '/us', $haystack, $m)) {
5576
+    if (preg_match('/'.self::rxClass($char_list).'/us', $haystack, $m)) {
5577 5577
       return substr($haystack, strpos($haystack, $m[0]));
5578 5578
     }
5579 5579
 
@@ -5650,7 +5650,7 @@  discard block
 block discarded – undo
5650 5650
         &&
5651 5651
         self::$SUPPORT['mbstring'] === false
5652 5652
     ) {
5653
-      trigger_error('UTF8::strpos() without mbstring / iconv cannot handle "' . $encoding . '" encoding', E_USER_WARNING);
5653
+      trigger_error('UTF8::strpos() without mbstring / iconv cannot handle "'.$encoding.'" encoding', E_USER_WARNING);
5654 5654
     }
5655 5655
 
5656 5656
     if (
@@ -5882,7 +5882,7 @@  discard block
 block discarded – undo
5882 5882
         &&
5883 5883
         self::$SUPPORT['mbstring'] === false
5884 5884
     ) {
5885
-      trigger_error('UTF8::strripos() without mbstring cannot handle "' . $encoding . '" encoding', E_USER_WARNING);
5885
+      trigger_error('UTF8::strripos() without mbstring cannot handle "'.$encoding.'" encoding', E_USER_WARNING);
5886 5886
     }
5887 5887
 
5888 5888
     if (self::$SUPPORT['mbstring'] === true) {
@@ -5965,7 +5965,7 @@  discard block
 block discarded – undo
5965 5965
         &&
5966 5966
         self::$SUPPORT['mbstring'] === false
5967 5967
     ) {
5968
-      trigger_error('UTF8::strrpos() without mbstring cannot handle "' . $encoding . '" encoding', E_USER_WARNING);
5968
+      trigger_error('UTF8::strrpos() without mbstring cannot handle "'.$encoding.'" encoding', E_USER_WARNING);
5969 5969
     }
5970 5970
 
5971 5971
     if (self::$SUPPORT['mbstring'] === true) {
@@ -6033,7 +6033,7 @@  discard block
 block discarded – undo
6033 6033
       return 0;
6034 6034
     }
6035 6035
 
6036
-    return preg_match('/^' . self::rxClass($mask) . '+/u', $str, $str) ? self::strlen($str[0]) : 0;
6036
+    return preg_match('/^'.self::rxClass($mask).'+/u', $str, $str) ? self::strlen($str[0]) : 0;
6037 6037
   }
6038 6038
 
6039 6039
   /**
@@ -6079,7 +6079,7 @@  discard block
 block discarded – undo
6079 6079
         &&
6080 6080
         self::$SUPPORT['mbstring'] === false
6081 6081
     ) {
6082
-      trigger_error('UTF8::strstr() without mbstring cannot handle "' . $encoding . '" encoding', E_USER_WARNING);
6082
+      trigger_error('UTF8::strstr() without mbstring cannot handle "'.$encoding.'" encoding', E_USER_WARNING);
6083 6083
     }
6084 6084
 
6085 6085
     if (self::$SUPPORT['mbstring'] === true) {
@@ -6096,7 +6096,7 @@  discard block
 block discarded – undo
6096 6096
       return \grapheme_strstr($haystack, $needle, $before_needle);
6097 6097
     }
6098 6098
 
6099
-    preg_match('/^(.*?)' . preg_quote($needle, '/') . '/us', $haystack, $match);
6099
+    preg_match('/^(.*?)'.preg_quote($needle, '/').'/us', $haystack, $match);
6100 6100
 
6101 6101
     if (!isset($match[1])) {
6102 6102
       return false;
@@ -6203,9 +6203,9 @@  discard block
 block discarded – undo
6203 6203
           Bootup::is_php('5.4') === true
6204 6204
       ) {
6205 6205
 
6206
-        $langCode = $lang . '-Lower';
6206
+        $langCode = $lang.'-Lower';
6207 6207
         if (!in_array($langCode, self::$SUPPORT['intl__transliterator_list_ids'], true)) {
6208
-          trigger_error('UTF8::strtolower() without intl for special language: ' . $lang, E_USER_WARNING);
6208
+          trigger_error('UTF8::strtolower() without intl for special language: '.$lang, E_USER_WARNING);
6209 6209
 
6210 6210
           $langCode = 'Any-Lower';
6211 6211
         }
@@ -6213,7 +6213,7 @@  discard block
 block discarded – undo
6213 6213
         return transliterator_transliterate($langCode, $str);
6214 6214
       }
6215 6215
 
6216
-      trigger_error('UTF8::strtolower() without intl + PHP >= 5.4 cannot handle the "lang"-parameter: ' . $lang, E_USER_WARNING);
6216
+      trigger_error('UTF8::strtolower() without intl + PHP >= 5.4 cannot handle the "lang"-parameter: '.$lang, E_USER_WARNING);
6217 6217
     }
6218 6218
 
6219 6219
     return \mb_strtolower($str, $encoding);
@@ -6273,9 +6273,9 @@  discard block
 block discarded – undo
6273 6273
           Bootup::is_php('5.4') === true
6274 6274
       ) {
6275 6275
 
6276
-        $langCode = $lang . '-Upper';
6276
+        $langCode = $lang.'-Upper';
6277 6277
         if (!in_array($langCode, self::$SUPPORT['intl__transliterator_list_ids'], true)) {
6278
-          trigger_error('UTF8::strtoupper() without intl for special language: ' . $lang, E_USER_WARNING);
6278
+          trigger_error('UTF8::strtoupper() without intl for special language: '.$lang, E_USER_WARNING);
6279 6279
 
6280 6280
           $langCode = 'Any-Upper';
6281 6281
         }
@@ -6283,7 +6283,7 @@  discard block
 block discarded – undo
6283 6283
         return transliterator_transliterate($langCode, $str);
6284 6284
       }
6285 6285
 
6286
-      trigger_error('UTF8::strtolower() without intl + PHP >= 5.4 cannot handle the "lang"-parameter: ' . $lang, E_USER_WARNING);
6286
+      trigger_error('UTF8::strtolower() without intl + PHP >= 5.4 cannot handle the "lang"-parameter: '.$lang, E_USER_WARNING);
6287 6287
     }
6288 6288
 
6289 6289
     return \mb_strtoupper($str, $encoding);
@@ -6388,7 +6388,7 @@  discard block
 block discarded – undo
6388 6388
 
6389 6389
     $return = array();
6390 6390
     foreach ($array as $key => $value) {
6391
-      if ($case  === CASE_LOWER) {
6391
+      if ($case === CASE_LOWER) {
6392 6392
         $key = self::strtolower($key);
6393 6393
       } else {
6394 6394
         $key = self::strtoupper($key);
@@ -6483,7 +6483,7 @@  discard block
 block discarded – undo
6483 6483
         &&
6484 6484
         self::$SUPPORT['mbstring'] === false
6485 6485
     ) {
6486
-      trigger_error('UTF8::substr() without mbstring cannot handle "' . $encoding . '" encoding', E_USER_WARNING);
6486
+      trigger_error('UTF8::substr() without mbstring cannot handle "'.$encoding.'" encoding', E_USER_WARNING);
6487 6487
     }
6488 6488
 
6489 6489
     if (self::$SUPPORT['mbstring'] === true) {
@@ -6510,8 +6510,7 @@  discard block
 block discarded – undo
6510 6510
 
6511 6511
     if (self::is_ascii($str)) {
6512 6512
       return ($length === null) ?
6513
-          substr($str, $offset) :
6514
-          substr($str, $offset, $length);
6513
+          substr($str, $offset) : substr($str, $offset, $length);
6515 6514
     }
6516 6515
 
6517 6516
     // fallback via vanilla php
@@ -6646,14 +6645,14 @@  discard block
 block discarded – undo
6646 6645
         &&
6647 6646
         self::$SUPPORT['mbstring'] === false
6648 6647
     ) {
6649
-      trigger_error('UTF8::substr_count() without mbstring cannot handle "' . $encoding . '" encoding', E_USER_WARNING);
6648
+      trigger_error('UTF8::substr_count() without mbstring cannot handle "'.$encoding.'" encoding', E_USER_WARNING);
6650 6649
     }
6651 6650
 
6652 6651
     if (self::$SUPPORT['mbstring'] === true) {
6653 6652
       return \mb_substr_count($haystack, $needle, $encoding);
6654 6653
     }
6655 6654
 
6656
-    preg_match_all('/' . preg_quote($needle, '/') . '/us', $haystack, $matches, PREG_SET_ORDER);
6655
+    preg_match_all('/'.preg_quote($needle, '/').'/us', $haystack, $matches, PREG_SET_ORDER);
6657 6656
 
6658 6657
     return count($matches);
6659 6658
   }
@@ -6843,8 +6842,7 @@  discard block
 block discarded – undo
6843 6842
 
6844 6843
     if (self::is_ascii($str)) {
6845 6844
       return ($length === null) ?
6846
-          substr_replace($str, $replacement, $offset) :
6847
-          substr_replace($str, $replacement, $offset, $length);
6845
+          substr_replace($str, $replacement, $offset) : substr_replace($str, $replacement, $offset, $length);
6848 6846
     }
6849 6847
 
6850 6848
     preg_match_all('/./us', $str, $smatches);
@@ -6920,7 +6918,7 @@  discard block
 block discarded – undo
6920 6918
 
6921 6919
     $strSwappedCase = preg_replace_callback(
6922 6920
         '/[\S]/u',
6923
-        function ($match) use ($encoding) {
6921
+        function($match) use ($encoding) {
6924 6922
           $marchToUpper = UTF8::strtoupper($match[0], $encoding);
6925 6923
 
6926 6924
           if ($match[0] === $marchToUpper) {
@@ -7263,7 +7261,7 @@  discard block
 block discarded – undo
7263 7261
           $c2 = $i + 1 >= $max ? "\x00" : $str[$i + 1];
7264 7262
 
7265 7263
           if ($c2 >= "\x80" && $c2 <= "\xBF") { // yeah, almost sure it's UTF8 already
7266
-            $buf .= $c1 . $c2;
7264
+            $buf .= $c1.$c2;
7267 7265
             $i++;
7268 7266
           } else { // not valid UTF8 - convert it
7269 7267
             $buf .= self::to_utf8_convert($c1);
@@ -7275,7 +7273,7 @@  discard block
 block discarded – undo
7275 7273
           $c3 = $i + 2 >= $max ? "\x00" : $str[$i + 2];
7276 7274
 
7277 7275
           if ($c2 >= "\x80" && $c2 <= "\xBF" && $c3 >= "\x80" && $c3 <= "\xBF") { // yeah, almost sure it's UTF8 already
7278
-            $buf .= $c1 . $c2 . $c3;
7276
+            $buf .= $c1.$c2.$c3;
7279 7277
             $i += 2;
7280 7278
           } else { // not valid UTF8 - convert it
7281 7279
             $buf .= self::to_utf8_convert($c1);
@@ -7288,7 +7286,7 @@  discard block
 block discarded – undo
7288 7286
           $c4 = $i + 3 >= $max ? "\x00" : $str[$i + 3];
7289 7287
 
7290 7288
           if ($c2 >= "\x80" && $c2 <= "\xBF" && $c3 >= "\x80" && $c3 <= "\xBF" && $c4 >= "\x80" && $c4 <= "\xBF") { // yeah, almost sure it's UTF8 already
7291
-            $buf .= $c1 . $c2 . $c3 . $c4;
7289
+            $buf .= $c1.$c2.$c3.$c4;
7292 7290
             $i += 3;
7293 7291
           } else { // not valid UTF8 - convert it
7294 7292
             $buf .= self::to_utf8_convert($c1);
@@ -7310,7 +7308,7 @@  discard block
 block discarded – undo
7310 7308
     // decode unicode escape sequences
7311 7309
     $buf = preg_replace_callback(
7312 7310
         '/\\\\u([0-9a-f]{4})/i',
7313
-        function ($match) {
7311
+        function($match) {
7314 7312
           return \mb_convert_encoding(pack('H*', $match[1]), 'UTF-8', 'UCS-2BE');
7315 7313
         },
7316 7314
         $buf
@@ -7339,7 +7337,7 @@  discard block
 block discarded – undo
7339 7337
     } else {
7340 7338
       $cc1 = self::chr_and_parse_int($ordC1 / 64) | "\xC0";
7341 7339
       $cc2 = ($int & "\x3F") | "\x80";
7342
-      $buf .= $cc1 . $cc2;
7340
+      $buf .= $cc1.$cc2;
7343 7341
     }
7344 7342
 
7345 7343
     return $buf;
@@ -7402,7 +7400,7 @@  discard block
 block discarded – undo
7402 7400
         $cleanUtf8
7403 7401
     );
7404 7402
 
7405
-    return $strPartOne . $strPartTwo;
7403
+    return $strPartOne.$strPartTwo;
7406 7404
   }
7407 7405
 
7408 7406
   /**
@@ -7447,7 +7445,7 @@  discard block
 block discarded – undo
7447 7445
       $str = self::clean($str);
7448 7446
     }
7449 7447
 
7450
-    $usePhpDefaultFunctions = !(bool)($charlist . implode('', $exceptions));
7448
+    $usePhpDefaultFunctions = !(bool)($charlist.implode('', $exceptions));
7451 7449
 
7452 7450
     if (
7453 7451
         $usePhpDefaultFunctions === true
@@ -7936,7 +7934,7 @@  discard block
 block discarded – undo
7936 7934
       return '';
7937 7935
     }
7938 7936
 
7939
-    preg_match('/^\s*+(?:\S++\s*+){1,' . $limit . '}/u', $str, $matches);
7937
+    preg_match('/^\s*+(?:\S++\s*+){1,'.$limit.'}/u', $str, $matches);
7940 7938
 
7941 7939
     if (
7942 7940
         !isset($matches[0])
@@ -7946,7 +7944,7 @@  discard block
 block discarded – undo
7946 7944
       return $str;
7947 7945
     }
7948 7946
 
7949
-    return self::rtrim($matches[0]) . $strAddOn;
7947
+    return self::rtrim($matches[0]).$strAddOn;
7950 7948
   }
7951 7949
 
7952 7950
   /**
@@ -8014,7 +8012,7 @@  discard block
 block discarded – undo
8014 8012
       $strReturn .= $break;
8015 8013
     }
8016 8014
 
8017
-    return $strReturn . implode('', $chars);
8015
+    return $strReturn.implode('', $chars);
8018 8016
   }
8019 8017
 
8020 8018
   /**
Please login to merge, or discard this patch.