Completed
Push — master ( faa8e4...410843 )
by Lars
19:19 queued 07:20
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   +75 added lines, -77 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
   /**
@@ -1393,7 +1393,7 @@  discard block
 block discarded – undo
1393 1393
           &&
1394 1394
           self::$SUPPORT['mbstring'] === false
1395 1395
       ) {
1396
-        trigger_error('UTF8::encode() without mbstring cannot handle "' . $encoding . '" encoding', E_USER_WARNING);
1396
+        trigger_error('UTF8::encode() without mbstring cannot handle "'.$encoding.'" encoding', E_USER_WARNING);
1397 1397
       }
1398 1398
 
1399 1399
       $strEncoded = \mb_convert_encoding(
@@ -1602,7 +1602,7 @@  discard block
 block discarded – undo
1602 1602
           ) {
1603 1603
             // Prevent leading combining chars
1604 1604
             // for NFC-safe concatenations.
1605
-            $var = $leading_combining . $var;
1605
+            $var = $leading_combining.$var;
1606 1606
           }
1607 1607
         }
1608 1608
 
@@ -2026,7 +2026,7 @@  discard block
 block discarded – undo
2026 2026
    */
2027 2027
   private static function getData($file)
2028 2028
   {
2029
-    $file = __DIR__ . '/data/' . $file . '.php';
2029
+    $file = __DIR__.'/data/'.$file.'.php';
2030 2030
     if (file_exists($file)) {
2031 2031
       /** @noinspection PhpIncludeInspection */
2032 2032
       return require $file;
@@ -2171,7 +2171,7 @@  discard block
 block discarded – undo
2171 2171
     return implode(
2172 2172
         '',
2173 2173
         array_map(
2174
-            function ($data) use ($keepAsciiChars, $encoding) {
2174
+            function($data) use ($keepAsciiChars, $encoding) {
2175 2175
               return self::single_chr_html_encode($data, $keepAsciiChars, $encoding);
2176 2176
             },
2177 2177
             self::split($str)
@@ -2292,7 +2292,7 @@  discard block
 block discarded – undo
2292 2292
         &&
2293 2293
         self::$SUPPORT['mbstring'] === false
2294 2294
     ) {
2295
-      trigger_error('UTF8::html_entity_decode() without mbstring cannot handle "' . $encoding . '" encoding', E_USER_WARNING);
2295
+      trigger_error('UTF8::html_entity_decode() without mbstring cannot handle "'.$encoding.'" encoding', E_USER_WARNING);
2296 2296
     }
2297 2297
 
2298 2298
     do {
@@ -2300,7 +2300,7 @@  discard block
 block discarded – undo
2300 2300
 
2301 2301
       $str = preg_replace_callback(
2302 2302
           "/&#\d{2,6};/",
2303
-          function ($matches) use ($encoding) {
2303
+          function($matches) use ($encoding) {
2304 2304
             $returnTmp = \mb_convert_encoding($matches[0], $encoding, 'HTML-ENTITIES');
2305 2305
 
2306 2306
             if ($returnTmp !== '"' && $returnTmp !== "'") {
@@ -2634,9 +2634,9 @@  discard block
 block discarded – undo
2634 2634
     if ((int)$int === $int) {
2635 2635
       $hex = dechex($int);
2636 2636
 
2637
-      $hex = (strlen($hex) < 4 ? substr('0000' . $hex, -4) : $hex);
2637
+      $hex = (strlen($hex) < 4 ? substr('0000'.$hex, -4) : $hex);
2638 2638
 
2639
-      return $pfix . $hex;
2639
+      return $pfix.$hex;
2640 2640
     }
2641 2641
 
2642 2642
     return '';
@@ -3377,7 +3377,7 @@  discard block
 block discarded – undo
3377 3377
         $cleanUtf8
3378 3378
     );
3379 3379
 
3380
-    return $strPartOne . $strPartTwo;
3380
+    return $strPartOne.$strPartTwo;
3381 3381
   }
3382 3382
 
3383 3383
   /**
@@ -3467,7 +3467,7 @@  discard block
 block discarded – undo
3467 3467
       return preg_replace('/^[\pZ\pC]+/u', '', $str);
3468 3468
     }
3469 3469
 
3470
-    return preg_replace('/^' . self::rxClass($chars) . '+/u', '', $str);
3470
+    return preg_replace('/^'.self::rxClass($chars).'+/u', '', $str);
3471 3471
   }
3472 3472
 
3473 3473
   /**
@@ -4064,7 +4064,7 @@  discard block
 block discarded – undo
4064 4064
     if (is_array($what) === true) {
4065 4065
       /** @noinspection ForeachSourceInspection */
4066 4066
       foreach ($what as $item) {
4067
-        $str = preg_replace('/(' . preg_quote($item, '/') . ')+/', $item, $str);
4067
+        $str = preg_replace('/('.preg_quote($item, '/').')+/', $item, $str);
4068 4068
       }
4069 4069
     }
4070 4070
 
@@ -4172,7 +4172,7 @@  discard block
 block discarded – undo
4172 4172
       return preg_replace('/[\pZ\pC]+$/u', '', $str);
4173 4173
     }
4174 4174
 
4175
-    return preg_replace('/' . self::rxClass($chars) . '+$/u', '', $str);
4175
+    return preg_replace('/'.self::rxClass($chars).'+$/u', '', $str);
4176 4176
   }
4177 4177
 
4178 4178
   /**
@@ -4187,7 +4187,7 @@  discard block
 block discarded – undo
4187 4187
   {
4188 4188
     static $RX_CLASSS_CACHE = array();
4189 4189
 
4190
-    $cacheKey = $s . $class;
4190
+    $cacheKey = $s.$class;
4191 4191
 
4192 4192
     if (isset($RX_CLASSS_CACHE[$cacheKey])) {
4193 4193
       return $RX_CLASSS_CACHE[$cacheKey];
@@ -4199,7 +4199,7 @@  discard block
 block discarded – undo
4199 4199
     /** @noinspection SuspiciousLoopInspection */
4200 4200
     foreach (self::str_split($s) as $s) {
4201 4201
       if ('-' === $s) {
4202
-        $class[0] = '-' . $class[0];
4202
+        $class[0] = '-'.$class[0];
4203 4203
       } elseif (!isset($s[2])) {
4204 4204
         $class[0] .= preg_quote($s, '/');
4205 4205
       } elseif (1 === self::strlen($s)) {
@@ -4210,13 +4210,13 @@  discard block
 block discarded – undo
4210 4210
     }
4211 4211
 
4212 4212
     if ($class[0]) {
4213
-      $class[0] = '[' . $class[0] . ']';
4213
+      $class[0] = '['.$class[0].']';
4214 4214
     }
4215 4215
 
4216 4216
     if (1 === count($class)) {
4217 4217
       $return = $class[0];
4218 4218
     } else {
4219
-      $return = '(?:' . implode('|', $class) . ')';
4219
+      $return = '(?:'.implode('|', $class).')';
4220 4220
     }
4221 4221
 
4222 4222
     $RX_CLASSS_CACHE[$cacheKey] = $return;
@@ -4234,7 +4234,7 @@  discard block
 block discarded – undo
4234 4234
     }
4235 4235
 
4236 4236
     foreach (self::$SUPPORT as $utf8Support) {
4237
-      echo $utf8Support . "\n<br>";
4237
+      echo $utf8Support."\n<br>";
4238 4238
     }
4239 4239
   }
4240 4240
 
@@ -4267,7 +4267,7 @@  discard block
 block discarded – undo
4267 4267
       $encoding = self::normalize_encoding($encoding, 'UTF-8');
4268 4268
     }
4269 4269
 
4270
-    return '&#' . self::ord($char, $encoding) . ';';
4270
+    return '&#'.self::ord($char, $encoding).';';
4271 4271
   }
4272 4272
 
4273 4273
   /**
@@ -4334,7 +4334,7 @@  discard block
 block discarded – undo
4334 4334
         ) {
4335 4335
 
4336 4336
           if (($str[$i + 1] & "\xC0") === "\x80") {
4337
-            $ret[] = $str[$i] . $str[$i + 1];
4337
+            $ret[] = $str[$i].$str[$i + 1];
4338 4338
 
4339 4339
             $i++;
4340 4340
           }
@@ -4350,7 +4350,7 @@  discard block
 block discarded – undo
4350 4350
               &&
4351 4351
               ($str[$i + 2] & "\xC0") === "\x80"
4352 4352
           ) {
4353
-            $ret[] = $str[$i] . $str[$i + 1] . $str[$i + 2];
4353
+            $ret[] = $str[$i].$str[$i + 1].$str[$i + 2];
4354 4354
 
4355 4355
             $i += 2;
4356 4356
           }
@@ -4368,7 +4368,7 @@  discard block
 block discarded – undo
4368 4368
               &&
4369 4369
               ($str[$i + 3] & "\xC0") === "\x80"
4370 4370
           ) {
4371
-            $ret[] = $str[$i] . $str[$i + 1] . $str[$i + 2] . $str[$i + 3];
4371
+            $ret[] = $str[$i].$str[$i + 1].$str[$i + 2].$str[$i + 3];
4372 4372
 
4373 4373
             $i += 3;
4374 4374
           }
@@ -4381,7 +4381,7 @@  discard block
 block discarded – undo
4381 4381
       $ret = array_chunk($ret, $length);
4382 4382
 
4383 4383
       return array_map(
4384
-          function ($item) {
4384
+          function($item) {
4385 4385
             return implode('', $item);
4386 4386
           }, $ret
4387 4387
       );
@@ -4488,7 +4488,7 @@  discard block
 block discarded – undo
4488 4488
     foreach (self::$ICONV_ENCODING as $encodingTmp) {
4489 4489
       # INFO: //IGNORE and //TRANSLIT still throw notice
4490 4490
       /** @noinspection PhpUsageOfSilenceOperatorInspection */
4491
-      if (md5(@\iconv($encodingTmp, $encodingTmp . '//IGNORE', $str)) === $md5) {
4491
+      if (md5(@\iconv($encodingTmp, $encodingTmp.'//IGNORE', $str)) === $md5) {
4492 4492
         return $encodingTmp;
4493 4493
       }
4494 4494
     }
@@ -4583,7 +4583,7 @@  discard block
 block discarded – undo
4583 4583
       if ('' === $s .= '') {
4584 4584
         $s = '/^(?<=.)$/';
4585 4585
       } else {
4586
-        $s = '/' . preg_quote($s, '/') . '/ui';
4586
+        $s = '/'.preg_quote($s, '/').'/ui';
4587 4587
       }
4588 4588
     }
4589 4589
 
@@ -4641,7 +4641,7 @@  discard block
 block discarded – undo
4641 4641
     }
4642 4642
 
4643 4643
     if (self::substr($str, $length - 1, 1) === ' ') {
4644
-      return (string)self::substr($str, 0, $length - 1) . $strAddOn;
4644
+      return (string)self::substr($str, 0, $length - 1).$strAddOn;
4645 4645
     }
4646 4646
 
4647 4647
     $str = (string)self::substr($str, 0, $length);
@@ -4650,9 +4650,9 @@  discard block
 block discarded – undo
4650 4650
     $new_str = implode(' ', $array);
4651 4651
 
4652 4652
     if ($new_str === '') {
4653
-      $str = (string)self::substr($str, 0, $length - 1) . $strAddOn;
4653
+      $str = (string)self::substr($str, 0, $length - 1).$strAddOn;
4654 4654
     } else {
4655
-      $str = $new_str . $strAddOn;
4655
+      $str = $new_str.$strAddOn;
4656 4656
     }
4657 4657
 
4658 4658
     return $str;
@@ -4707,7 +4707,7 @@  discard block
 block discarded – undo
4707 4707
           $pre = '';
4708 4708
       }
4709 4709
 
4710
-      return $pre . $str . $post;
4710
+      return $pre.$str.$post;
4711 4711
     }
4712 4712
 
4713 4713
     return $str;
@@ -4857,7 +4857,7 @@  discard block
 block discarded – undo
4857 4857
     }
4858 4858
 
4859 4859
     /** @noinspection PhpInternalEntityUsedInspection */
4860
-    preg_match_all('/' . self::GRAPHEME_CLUSTER_RX . '/u', $str, $a);
4860
+    preg_match_all('/'.self::GRAPHEME_CLUSTER_RX.'/u', $str, $a);
4861 4861
     $a = $a[0];
4862 4862
 
4863 4863
     if ($len === 1) {
@@ -5093,7 +5093,7 @@  discard block
 block discarded – undo
5093 5093
   public static function strcmp($str1, $str2)
5094 5094
   {
5095 5095
     /** @noinspection PhpUndefinedClassInspection */
5096
-    return $str1 . '' === $str2 . '' ? 0 : strcmp(
5096
+    return $str1.'' === $str2.'' ? 0 : strcmp(
5097 5097
         \Normalizer::normalize($str1, \Normalizer::NFD),
5098 5098
         \Normalizer::normalize($str2, \Normalizer::NFD)
5099 5099
     );
@@ -5128,7 +5128,7 @@  discard block
 block discarded – undo
5128 5128
       return null;
5129 5129
     }
5130 5130
 
5131
-    if (preg_match('/^(.*?)' . self::rxClass($charList) . '/us', $str, $length)) {
5131
+    if (preg_match('/^(.*?)'.self::rxClass($charList).'/us', $str, $length)) {
5132 5132
       /** @noinspection OffsetOperationsInspection */
5133 5133
       return self::strlen($length[1]);
5134 5134
     }
@@ -5339,7 +5339,7 @@  discard block
 block discarded – undo
5339 5339
         &&
5340 5340
         self::$SUPPORT['mbstring'] === false
5341 5341
     ) {
5342
-      trigger_error('UTF8::stristr() without mbstring cannot handle "' . $encoding . '" encoding', E_USER_WARNING);
5342
+      trigger_error('UTF8::stristr() without mbstring cannot handle "'.$encoding.'" encoding', E_USER_WARNING);
5343 5343
     }
5344 5344
 
5345 5345
     if (self::$SUPPORT['mbstring'] === true) {
@@ -5360,7 +5360,7 @@  discard block
 block discarded – undo
5360 5360
       return stristr($haystack, $needle);
5361 5361
     }
5362 5362
 
5363
-    preg_match('/^(.*?)' . preg_quote($needle, '/') . '/usi', $haystack, $match);
5363
+    preg_match('/^(.*?)'.preg_quote($needle, '/').'/usi', $haystack, $match);
5364 5364
 
5365 5365
     if (!isset($match[1])) {
5366 5366
       return false;
@@ -5434,7 +5434,7 @@  discard block
 block discarded – undo
5434 5434
         &&
5435 5435
         self::$SUPPORT['iconv'] === false
5436 5436
     ) {
5437
-      trigger_error('UTF8::strlen() without mbstring / iconv cannot handle "' . $encoding . '" encoding', E_USER_WARNING);
5437
+      trigger_error('UTF8::strlen() without mbstring / iconv cannot handle "'.$encoding.'" encoding', E_USER_WARNING);
5438 5438
     }
5439 5439
 
5440 5440
     if (
@@ -5513,7 +5513,7 @@  discard block
 block discarded – undo
5513 5513
    */
5514 5514
   public static function strnatcmp($str1, $str2)
5515 5515
   {
5516
-    return $str1 . '' === $str2 . '' ? 0 : strnatcmp(self::strtonatfold($str1), self::strtonatfold($str2));
5516
+    return $str1.'' === $str2.'' ? 0 : strnatcmp(self::strtonatfold($str1), self::strtonatfold($str2));
5517 5517
   }
5518 5518
 
5519 5519
   /**
@@ -5574,7 +5574,7 @@  discard block
 block discarded – undo
5574 5574
       return false;
5575 5575
     }
5576 5576
 
5577
-    if (preg_match('/' . self::rxClass($char_list) . '/us', $haystack, $m)) {
5577
+    if (preg_match('/'.self::rxClass($char_list).'/us', $haystack, $m)) {
5578 5578
       return substr($haystack, strpos($haystack, $m[0]));
5579 5579
     }
5580 5580
 
@@ -5651,7 +5651,7 @@  discard block
 block discarded – undo
5651 5651
         &&
5652 5652
         self::$SUPPORT['mbstring'] === false
5653 5653
     ) {
5654
-      trigger_error('UTF8::strpos() without mbstring / iconv cannot handle "' . $encoding . '" encoding', E_USER_WARNING);
5654
+      trigger_error('UTF8::strpos() without mbstring / iconv cannot handle "'.$encoding.'" encoding', E_USER_WARNING);
5655 5655
     }
5656 5656
 
5657 5657
     if (
@@ -5883,7 +5883,7 @@  discard block
 block discarded – undo
5883 5883
         &&
5884 5884
         self::$SUPPORT['mbstring'] === false
5885 5885
     ) {
5886
-      trigger_error('UTF8::strripos() without mbstring cannot handle "' . $encoding . '" encoding', E_USER_WARNING);
5886
+      trigger_error('UTF8::strripos() without mbstring cannot handle "'.$encoding.'" encoding', E_USER_WARNING);
5887 5887
     }
5888 5888
 
5889 5889
     if (self::$SUPPORT['mbstring'] === true) {
@@ -5966,7 +5966,7 @@  discard block
 block discarded – undo
5966 5966
         &&
5967 5967
         self::$SUPPORT['mbstring'] === false
5968 5968
     ) {
5969
-      trigger_error('UTF8::strrpos() without mbstring cannot handle "' . $encoding . '" encoding', E_USER_WARNING);
5969
+      trigger_error('UTF8::strrpos() without mbstring cannot handle "'.$encoding.'" encoding', E_USER_WARNING);
5970 5970
     }
5971 5971
 
5972 5972
     if (self::$SUPPORT['mbstring'] === true) {
@@ -6034,7 +6034,7 @@  discard block
 block discarded – undo
6034 6034
       return 0;
6035 6035
     }
6036 6036
 
6037
-    return preg_match('/^' . self::rxClass($mask) . '+/u', $str, $str) ? self::strlen($str[0]) : 0;
6037
+    return preg_match('/^'.self::rxClass($mask).'+/u', $str, $str) ? self::strlen($str[0]) : 0;
6038 6038
   }
6039 6039
 
6040 6040
   /**
@@ -6080,7 +6080,7 @@  discard block
 block discarded – undo
6080 6080
         &&
6081 6081
         self::$SUPPORT['mbstring'] === false
6082 6082
     ) {
6083
-      trigger_error('UTF8::strstr() without mbstring cannot handle "' . $encoding . '" encoding', E_USER_WARNING);
6083
+      trigger_error('UTF8::strstr() without mbstring cannot handle "'.$encoding.'" encoding', E_USER_WARNING);
6084 6084
     }
6085 6085
 
6086 6086
     if (self::$SUPPORT['mbstring'] === true) {
@@ -6097,7 +6097,7 @@  discard block
 block discarded – undo
6097 6097
       return \grapheme_strstr($haystack, $needle, $before_needle);
6098 6098
     }
6099 6099
 
6100
-    preg_match('/^(.*?)' . preg_quote($needle, '/') . '/us', $haystack, $match);
6100
+    preg_match('/^(.*?)'.preg_quote($needle, '/').'/us', $haystack, $match);
6101 6101
 
6102 6102
     if (!isset($match[1])) {
6103 6103
       return false;
@@ -6204,9 +6204,9 @@  discard block
 block discarded – undo
6204 6204
           Bootup::is_php('5.4') === true
6205 6205
       ) {
6206 6206
 
6207
-        $langCode = $lang . '-Lower';
6207
+        $langCode = $lang.'-Lower';
6208 6208
         if (!in_array($langCode, self::$SUPPORT['intl__transliterator_list_ids'], true)) {
6209
-          trigger_error('UTF8::strtolower() without intl for special language: ' . $lang, E_USER_WARNING);
6209
+          trigger_error('UTF8::strtolower() without intl for special language: '.$lang, E_USER_WARNING);
6210 6210
 
6211 6211
           $langCode = 'Any-Lower';
6212 6212
         }
@@ -6214,7 +6214,7 @@  discard block
 block discarded – undo
6214 6214
         return transliterator_transliterate($langCode, $str);
6215 6215
       }
6216 6216
 
6217
-      trigger_error('UTF8::strtolower() without intl + PHP >= 5.4 cannot handle the "lang"-parameter: ' . $lang, E_USER_WARNING);
6217
+      trigger_error('UTF8::strtolower() without intl + PHP >= 5.4 cannot handle the "lang"-parameter: '.$lang, E_USER_WARNING);
6218 6218
     }
6219 6219
 
6220 6220
     return \mb_strtolower($str, $encoding);
@@ -6274,9 +6274,9 @@  discard block
 block discarded – undo
6274 6274
           Bootup::is_php('5.4') === true
6275 6275
       ) {
6276 6276
 
6277
-        $langCode = $lang . '-Upper';
6277
+        $langCode = $lang.'-Upper';
6278 6278
         if (!in_array($langCode, self::$SUPPORT['intl__transliterator_list_ids'], true)) {
6279
-          trigger_error('UTF8::strtoupper() without intl for special language: ' . $lang, E_USER_WARNING);
6279
+          trigger_error('UTF8::strtoupper() without intl for special language: '.$lang, E_USER_WARNING);
6280 6280
 
6281 6281
           $langCode = 'Any-Upper';
6282 6282
         }
@@ -6284,7 +6284,7 @@  discard block
 block discarded – undo
6284 6284
         return transliterator_transliterate($langCode, $str);
6285 6285
       }
6286 6286
 
6287
-      trigger_error('UTF8::strtolower() without intl + PHP >= 5.4 cannot handle the "lang"-parameter: ' . $lang, E_USER_WARNING);
6287
+      trigger_error('UTF8::strtolower() without intl + PHP >= 5.4 cannot handle the "lang"-parameter: '.$lang, E_USER_WARNING);
6288 6288
     }
6289 6289
 
6290 6290
     return \mb_strtoupper($str, $encoding);
@@ -6484,7 +6484,7 @@  discard block
 block discarded – undo
6484 6484
         &&
6485 6485
         self::$SUPPORT['mbstring'] === false
6486 6486
     ) {
6487
-      trigger_error('UTF8::substr() without mbstring cannot handle "' . $encoding . '" encoding', E_USER_WARNING);
6487
+      trigger_error('UTF8::substr() without mbstring cannot handle "'.$encoding.'" encoding', E_USER_WARNING);
6488 6488
     }
6489 6489
 
6490 6490
     if (self::$SUPPORT['mbstring'] === true) {
@@ -6511,8 +6511,7 @@  discard block
 block discarded – undo
6511 6511
 
6512 6512
     if (self::is_ascii($str)) {
6513 6513
       return ($length === null) ?
6514
-          substr($str, $offset) :
6515
-          substr($str, $offset, $length);
6514
+          substr($str, $offset) : substr($str, $offset, $length);
6516 6515
     }
6517 6516
 
6518 6517
     // fallback via vanilla php
@@ -6647,14 +6646,14 @@  discard block
 block discarded – undo
6647 6646
         &&
6648 6647
         self::$SUPPORT['mbstring'] === false
6649 6648
     ) {
6650
-      trigger_error('UTF8::substr_count() without mbstring cannot handle "' . $encoding . '" encoding', E_USER_WARNING);
6649
+      trigger_error('UTF8::substr_count() without mbstring cannot handle "'.$encoding.'" encoding', E_USER_WARNING);
6651 6650
     }
6652 6651
 
6653 6652
     if (self::$SUPPORT['mbstring'] === true) {
6654 6653
       return \mb_substr_count($haystack, $needle, $encoding);
6655 6654
     }
6656 6655
 
6657
-    preg_match_all('/' . preg_quote($needle, '/') . '/us', $haystack, $matches, PREG_SET_ORDER);
6656
+    preg_match_all('/'.preg_quote($needle, '/').'/us', $haystack, $matches, PREG_SET_ORDER);
6658 6657
 
6659 6658
     return count($matches);
6660 6659
   }
@@ -6848,8 +6847,7 @@  discard block
 block discarded – undo
6848 6847
 
6849 6848
     if (self::is_ascii($str)) {
6850 6849
       return ($length === null) ?
6851
-          substr_replace($str, $replacement, $offset) :
6852
-          substr_replace($str, $replacement, $offset, $length);
6850
+          substr_replace($str, $replacement, $offset) : substr_replace($str, $replacement, $offset, $length);
6853 6851
     }
6854 6852
 
6855 6853
     preg_match_all('/./us', $str, $smatches);
@@ -6925,7 +6923,7 @@  discard block
 block discarded – undo
6925 6923
 
6926 6924
     $strSwappedCase = preg_replace_callback(
6927 6925
         '/[\S]/u',
6928
-        function ($match) use ($encoding) {
6926
+        function($match) use ($encoding) {
6929 6927
           $marchToUpper = self::strtoupper($match[0], $encoding);
6930 6928
 
6931 6929
           if ($match[0] === $marchToUpper) {
@@ -7269,7 +7267,7 @@  discard block
 block discarded – undo
7269 7267
           $c2 = $i + 1 >= $max ? "\x00" : $str[$i + 1];
7270 7268
 
7271 7269
           if ($c2 >= "\x80" && $c2 <= "\xBF") { // yeah, almost sure it's UTF8 already
7272
-            $buf .= $c1 . $c2;
7270
+            $buf .= $c1.$c2;
7273 7271
             $i++;
7274 7272
           } else { // not valid UTF8 - convert it
7275 7273
             $buf .= self::to_utf8_convert($c1);
@@ -7281,7 +7279,7 @@  discard block
 block discarded – undo
7281 7279
           $c3 = $i + 2 >= $max ? "\x00" : $str[$i + 2];
7282 7280
 
7283 7281
           if ($c2 >= "\x80" && $c2 <= "\xBF" && $c3 >= "\x80" && $c3 <= "\xBF") { // yeah, almost sure it's UTF8 already
7284
-            $buf .= $c1 . $c2 . $c3;
7282
+            $buf .= $c1.$c2.$c3;
7285 7283
             $i += 2;
7286 7284
           } else { // not valid UTF8 - convert it
7287 7285
             $buf .= self::to_utf8_convert($c1);
@@ -7294,7 +7292,7 @@  discard block
 block discarded – undo
7294 7292
           $c4 = $i + 3 >= $max ? "\x00" : $str[$i + 3];
7295 7293
 
7296 7294
           if ($c2 >= "\x80" && $c2 <= "\xBF" && $c3 >= "\x80" && $c3 <= "\xBF" && $c4 >= "\x80" && $c4 <= "\xBF") { // yeah, almost sure it's UTF8 already
7297
-            $buf .= $c1 . $c2 . $c3 . $c4;
7295
+            $buf .= $c1.$c2.$c3.$c4;
7298 7296
             $i += 3;
7299 7297
           } else { // not valid UTF8 - convert it
7300 7298
             $buf .= self::to_utf8_convert($c1);
@@ -7316,7 +7314,7 @@  discard block
 block discarded – undo
7316 7314
     // decode unicode escape sequences
7317 7315
     $buf = preg_replace_callback(
7318 7316
         '/\\\\u([0-9a-f]{4})/i',
7319
-        function ($match) {
7317
+        function($match) {
7320 7318
           return \mb_convert_encoding(pack('H*', $match[1]), 'UTF-8', 'UCS-2BE');
7321 7319
         },
7322 7320
         $buf
@@ -7345,7 +7343,7 @@  discard block
 block discarded – undo
7345 7343
     } else {
7346 7344
       $cc1 = self::chr_and_parse_int($ordC1 / 64) | "\xC0";
7347 7345
       $cc2 = ($int & "\x3F") | "\x80";
7348
-      $buf .= $cc1 . $cc2;
7346
+      $buf .= $cc1.$cc2;
7349 7347
     }
7350 7348
 
7351 7349
     return $buf;
@@ -7408,7 +7406,7 @@  discard block
 block discarded – undo
7408 7406
         $cleanUtf8
7409 7407
     );
7410 7408
 
7411
-    return $strPartOne . $strPartTwo;
7409
+    return $strPartOne.$strPartTwo;
7412 7410
   }
7413 7411
 
7414 7412
   /**
@@ -7453,7 +7451,7 @@  discard block
 block discarded – undo
7453 7451
       $str = self::clean($str);
7454 7452
     }
7455 7453
 
7456
-    $usePhpDefaultFunctions = !(bool)($charlist . implode('', $exceptions));
7454
+    $usePhpDefaultFunctions = !(bool)($charlist.implode('', $exceptions));
7457 7455
 
7458 7456
     if (
7459 7457
         $usePhpDefaultFunctions === true
@@ -7940,7 +7938,7 @@  discard block
 block discarded – undo
7940 7938
       return '';
7941 7939
     }
7942 7940
 
7943
-    preg_match('/^\s*+(?:\S++\s*+){1,' . $limit . '}/u', $str, $matches);
7941
+    preg_match('/^\s*+(?:\S++\s*+){1,'.$limit.'}/u', $str, $matches);
7944 7942
 
7945 7943
     if (
7946 7944
         !isset($matches[0])
@@ -7950,7 +7948,7 @@  discard block
 block discarded – undo
7950 7948
       return $str;
7951 7949
     }
7952 7950
 
7953
-    return self::rtrim($matches[0]) . $strAddOn;
7951
+    return self::rtrim($matches[0]).$strAddOn;
7954 7952
   }
7955 7953
 
7956 7954
   /**
@@ -8018,7 +8016,7 @@  discard block
 block discarded – undo
8018 8016
       $strReturn .= $break;
8019 8017
     }
8020 8018
 
8021
-    return $strReturn . implode('', $chars);
8019
+    return $strReturn.implode('', $chars);
8022 8020
   }
8023 8021
 
8024 8022
   /**
Please login to merge, or discard this patch.