Completed
Push — master ( 5343dd...690c42 )
by Lars
12:33 queued 02:01
created
src/voku/helper/UTF8.php 2 patches
Doc Comments   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -2858,7 +2858,7 @@  discard block
 block discarded – undo
2858 2858
   /**
2859 2859
    * Check if the input is binary... (is look like a hack).
2860 2860
    *
2861
-   * @param mixed $input
2861
+   * @param string $input
2862 2862
    *
2863 2863
    * @return bool
2864 2864
    */
@@ -5911,7 +5911,7 @@  discard block
 block discarded – undo
5911 5911
    * @link http://php.net/manual/en/function.mb-strrpos.php
5912 5912
    *
5913 5913
    * @param string     $haystack  <p>The string being checked, for the last occurrence of needle</p>
5914
-   * @param string|int $needle    <p>The string to find in haystack.<br>Or a code point as int.</p>
5914
+   * @param string $needle    <p>The string to find in haystack.<br>Or a code point as int.</p>
5915 5915
    * @param int        $offset    [optional] <p>May be specified to begin searching an arbitrary number of characters
5916 5916
    *                              into the string. Negative values will stop searching at an arbitrary point prior to
5917 5917
    *                              the end of the string.
@@ -6763,8 +6763,8 @@  discard block
 block discarded – undo
6763 6763
    *
6764 6764
    * source: https://gist.github.com/stemar/8287074
6765 6765
    *
6766
-   * @param string|string[] $str              <p>The input string or an array of stings.</p>
6767
-   * @param string|string[] $replacement      <p>The replacement string or an array of stings.</p>
6766
+   * @param string $str              <p>The input string or an array of stings.</p>
6767
+   * @param string $replacement      <p>The replacement string or an array of stings.</p>
6768 6768
    * @param int|int[]       $offset           <p>
6769 6769
    *                                          If start is positive, the replacing will begin at the start'th offset
6770 6770
    *                                          into string.
@@ -6772,7 +6772,7 @@  discard block
 block discarded – undo
6772 6772
    *                                          If start is negative, the replacing will begin at the start'th character
6773 6773
    *                                          from the end of string.
6774 6774
    *                                          </p>
6775
-   * @param int|int[]|void  $length           [optional] <p>If given and is positive, it represents the length of the
6775
+   * @param integer|null  $length           [optional] <p>If given and is positive, it represents the length of the
6776 6776
    *                                          portion of string which is to be replaced. If it is negative, it
6777 6777
    *                                          represents the number of characters from the end of string at which to
6778 6778
    *                                          stop replacing. If it is not given, then it will default to strlen(
@@ -7222,7 +7222,7 @@  discard block
 block discarded – undo
7222 7222
    * case.</li>
7223 7223
    * </ul>
7224 7224
    *
7225
-   * @param string|string[] $str                    <p>Any string or array.</p>
7225
+   * @param string $str                    <p>Any string or array.</p>
7226 7226
    * @param bool            $decodeHtmlEntityToUtf8 <p>Set to true, if you need to decode html-entities.</p>
7227 7227
    *
7228 7228
    * @return string|string[] <p>The UTF-8 encoded string.</p>
Please login to merge, or discard this 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;
@@ -980,10 +980,10 @@  discard block
 block discarded – undo
980 980
         &&
981 981
         self::$SUPPORT['mbstring'] === false
982 982
     ) {
983
-      trigger_error('UTF8::chr() without mbstring cannot handle "' . $encoding . '" encoding', E_USER_WARNING);
983
+      trigger_error('UTF8::chr() without mbstring cannot handle "'.$encoding.'" encoding', E_USER_WARNING);
984 984
     }
985 985
 
986
-    $cacheKey = $code_point . $encoding;
986
+    $cacheKey = $code_point.$encoding;
987 987
     if (isset($CHAR_CACHE[$cacheKey]) === true) {
988 988
       return $CHAR_CACHE[$cacheKey];
989 989
     }
@@ -1008,16 +1008,16 @@  discard block
 block discarded – undo
1008 1008
     if ($code_point <= 0x7F) {
1009 1009
       $str = self::chr_and_parse_int($code_point);
1010 1010
     } elseif ($code_point <= 0x7FF) {
1011
-      $str = self::chr_and_parse_int(($code_point >> 6) + 0xC0) .
1011
+      $str = self::chr_and_parse_int(($code_point >> 6) + 0xC0).
1012 1012
              self::chr_and_parse_int(($code_point & 0x3F) + 0x80);
1013 1013
     } elseif ($code_point <= 0xFFFF) {
1014
-      $str = self::chr_and_parse_int(($code_point >> 12) + 0xE0) .
1015
-             self::chr_and_parse_int((($code_point >> 6) & 0x3F) + 0x80) .
1014
+      $str = self::chr_and_parse_int(($code_point >> 12) + 0xE0).
1015
+             self::chr_and_parse_int((($code_point >> 6) & 0x3F) + 0x80).
1016 1016
              self::chr_and_parse_int(($code_point & 0x3F) + 0x80);
1017 1017
     } else {
1018
-      $str = self::chr_and_parse_int(($code_point >> 18) + 0xF0) .
1019
-             self::chr_and_parse_int((($code_point >> 12) & 0x3F) + 0x80) .
1020
-             self::chr_and_parse_int((($code_point >> 6) & 0x3F) + 0x80) .
1018
+      $str = self::chr_and_parse_int(($code_point >> 18) + 0xF0).
1019
+             self::chr_and_parse_int((($code_point >> 12) & 0x3F) + 0x80).
1020
+             self::chr_and_parse_int((($code_point >> 6) & 0x3F) + 0x80).
1021 1021
              self::chr_and_parse_int(($code_point & 0x3F) + 0x80);
1022 1022
     }
1023 1023
 
@@ -1077,7 +1077,7 @@  discard block
 block discarded – undo
1077 1077
     }
1078 1078
 
1079 1079
     return array_map(
1080
-        function ($data) {
1080
+        function($data) {
1081 1081
           return self::strlen($data, '8BIT');
1082 1082
         },
1083 1083
         self::split($str)
@@ -1319,7 +1319,7 @@  discard block
 block discarded – undo
1319 1319
       $flags = ENT_QUOTES;
1320 1320
     }
1321 1321
 
1322
-    return self::html_entity_decode('&#' . $int . ';', $flags);
1322
+    return self::html_entity_decode('&#'.$int.';', $flags);
1323 1323
   }
1324 1324
 
1325 1325
   /**
@@ -1396,7 +1396,7 @@  discard block
 block discarded – undo
1396 1396
           &&
1397 1397
           self::$SUPPORT['mbstring'] === false
1398 1398
       ) {
1399
-        trigger_error('UTF8::encode() without mbstring cannot handle "' . $encoding . '" encoding', E_USER_WARNING);
1399
+        trigger_error('UTF8::encode() without mbstring cannot handle "'.$encoding.'" encoding', E_USER_WARNING);
1400 1400
       }
1401 1401
 
1402 1402
       $strEncoded = \mb_convert_encoding(
@@ -1605,7 +1605,7 @@  discard block
 block discarded – undo
1605 1605
           ) {
1606 1606
             // Prevent leading combining chars
1607 1607
             // for NFC-safe concatenations.
1608
-            $var = $leading_combining . $var;
1608
+            $var = $leading_combining.$var;
1609 1609
           }
1610 1610
         }
1611 1611
 
@@ -2029,7 +2029,7 @@  discard block
 block discarded – undo
2029 2029
    */
2030 2030
   private static function getData($file)
2031 2031
   {
2032
-    $file = __DIR__ . '/data/' . $file . '.php';
2032
+    $file = __DIR__.'/data/'.$file.'.php';
2033 2033
     if (file_exists($file)) {
2034 2034
       /** @noinspection PhpIncludeInspection */
2035 2035
       return require $file;
@@ -2174,7 +2174,7 @@  discard block
 block discarded – undo
2174 2174
     return implode(
2175 2175
         '',
2176 2176
         array_map(
2177
-            function ($data) use ($keepAsciiChars, $encoding) {
2177
+            function($data) use ($keepAsciiChars, $encoding) {
2178 2178
               return self::single_chr_html_encode($data, $keepAsciiChars, $encoding);
2179 2179
             },
2180 2180
             self::split($str)
@@ -2295,7 +2295,7 @@  discard block
 block discarded – undo
2295 2295
         &&
2296 2296
         self::$SUPPORT['mbstring'] === false
2297 2297
     ) {
2298
-      trigger_error('UTF8::html_entity_decode() without mbstring cannot handle "' . $encoding . '" encoding', E_USER_WARNING);
2298
+      trigger_error('UTF8::html_entity_decode() without mbstring cannot handle "'.$encoding.'" encoding', E_USER_WARNING);
2299 2299
     }
2300 2300
 
2301 2301
     do {
@@ -2303,7 +2303,7 @@  discard block
 block discarded – undo
2303 2303
 
2304 2304
       $str = preg_replace_callback(
2305 2305
           "/&#\d{2,6};/",
2306
-          function ($matches) use ($encoding) {
2306
+          function($matches) use ($encoding) {
2307 2307
             $returnTmp = \mb_convert_encoding($matches[0], $encoding, 'HTML-ENTITIES');
2308 2308
 
2309 2309
             if ($returnTmp !== '"' && $returnTmp !== "'") {
@@ -2637,9 +2637,9 @@  discard block
 block discarded – undo
2637 2637
     if ((int)$int === $int) {
2638 2638
       $hex = dechex($int);
2639 2639
 
2640
-      $hex = (strlen($hex) < 4 ? substr('0000' . $hex, -4) : $hex);
2640
+      $hex = (strlen($hex) < 4 ? substr('0000'.$hex, -4) : $hex);
2641 2641
 
2642
-      return $pfix . $hex;
2642
+      return $pfix.$hex;
2643 2643
     }
2644 2644
 
2645 2645
     return '';
@@ -3380,7 +3380,7 @@  discard block
 block discarded – undo
3380 3380
         $cleanUtf8
3381 3381
     );
3382 3382
 
3383
-    return $strPartOne . $strPartTwo;
3383
+    return $strPartOne.$strPartTwo;
3384 3384
   }
3385 3385
 
3386 3386
   /**
@@ -3470,7 +3470,7 @@  discard block
 block discarded – undo
3470 3470
       return preg_replace('/^[\pZ\pC]+/u', '', $str);
3471 3471
     }
3472 3472
 
3473
-    return preg_replace('/^' . self::rxClass($chars) . '+/u', '', $str);
3473
+    return preg_replace('/^'.self::rxClass($chars).'+/u', '', $str);
3474 3474
   }
3475 3475
 
3476 3476
   /**
@@ -3826,7 +3826,7 @@  discard block
 block discarded – undo
3826 3826
       }
3827 3827
     }
3828 3828
 
3829
-    $cacheKey = $chr_orig . $encoding;
3829
+    $cacheKey = $chr_orig.$encoding;
3830 3830
     if (isset($CHAR_CACHE[$cacheKey]) === true) {
3831 3831
       return $CHAR_CACHE[$cacheKey];
3832 3832
     }
@@ -4060,7 +4060,7 @@  discard block
 block discarded – undo
4060 4060
     if (is_array($what) === true) {
4061 4061
       /** @noinspection ForeachSourceInspection */
4062 4062
       foreach ($what as $item) {
4063
-        $str = preg_replace('/(' . preg_quote($item, '/') . ')+/', $item, $str);
4063
+        $str = preg_replace('/('.preg_quote($item, '/').')+/', $item, $str);
4064 4064
       }
4065 4065
     }
4066 4066
 
@@ -4168,7 +4168,7 @@  discard block
 block discarded – undo
4168 4168
       return preg_replace('/[\pZ\pC]+$/u', '', $str);
4169 4169
     }
4170 4170
 
4171
-    return preg_replace('/' . self::rxClass($chars) . '+$/u', '', $str);
4171
+    return preg_replace('/'.self::rxClass($chars).'+$/u', '', $str);
4172 4172
   }
4173 4173
 
4174 4174
   /**
@@ -4183,7 +4183,7 @@  discard block
 block discarded – undo
4183 4183
   {
4184 4184
     static $RX_CLASSS_CACHE = array();
4185 4185
 
4186
-    $cacheKey = $s . $class;
4186
+    $cacheKey = $s.$class;
4187 4187
 
4188 4188
     if (isset($RX_CLASSS_CACHE[$cacheKey])) {
4189 4189
       return $RX_CLASSS_CACHE[$cacheKey];
@@ -4195,7 +4195,7 @@  discard block
 block discarded – undo
4195 4195
     /** @noinspection SuspiciousLoopInspection */
4196 4196
     foreach (self::str_split($s) as $s) {
4197 4197
       if ('-' === $s) {
4198
-        $class[0] = '-' . $class[0];
4198
+        $class[0] = '-'.$class[0];
4199 4199
       } elseif (!isset($s[2])) {
4200 4200
         $class[0] .= preg_quote($s, '/');
4201 4201
       } elseif (1 === self::strlen($s)) {
@@ -4206,13 +4206,13 @@  discard block
 block discarded – undo
4206 4206
     }
4207 4207
 
4208 4208
     if ($class[0]) {
4209
-      $class[0] = '[' . $class[0] . ']';
4209
+      $class[0] = '['.$class[0].']';
4210 4210
     }
4211 4211
 
4212 4212
     if (1 === count($class)) {
4213 4213
       $return = $class[0];
4214 4214
     } else {
4215
-      $return = '(?:' . implode('|', $class) . ')';
4215
+      $return = '(?:'.implode('|', $class).')';
4216 4216
     }
4217 4217
 
4218 4218
     $RX_CLASSS_CACHE[$cacheKey] = $return;
@@ -4230,7 +4230,7 @@  discard block
 block discarded – undo
4230 4230
     }
4231 4231
 
4232 4232
     foreach (self::$SUPPORT as $utf8Support) {
4233
-      echo $utf8Support . "\n<br>";
4233
+      echo $utf8Support."\n<br>";
4234 4234
     }
4235 4235
   }
4236 4236
 
@@ -4263,7 +4263,7 @@  discard block
 block discarded – undo
4263 4263
       $encoding = self::normalize_encoding($encoding, 'UTF-8');
4264 4264
     }
4265 4265
 
4266
-    return '&#' . self::ord($char, $encoding) . ';';
4266
+    return '&#'.self::ord($char, $encoding).';';
4267 4267
   }
4268 4268
 
4269 4269
   /**
@@ -4330,7 +4330,7 @@  discard block
 block discarded – undo
4330 4330
         ) {
4331 4331
 
4332 4332
           if (($str[$i + 1] & "\xC0") === "\x80") {
4333
-            $ret[] = $str[$i] . $str[$i + 1];
4333
+            $ret[] = $str[$i].$str[$i + 1];
4334 4334
 
4335 4335
             $i++;
4336 4336
           }
@@ -4346,7 +4346,7 @@  discard block
 block discarded – undo
4346 4346
               &&
4347 4347
               ($str[$i + 2] & "\xC0") === "\x80"
4348 4348
           ) {
4349
-            $ret[] = $str[$i] . $str[$i + 1] . $str[$i + 2];
4349
+            $ret[] = $str[$i].$str[$i + 1].$str[$i + 2];
4350 4350
 
4351 4351
             $i += 2;
4352 4352
           }
@@ -4364,7 +4364,7 @@  discard block
 block discarded – undo
4364 4364
               &&
4365 4365
               ($str[$i + 3] & "\xC0") === "\x80"
4366 4366
           ) {
4367
-            $ret[] = $str[$i] . $str[$i + 1] . $str[$i + 2] . $str[$i + 3];
4367
+            $ret[] = $str[$i].$str[$i + 1].$str[$i + 2].$str[$i + 3];
4368 4368
 
4369 4369
             $i += 3;
4370 4370
           }
@@ -4377,7 +4377,7 @@  discard block
 block discarded – undo
4377 4377
       $ret = array_chunk($ret, $length);
4378 4378
 
4379 4379
       return array_map(
4380
-          function ($item) {
4380
+          function($item) {
4381 4381
             return implode('', $item);
4382 4382
           }, $ret
4383 4383
       );
@@ -4483,7 +4483,7 @@  discard block
 block discarded – undo
4483 4483
     foreach (self::$ICONV_ENCODING as $encodingTmp) {
4484 4484
       # INFO: //IGNORE and //TRANSLIT still throw notice
4485 4485
       /** @noinspection PhpUsageOfSilenceOperatorInspection */
4486
-      if (md5(@\iconv($encodingTmp, $encodingTmp . '//IGNORE', $str)) === $md5) {
4486
+      if (md5(@\iconv($encodingTmp, $encodingTmp.'//IGNORE', $str)) === $md5) {
4487 4487
         return $encodingTmp;
4488 4488
       }
4489 4489
     }
@@ -4578,7 +4578,7 @@  discard block
 block discarded – undo
4578 4578
       if ('' === $s .= '') {
4579 4579
         $s = '/^(?<=.)$/';
4580 4580
       } else {
4581
-        $s = '/' . preg_quote($s, '/') . '/ui';
4581
+        $s = '/'.preg_quote($s, '/').'/ui';
4582 4582
       }
4583 4583
     }
4584 4584
 
@@ -4636,7 +4636,7 @@  discard block
 block discarded – undo
4636 4636
     }
4637 4637
 
4638 4638
     if (self::substr($str, $length - 1, 1) === ' ') {
4639
-      return (string)self::substr($str, 0, $length - 1) . $strAddOn;
4639
+      return (string)self::substr($str, 0, $length - 1).$strAddOn;
4640 4640
     }
4641 4641
 
4642 4642
     $str = (string)self::substr($str, 0, $length);
@@ -4645,9 +4645,9 @@  discard block
 block discarded – undo
4645 4645
     $new_str = implode(' ', $array);
4646 4646
 
4647 4647
     if ($new_str === '') {
4648
-      $str = (string)self::substr($str, 0, $length - 1) . $strAddOn;
4648
+      $str = (string)self::substr($str, 0, $length - 1).$strAddOn;
4649 4649
     } else {
4650
-      $str = $new_str . $strAddOn;
4650
+      $str = $new_str.$strAddOn;
4651 4651
     }
4652 4652
 
4653 4653
     return $str;
@@ -4702,7 +4702,7 @@  discard block
 block discarded – undo
4702 4702
           $pre = '';
4703 4703
       }
4704 4704
 
4705
-      return $pre . $str . $post;
4705
+      return $pre.$str.$post;
4706 4706
     }
4707 4707
 
4708 4708
     return $str;
@@ -4852,7 +4852,7 @@  discard block
 block discarded – undo
4852 4852
     }
4853 4853
 
4854 4854
     /** @noinspection PhpInternalEntityUsedInspection */
4855
-    preg_match_all('/' . self::GRAPHEME_CLUSTER_RX . '/u', $str, $a);
4855
+    preg_match_all('/'.self::GRAPHEME_CLUSTER_RX.'/u', $str, $a);
4856 4856
     $a = $a[0];
4857 4857
 
4858 4858
     if ($len === 1) {
@@ -5088,7 +5088,7 @@  discard block
 block discarded – undo
5088 5088
   public static function strcmp($str1, $str2)
5089 5089
   {
5090 5090
     /** @noinspection PhpUndefinedClassInspection */
5091
-    return $str1 . '' === $str2 . '' ? 0 : strcmp(
5091
+    return $str1.'' === $str2.'' ? 0 : strcmp(
5092 5092
         \Normalizer::normalize($str1, \Normalizer::NFD),
5093 5093
         \Normalizer::normalize($str2, \Normalizer::NFD)
5094 5094
     );
@@ -5123,7 +5123,7 @@  discard block
 block discarded – undo
5123 5123
       return null;
5124 5124
     }
5125 5125
 
5126
-    if (preg_match('/^(.*?)' . self::rxClass($charList) . '/us', $str, $length)) {
5126
+    if (preg_match('/^(.*?)'.self::rxClass($charList).'/us', $str, $length)) {
5127 5127
       /** @noinspection OffsetOperationsInspection */
5128 5128
       return self::strlen($length[1]);
5129 5129
     }
@@ -5334,7 +5334,7 @@  discard block
 block discarded – undo
5334 5334
         &&
5335 5335
         self::$SUPPORT['mbstring'] === false
5336 5336
     ) {
5337
-      trigger_error('UTF8::stristr() without mbstring cannot handle "' . $encoding . '" encoding', E_USER_WARNING);
5337
+      trigger_error('UTF8::stristr() without mbstring cannot handle "'.$encoding.'" encoding', E_USER_WARNING);
5338 5338
     }
5339 5339
 
5340 5340
     if (self::$SUPPORT['mbstring'] === true) {
@@ -5355,7 +5355,7 @@  discard block
 block discarded – undo
5355 5355
       return stristr($haystack, $needle, $before_needle);
5356 5356
     }
5357 5357
 
5358
-    preg_match('/^(.*?)' . preg_quote($needle, '/') . '/usi', $haystack, $match);
5358
+    preg_match('/^(.*?)'.preg_quote($needle, '/').'/usi', $haystack, $match);
5359 5359
 
5360 5360
     if (!isset($match[1])) {
5361 5361
       return false;
@@ -5430,7 +5430,7 @@  discard block
 block discarded – undo
5430 5430
         &&
5431 5431
         self::$SUPPORT['iconv'] === false
5432 5432
     ) {
5433
-      trigger_error('UTF8::strlen() without mbstring / iconv cannot handle "' . $encoding . '" encoding', E_USER_WARNING);
5433
+      trigger_error('UTF8::strlen() without mbstring / iconv cannot handle "'.$encoding.'" encoding', E_USER_WARNING);
5434 5434
     }
5435 5435
 
5436 5436
     if (
@@ -5509,7 +5509,7 @@  discard block
 block discarded – undo
5509 5509
    */
5510 5510
   public static function strnatcmp($str1, $str2)
5511 5511
   {
5512
-    return $str1 . '' === $str2 . '' ? 0 : strnatcmp(self::strtonatfold($str1), self::strtonatfold($str2));
5512
+    return $str1.'' === $str2.'' ? 0 : strnatcmp(self::strtonatfold($str1), self::strtonatfold($str2));
5513 5513
   }
5514 5514
 
5515 5515
   /**
@@ -5570,7 +5570,7 @@  discard block
 block discarded – undo
5570 5570
       return false;
5571 5571
     }
5572 5572
 
5573
-    if (preg_match('/' . self::rxClass($char_list) . '/us', $haystack, $m)) {
5573
+    if (preg_match('/'.self::rxClass($char_list).'/us', $haystack, $m)) {
5574 5574
       return substr($haystack, strpos($haystack, $m[0]));
5575 5575
     }
5576 5576
 
@@ -5647,7 +5647,7 @@  discard block
 block discarded – undo
5647 5647
         &&
5648 5648
         self::$SUPPORT['mbstring'] === false
5649 5649
     ) {
5650
-      trigger_error('UTF8::strpos() without mbstring / iconv cannot handle "' . $encoding . '" encoding', E_USER_WARNING);
5650
+      trigger_error('UTF8::strpos() without mbstring / iconv cannot handle "'.$encoding.'" encoding', E_USER_WARNING);
5651 5651
     }
5652 5652
 
5653 5653
     if (
@@ -5879,7 +5879,7 @@  discard block
 block discarded – undo
5879 5879
         &&
5880 5880
         self::$SUPPORT['mbstring'] === false
5881 5881
     ) {
5882
-      trigger_error('UTF8::strripos() without mbstring cannot handle "' . $encoding . '" encoding', E_USER_WARNING);
5882
+      trigger_error('UTF8::strripos() without mbstring cannot handle "'.$encoding.'" encoding', E_USER_WARNING);
5883 5883
     }
5884 5884
 
5885 5885
     if (self::$SUPPORT['mbstring'] === true) {
@@ -5962,7 +5962,7 @@  discard block
 block discarded – undo
5962 5962
         &&
5963 5963
         self::$SUPPORT['mbstring'] === false
5964 5964
     ) {
5965
-      trigger_error('UTF8::strrpos() without mbstring cannot handle "' . $encoding . '" encoding', E_USER_WARNING);
5965
+      trigger_error('UTF8::strrpos() without mbstring cannot handle "'.$encoding.'" encoding', E_USER_WARNING);
5966 5966
     }
5967 5967
 
5968 5968
     if (self::$SUPPORT['mbstring'] === true) {
@@ -6030,7 +6030,7 @@  discard block
 block discarded – undo
6030 6030
       return 0;
6031 6031
     }
6032 6032
 
6033
-    return preg_match('/^' . self::rxClass($mask) . '+/u', $str, $str) ? self::strlen($str[0]) : 0;
6033
+    return preg_match('/^'.self::rxClass($mask).'+/u', $str, $str) ? self::strlen($str[0]) : 0;
6034 6034
   }
6035 6035
 
6036 6036
   /**
@@ -6076,7 +6076,7 @@  discard block
 block discarded – undo
6076 6076
         &&
6077 6077
         self::$SUPPORT['mbstring'] === false
6078 6078
     ) {
6079
-      trigger_error('UTF8::strstr() without mbstring cannot handle "' . $encoding . '" encoding', E_USER_WARNING);
6079
+      trigger_error('UTF8::strstr() without mbstring cannot handle "'.$encoding.'" encoding', E_USER_WARNING);
6080 6080
     }
6081 6081
 
6082 6082
     if (self::$SUPPORT['mbstring'] === true) {
@@ -6093,7 +6093,7 @@  discard block
 block discarded – undo
6093 6093
       return \grapheme_strstr($haystack, $needle, $before_needle);
6094 6094
     }
6095 6095
 
6096
-    preg_match('/^(.*?)' . preg_quote($needle, '/') . '/us', $haystack, $match);
6096
+    preg_match('/^(.*?)'.preg_quote($needle, '/').'/us', $haystack, $match);
6097 6097
 
6098 6098
     if (!isset($match[1])) {
6099 6099
       return false;
@@ -6200,9 +6200,9 @@  discard block
 block discarded – undo
6200 6200
           Bootup::is_php('5.4') === true
6201 6201
       ) {
6202 6202
 
6203
-        $langCode = $lang . '-Lower';
6203
+        $langCode = $lang.'-Lower';
6204 6204
         if (!in_array($langCode, self::$SUPPORT['intl__transliterator_list_ids'], true)) {
6205
-          trigger_error('UTF8::strtolower() without intl for special language: ' . $lang, E_USER_WARNING);
6205
+          trigger_error('UTF8::strtolower() without intl for special language: '.$lang, E_USER_WARNING);
6206 6206
 
6207 6207
           $langCode = 'Any-Lower';
6208 6208
         }
@@ -6210,7 +6210,7 @@  discard block
 block discarded – undo
6210 6210
         return transliterator_transliterate($langCode, $str);
6211 6211
       }
6212 6212
 
6213
-      trigger_error('UTF8::strtolower() without intl + PHP >= 5.4 cannot handle the "lang"-parameter: ' . $lang, E_USER_WARNING);
6213
+      trigger_error('UTF8::strtolower() without intl + PHP >= 5.4 cannot handle the "lang"-parameter: '.$lang, E_USER_WARNING);
6214 6214
     }
6215 6215
 
6216 6216
     return \mb_strtolower($str, $encoding);
@@ -6270,9 +6270,9 @@  discard block
 block discarded – undo
6270 6270
           Bootup::is_php('5.4') === true
6271 6271
       ) {
6272 6272
 
6273
-        $langCode = $lang . '-Upper';
6273
+        $langCode = $lang.'-Upper';
6274 6274
         if (!in_array($langCode, self::$SUPPORT['intl__transliterator_list_ids'], true)) {
6275
-          trigger_error('UTF8::strtoupper() without intl for special language: ' . $lang, E_USER_WARNING);
6275
+          trigger_error('UTF8::strtoupper() without intl for special language: '.$lang, E_USER_WARNING);
6276 6276
 
6277 6277
           $langCode = 'Any-Upper';
6278 6278
         }
@@ -6280,7 +6280,7 @@  discard block
 block discarded – undo
6280 6280
         return transliterator_transliterate($langCode, $str);
6281 6281
       }
6282 6282
 
6283
-      trigger_error('UTF8::strtolower() without intl + PHP >= 5.4 cannot handle the "lang"-parameter: ' . $lang, E_USER_WARNING);
6283
+      trigger_error('UTF8::strtolower() without intl + PHP >= 5.4 cannot handle the "lang"-parameter: '.$lang, E_USER_WARNING);
6284 6284
     }
6285 6285
 
6286 6286
     return \mb_strtoupper($str, $encoding);
@@ -6385,7 +6385,7 @@  discard block
 block discarded – undo
6385 6385
 
6386 6386
     $return = array();
6387 6387
     foreach ($array as $key => $value) {
6388
-      if ($case  === CASE_LOWER) {
6388
+      if ($case === CASE_LOWER) {
6389 6389
         $key = self::strtolower($key);
6390 6390
       } else {
6391 6391
         $key = self::strtoupper($key);
@@ -6480,7 +6480,7 @@  discard block
 block discarded – undo
6480 6480
         &&
6481 6481
         self::$SUPPORT['mbstring'] === false
6482 6482
     ) {
6483
-      trigger_error('UTF8::substr() without mbstring cannot handle "' . $encoding . '" encoding', E_USER_WARNING);
6483
+      trigger_error('UTF8::substr() without mbstring cannot handle "'.$encoding.'" encoding', E_USER_WARNING);
6484 6484
     }
6485 6485
 
6486 6486
     if (self::$SUPPORT['mbstring'] === true) {
@@ -6507,8 +6507,7 @@  discard block
 block discarded – undo
6507 6507
 
6508 6508
     if (self::is_ascii($str)) {
6509 6509
       return ($length === null) ?
6510
-          substr($str, $offset) :
6511
-          substr($str, $offset, $length);
6510
+          substr($str, $offset) : substr($str, $offset, $length);
6512 6511
     }
6513 6512
 
6514 6513
     // fallback via vanilla php
@@ -6643,14 +6642,14 @@  discard block
 block discarded – undo
6643 6642
         &&
6644 6643
         self::$SUPPORT['mbstring'] === false
6645 6644
     ) {
6646
-      trigger_error('UTF8::substr_count() without mbstring cannot handle "' . $encoding . '" encoding', E_USER_WARNING);
6645
+      trigger_error('UTF8::substr_count() without mbstring cannot handle "'.$encoding.'" encoding', E_USER_WARNING);
6647 6646
     }
6648 6647
 
6649 6648
     if (self::$SUPPORT['mbstring'] === true) {
6650 6649
       return \mb_substr_count($haystack, $needle, $encoding);
6651 6650
     }
6652 6651
 
6653
-    preg_match_all('/' . preg_quote($needle, '/') . '/us', $haystack, $matches, PREG_SET_ORDER);
6652
+    preg_match_all('/'.preg_quote($needle, '/').'/us', $haystack, $matches, PREG_SET_ORDER);
6654 6653
 
6655 6654
     return count($matches);
6656 6655
   }
@@ -6840,8 +6839,7 @@  discard block
 block discarded – undo
6840 6839
 
6841 6840
     if (self::is_ascii($str)) {
6842 6841
       return ($length === null) ?
6843
-          substr_replace($str, $replacement, $offset) :
6844
-          substr_replace($str, $replacement, $offset, $length);
6842
+          substr_replace($str, $replacement, $offset) : substr_replace($str, $replacement, $offset, $length);
6845 6843
     }
6846 6844
 
6847 6845
     preg_match_all('/./us', $str, $smatches);
@@ -6917,7 +6915,7 @@  discard block
 block discarded – undo
6917 6915
 
6918 6916
     $strSwappedCase = preg_replace_callback(
6919 6917
         '/[\S]/u',
6920
-        function ($match) use ($encoding) {
6918
+        function($match) use ($encoding) {
6921 6919
           $marchToUpper = self::strtoupper($match[0], $encoding);
6922 6920
 
6923 6921
           if ($match[0] === $marchToUpper) {
@@ -7260,7 +7258,7 @@  discard block
 block discarded – undo
7260 7258
           $c2 = $i + 1 >= $max ? "\x00" : $str[$i + 1];
7261 7259
 
7262 7260
           if ($c2 >= "\x80" && $c2 <= "\xBF") { // yeah, almost sure it's UTF8 already
7263
-            $buf .= $c1 . $c2;
7261
+            $buf .= $c1.$c2;
7264 7262
             $i++;
7265 7263
           } else { // not valid UTF8 - convert it
7266 7264
             $buf .= self::to_utf8_convert($c1);
@@ -7272,7 +7270,7 @@  discard block
 block discarded – undo
7272 7270
           $c3 = $i + 2 >= $max ? "\x00" : $str[$i + 2];
7273 7271
 
7274 7272
           if ($c2 >= "\x80" && $c2 <= "\xBF" && $c3 >= "\x80" && $c3 <= "\xBF") { // yeah, almost sure it's UTF8 already
7275
-            $buf .= $c1 . $c2 . $c3;
7273
+            $buf .= $c1.$c2.$c3;
7276 7274
             $i += 2;
7277 7275
           } else { // not valid UTF8 - convert it
7278 7276
             $buf .= self::to_utf8_convert($c1);
@@ -7285,7 +7283,7 @@  discard block
 block discarded – undo
7285 7283
           $c4 = $i + 3 >= $max ? "\x00" : $str[$i + 3];
7286 7284
 
7287 7285
           if ($c2 >= "\x80" && $c2 <= "\xBF" && $c3 >= "\x80" && $c3 <= "\xBF" && $c4 >= "\x80" && $c4 <= "\xBF") { // yeah, almost sure it's UTF8 already
7288
-            $buf .= $c1 . $c2 . $c3 . $c4;
7286
+            $buf .= $c1.$c2.$c3.$c4;
7289 7287
             $i += 3;
7290 7288
           } else { // not valid UTF8 - convert it
7291 7289
             $buf .= self::to_utf8_convert($c1);
@@ -7307,7 +7305,7 @@  discard block
 block discarded – undo
7307 7305
     // decode unicode escape sequences
7308 7306
     $buf = preg_replace_callback(
7309 7307
         '/\\\\u([0-9a-f]{4})/i',
7310
-        function ($match) {
7308
+        function($match) {
7311 7309
           return \mb_convert_encoding(pack('H*', $match[1]), 'UTF-8', 'UCS-2BE');
7312 7310
         },
7313 7311
         $buf
@@ -7336,7 +7334,7 @@  discard block
 block discarded – undo
7336 7334
     } else {
7337 7335
       $cc1 = self::chr_and_parse_int($ordC1 / 64) | "\xC0";
7338 7336
       $cc2 = ($int & "\x3F") | "\x80";
7339
-      $buf .= $cc1 . $cc2;
7337
+      $buf .= $cc1.$cc2;
7340 7338
     }
7341 7339
 
7342 7340
     return $buf;
@@ -7399,7 +7397,7 @@  discard block
 block discarded – undo
7399 7397
         $cleanUtf8
7400 7398
     );
7401 7399
 
7402
-    return $strPartOne . $strPartTwo;
7400
+    return $strPartOne.$strPartTwo;
7403 7401
   }
7404 7402
 
7405 7403
   /**
@@ -7444,7 +7442,7 @@  discard block
 block discarded – undo
7444 7442
       $str = self::clean($str);
7445 7443
     }
7446 7444
 
7447
-    $usePhpDefaultFunctions = !(bool)($charlist . implode('', $exceptions));
7445
+    $usePhpDefaultFunctions = !(bool)($charlist.implode('', $exceptions));
7448 7446
 
7449 7447
     if (
7450 7448
         $usePhpDefaultFunctions === true
@@ -7931,7 +7929,7 @@  discard block
 block discarded – undo
7931 7929
       return '';
7932 7930
     }
7933 7931
 
7934
-    preg_match('/^\s*+(?:\S++\s*+){1,' . $limit . '}/u', $str, $matches);
7932
+    preg_match('/^\s*+(?:\S++\s*+){1,'.$limit.'}/u', $str, $matches);
7935 7933
 
7936 7934
     if (
7937 7935
         !isset($matches[0])
@@ -7941,7 +7939,7 @@  discard block
 block discarded – undo
7941 7939
       return $str;
7942 7940
     }
7943 7941
 
7944
-    return self::rtrim($matches[0]) . $strAddOn;
7942
+    return self::rtrim($matches[0]).$strAddOn;
7945 7943
   }
7946 7944
 
7947 7945
   /**
@@ -8009,7 +8007,7 @@  discard block
 block discarded – undo
8009 8007
       $strReturn .= $break;
8010 8008
     }
8011 8009
 
8012
-    return $strReturn . implode('', $chars);
8010
+    return $strReturn.implode('', $chars);
8013 8011
   }
8014 8012
 
8015 8013
   /**
Please login to merge, or discard this patch.