Completed
Push — master ( def38e...81b950 )
by Lars
03:06
created
src/voku/helper/UTF8.php 1 patch
Spacing   +120 added lines, -121 removed lines patch added patch discarded remove patch
@@ -264,7 +264,7 @@  discard block
 block discarded – undo
264 264
   public static function add_bom_to_string(string $str): string
265 265
   {
266 266
     if (self::string_has_bom($str) === false) {
267
-      $str = self::bom() . $str;
267
+      $str = self::bom().$str;
268 268
     }
269 269
 
270 270
     return $str;
@@ -531,10 +531,10 @@  discard block
 block discarded – undo
531 531
         &&
532 532
         self::$SUPPORT['mbstring'] === false
533 533
     ) {
534
-      \trigger_error('UTF8::chr() without mbstring cannot handle "' . $encoding . '" encoding', E_USER_WARNING);
534
+      \trigger_error('UTF8::chr() without mbstring cannot handle "'.$encoding.'" encoding', E_USER_WARNING);
535 535
     }
536 536
 
537
-    $cacheKey = $code_point . $encoding;
537
+    $cacheKey = $code_point.$encoding;
538 538
     if (isset($CHAR_CACHE[$cacheKey]) === true) {
539 539
       return $CHAR_CACHE[$cacheKey];
540 540
     }
@@ -579,16 +579,16 @@  discard block
 block discarded – undo
579 579
     if ($code_point <= 0x7F) {
580 580
       $chr = self::$CHR[$code_point];
581 581
     } elseif ($code_point <= 0x7FF) {
582
-      $chr = self::$CHR[($code_point >> 6) + 0xC0] .
582
+      $chr = self::$CHR[($code_point >> 6) + 0xC0].
583 583
              self::$CHR[($code_point & 0x3F) + 0x80];
584 584
     } elseif ($code_point <= 0xFFFF) {
585
-      $chr = self::$CHR[($code_point >> 12) + 0xE0] .
586
-             self::$CHR[(($code_point >> 6) & 0x3F) + 0x80] .
585
+      $chr = self::$CHR[($code_point >> 12) + 0xE0].
586
+             self::$CHR[(($code_point >> 6) & 0x3F) + 0x80].
587 587
              self::$CHR[($code_point & 0x3F) + 0x80];
588 588
     } else {
589
-      $chr = self::$CHR[($code_point >> 18) + 0xF0] .
590
-             self::$CHR[(($code_point >> 12) & 0x3F) + 0x80] .
591
-             self::$CHR[(($code_point >> 6) & 0x3F) + 0x80] .
589
+      $chr = self::$CHR[($code_point >> 18) + 0xF0].
590
+             self::$CHR[(($code_point >> 12) & 0x3F) + 0x80].
591
+             self::$CHR[(($code_point >> 6) & 0x3F) + 0x80].
592 592
              self::$CHR[($code_point & 0x3F) + 0x80];
593 593
     }
594 594
 
@@ -640,7 +640,7 @@  discard block
 block discarded – undo
640 640
 
641 641
     if (self::$SUPPORT['mbstring_func_overload'] === true) {
642 642
       return \array_map(
643
-          function ($data) {
643
+          function($data) {
644 644
             return UTF8::strlen_in_byte($data);
645 645
           },
646 646
           $strSplit
@@ -955,7 +955,7 @@  discard block
 block discarded – undo
955 955
    */
956 956
   public static function decimal_to_chr($int): string
957 957
   {
958
-    return self::html_entity_decode('&#' . $int . ';', ENT_QUOTES | ENT_HTML5);
958
+    return self::html_entity_decode('&#'.$int.';', ENT_QUOTES | ENT_HTML5);
959 959
   }
960 960
 
961 961
   /**
@@ -1114,7 +1114,7 @@  discard block
 block discarded – undo
1114 1114
         &&
1115 1115
         self::$SUPPORT['mbstring'] === false
1116 1116
     ) {
1117
-      \trigger_error('UTF8::encode() without mbstring cannot handle "' . $toEncoding . '" encoding', E_USER_WARNING);
1117
+      \trigger_error('UTF8::encode() without mbstring cannot handle "'.$toEncoding.'" encoding', E_USER_WARNING);
1118 1118
     }
1119 1119
 
1120 1120
     if (!isset(self::$SUPPORT['already_checked_via_portable_utf8'])) {
@@ -1134,7 +1134,7 @@  discard block
 block discarded – undo
1134 1134
       }
1135 1135
     }
1136 1136
 
1137
-    $return = \iconv($fromEncoding, $toEncoding . '//IGNORE', $str);
1137
+    $return = \iconv($fromEncoding, $toEncoding.'//IGNORE', $str);
1138 1138
     if ($return !== false) {
1139 1139
       return $return;
1140 1140
     }
@@ -1230,7 +1230,7 @@  discard block
 block discarded – undo
1230 1230
           return '';
1231 1231
         }
1232 1232
 
1233
-        return \rtrim($strSub, $trimChars) . $replacerForSkippedText;
1233
+        return \rtrim($strSub, $trimChars).$replacerForSkippedText;
1234 1234
       }
1235 1235
 
1236 1236
       return $str;
@@ -1266,14 +1266,14 @@  discard block
 block discarded – undo
1266 1266
       if (!$pos_end || $pos_end <= 0) {
1267 1267
         $strSub = self::substr($str, $pos_start, self::strlen($str), $encoding);
1268 1268
         if ($strSub !== false) {
1269
-          $extract = $replacerForSkippedText . \ltrim($strSub, $trimChars);
1269
+          $extract = $replacerForSkippedText.\ltrim($strSub, $trimChars);
1270 1270
         } else {
1271 1271
           $extract = '';
1272 1272
         }
1273 1273
       } else {
1274 1274
         $strSub = self::substr($str, $pos_start, $pos_end, $encoding);
1275 1275
         if ($strSub !== false) {
1276
-          $extract = $replacerForSkippedText . \trim($strSub, $trimChars) . $replacerForSkippedText;
1276
+          $extract = $replacerForSkippedText.\trim($strSub, $trimChars).$replacerForSkippedText;
1277 1277
         } else {
1278 1278
           $extract = '';
1279 1279
         }
@@ -1296,7 +1296,7 @@  discard block
 block discarded – undo
1296 1296
       if ($pos_end) {
1297 1297
         $strSub = self::substr($str, 0, $pos_end, $encoding);
1298 1298
         if ($strSub !== false) {
1299
-          $extract = \rtrim($strSub, $trimChars) . $replacerForSkippedText;
1299
+          $extract = \rtrim($strSub, $trimChars).$replacerForSkippedText;
1300 1300
         } else {
1301 1301
           $extract = '';
1302 1302
         }
@@ -1417,7 +1417,7 @@  discard block
 block discarded – undo
1417 1417
   {
1418 1418
     $file_content = \file_get_contents($file_path);
1419 1419
     if ($file_content === false) {
1420
-      throw new \RuntimeException('file_get_contents() returned false for:' . $file_path);
1420
+      throw new \RuntimeException('file_get_contents() returned false for:'.$file_path);
1421 1421
     }
1422 1422
 
1423 1423
     return self::string_has_bom($file_content);
@@ -1477,7 +1477,7 @@  discard block
 block discarded – undo
1477 1477
           ) {
1478 1478
             // Prevent leading combining chars
1479 1479
             // for NFC-safe concatenations.
1480
-            $var = $leading_combining . $var;
1480
+            $var = $leading_combining.$var;
1481 1481
           }
1482 1482
         }
1483 1483
 
@@ -1972,7 +1972,7 @@  discard block
 block discarded – undo
1972 1972
    */
1973 1973
   private static function getData(string $file)
1974 1974
   {
1975
-    $file = __DIR__ . '/data/' . $file . '.php';
1975
+    $file = __DIR__.'/data/'.$file.'.php';
1976 1976
     if (\file_exists($file)) {
1977 1977
       /** @noinspection PhpIncludeInspection */
1978 1978
       return require $file;
@@ -2025,7 +2025,7 @@  discard block
 block discarded – undo
2025 2025
     }
2026 2026
 
2027 2027
     $str_info = \unpack("C2chars", $str_info);
2028
-    $type_code = (int)($str_info['chars1'] . $str_info['chars2']);
2028
+    $type_code = (int)($str_info['chars1'].$str_info['chars2']);
2029 2029
 
2030 2030
     // DEBUG
2031 2031
     //var_dump($type_code);
@@ -2118,16 +2118,16 @@  discard block
 block discarded – undo
2118 2118
    */
2119 2119
   public static function get_unique_string($entropyExtra = '', bool $md5 = true): string
2120 2120
   {
2121
-    $uniqueHelper = \mt_rand() .
2122
-                    \session_id() .
2123
-                    ($_SERVER['REMOTE_ADDR'] ?? '') .
2124
-                    ($_SERVER['SERVER_ADDR'] ?? '') .
2121
+    $uniqueHelper = \mt_rand().
2122
+                    \session_id().
2123
+                    ($_SERVER['REMOTE_ADDR'] ?? '').
2124
+                    ($_SERVER['SERVER_ADDR'] ?? '').
2125 2125
                     $entropyExtra;
2126 2126
 
2127 2127
     $uniqueString = \uniqid($uniqueHelper, true);
2128 2128
 
2129 2129
     if ($md5) {
2130
-      $uniqueString = \md5($uniqueString . $uniqueHelper);
2130
+      $uniqueString = \md5($uniqueString.$uniqueHelper);
2131 2131
     }
2132 2132
 
2133 2133
     return $uniqueString;
@@ -2272,7 +2272,7 @@  discard block
 block discarded – undo
2272 2272
     return \implode(
2273 2273
         '',
2274 2274
         \array_map(
2275
-            function ($data) use ($keepAsciiChars, $encoding) {
2275
+            function($data) use ($keepAsciiChars, $encoding) {
2276 2276
               return UTF8::single_chr_html_encode($data, $keepAsciiChars, $encoding);
2277 2277
             },
2278 2278
             self::split($str)
@@ -2388,7 +2388,7 @@  discard block
 block discarded – undo
2388 2388
         &&
2389 2389
         self::$SUPPORT['mbstring'] === false
2390 2390
     ) {
2391
-      \trigger_error('UTF8::html_entity_decode() without mbstring cannot handle "' . $encoding . '" encoding', E_USER_WARNING);
2391
+      \trigger_error('UTF8::html_entity_decode() without mbstring cannot handle "'.$encoding.'" encoding', E_USER_WARNING);
2392 2392
     }
2393 2393
 
2394 2394
     if (!isset(self::$SUPPORT['already_checked_via_portable_utf8'])) {
@@ -2411,7 +2411,7 @@  discard block
 block discarded – undo
2411 2411
 
2412 2412
         $str = (string)\preg_replace_callback(
2413 2413
             "/&#\d{2,6};/",
2414
-            function ($matches) use ($encoding) {
2414
+            function($matches) use ($encoding) {
2415 2415
               // always fallback via symfony polyfill
2416 2416
               $returnTmp = \mb_convert_encoding($matches[0], $encoding, 'HTML-ENTITIES');
2417 2417
 
@@ -2754,9 +2754,9 @@  discard block
 block discarded – undo
2754 2754
   {
2755 2755
     $hex = \dechex($int);
2756 2756
 
2757
-    $hex = (\strlen($hex) < 4 ? \substr('0000' . $hex, -4) : $hex);
2757
+    $hex = (\strlen($hex) < 4 ? \substr('0000'.$hex, -4) : $hex);
2758 2758
 
2759
-    return $pfix . $hex . '';
2759
+    return $pfix.$hex.'';
2760 2760
   }
2761 2761
 
2762 2762
   /**
@@ -3693,7 +3693,7 @@  discard block
 block discarded – undo
3693 3693
         $cleanUtf8
3694 3694
     );
3695 3695
 
3696
-    return $strPartOne . $strPartTwo;
3696
+    return $strPartOne.$strPartTwo;
3697 3697
   }
3698 3698
 
3699 3699
   /**
@@ -4168,7 +4168,7 @@  discard block
 block discarded – undo
4168 4168
       }
4169 4169
     }
4170 4170
 
4171
-    $cacheKey = $chr_orig . $encoding;
4171
+    $cacheKey = $chr_orig.$encoding;
4172 4172
     if (isset($CHAR_CACHE[$cacheKey]) === true) {
4173 4173
       return $CHAR_CACHE[$cacheKey];
4174 4174
     }
@@ -4421,7 +4421,7 @@  discard block
 block discarded – undo
4421 4421
     }
4422 4422
 
4423 4423
     $str = (string)\preg_replace(
4424
-        $delimiter . $pattern . $delimiter . 'u' . $options,
4424
+        $delimiter.$pattern.$delimiter.'u'.$options,
4425 4425
         $replacement,
4426 4426
         $str
4427 4427
     );
@@ -4492,7 +4492,7 @@  discard block
 block discarded – undo
4492 4492
     if (\is_array($what) === true) {
4493 4493
       /** @noinspection ForeachSourceInspection */
4494 4494
       foreach ($what as $item) {
4495
-        $str = (string)\preg_replace('/(' . \preg_quote($item, '/') . ')+/', $item, $str);
4495
+        $str = (string)\preg_replace('/('.\preg_quote($item, '/').')+/', $item, $str);
4496 4496
       }
4497 4497
     }
4498 4498
 
@@ -4740,7 +4740,7 @@  discard block
 block discarded – undo
4740 4740
   {
4741 4741
     static $RX_CLASSS_CACHE = [];
4742 4742
 
4743
-    $cacheKey = $s . $class;
4743
+    $cacheKey = $s.$class;
4744 4744
 
4745 4745
     if (isset($RX_CLASSS_CACHE[$cacheKey])) {
4746 4746
       return $RX_CLASSS_CACHE[$cacheKey];
@@ -4752,7 +4752,7 @@  discard block
 block discarded – undo
4752 4752
     /** @noinspection SuspiciousLoopInspection */
4753 4753
     foreach (self::str_split($s) as $s) {
4754 4754
       if ('-' === $s) {
4755
-        $class[0] = '-' . $class[0];
4755
+        $class[0] = '-'.$class[0];
4756 4756
       } elseif (!isset($s[2])) {
4757 4757
         $class[0] .= \preg_quote($s, '/');
4758 4758
       } elseif (1 === self::strlen($s)) {
@@ -4763,13 +4763,13 @@  discard block
 block discarded – undo
4763 4763
     }
4764 4764
 
4765 4765
     if ($class[0]) {
4766
-      $class[0] = '[' . $class[0] . ']';
4766
+      $class[0] = '['.$class[0].']';
4767 4767
     }
4768 4768
 
4769 4769
     if (1 === \count($class)) {
4770 4770
       $return = $class[0];
4771 4771
     } else {
4772
-      $return = '(?:' . \implode('|', $class) . ')';
4772
+      $return = '(?:'.\implode('|', $class).')';
4773 4773
     }
4774 4774
 
4775 4775
     $RX_CLASSS_CACHE[$cacheKey] = $return;
@@ -4788,7 +4788,7 @@  discard block
 block discarded – undo
4788 4788
 
4789 4789
     echo '<pre>';
4790 4790
     foreach (self::$SUPPORT as $key => $value) {
4791
-      echo $key . ' - ' . \print_r($value, true) . "\n<br>";
4791
+      echo $key.' - '.\print_r($value, true)."\n<br>";
4792 4792
     }
4793 4793
     echo '</pre>';
4794 4794
   }
@@ -4820,7 +4820,7 @@  discard block
 block discarded – undo
4820 4820
       $encoding = self::normalize_encoding($encoding, 'UTF-8');
4821 4821
     }
4822 4822
 
4823
-    return '&#' . self::ord($char, $encoding) . ';';
4823
+    return '&#'.self::ord($char, $encoding).';';
4824 4824
   }
4825 4825
 
4826 4826
   /**
@@ -4907,7 +4907,7 @@  discard block
 block discarded – undo
4907 4907
         ) {
4908 4908
 
4909 4909
           if (($str[$i + 1] & "\xC0") === "\x80") {
4910
-            $ret[] = $str[$i] . $str[$i + 1];
4910
+            $ret[] = $str[$i].$str[$i + 1];
4911 4911
 
4912 4912
             $i++;
4913 4913
           }
@@ -4923,7 +4923,7 @@  discard block
 block discarded – undo
4923 4923
               &&
4924 4924
               ($str[$i + 2] & "\xC0") === "\x80"
4925 4925
           ) {
4926
-            $ret[] = $str[$i] . $str[$i + 1] . $str[$i + 2];
4926
+            $ret[] = $str[$i].$str[$i + 1].$str[$i + 2];
4927 4927
 
4928 4928
             $i += 2;
4929 4929
           }
@@ -4941,7 +4941,7 @@  discard block
 block discarded – undo
4941 4941
               &&
4942 4942
               ($str[$i + 3] & "\xC0") === "\x80"
4943 4943
           ) {
4944
-            $ret[] = $str[$i] . $str[$i + 1] . $str[$i + 2] . $str[$i + 3];
4944
+            $ret[] = $str[$i].$str[$i + 1].$str[$i + 2].$str[$i + 3];
4945 4945
 
4946 4946
             $i += 3;
4947 4947
           }
@@ -4954,7 +4954,7 @@  discard block
 block discarded – undo
4954 4954
       $ret = \array_chunk($ret, $length);
4955 4955
 
4956 4956
       return \array_map(
4957
-          function ($item) {
4957
+          function($item) {
4958 4958
             return \implode('', $item);
4959 4959
           }, $ret
4960 4960
       );
@@ -4984,7 +4984,7 @@  discard block
 block discarded – undo
4984 4984
 
4985 4985
     $str = (string)\preg_replace_callback(
4986 4986
         '/[-_\s]+(.)?/u',
4987
-        function ($match) use ($encoding) {
4987
+        function($match) use ($encoding) {
4988 4988
           if (isset($match[1])) {
4989 4989
             return UTF8::strtoupper($match[1], $encoding);
4990 4990
           }
@@ -4996,7 +4996,7 @@  discard block
 block discarded – undo
4996 4996
 
4997 4997
     $str = (string)\preg_replace_callback(
4998 4998
         '/[\d]+(.)?/u',
4999
-        function ($match) use ($encoding) {
4999
+        function($match) use ($encoding) {
5000 5000
           return UTF8::strtoupper($match[0], $encoding);
5001 5001
         },
5002 5002
         $str
@@ -5363,7 +5363,7 @@  discard block
 block discarded – undo
5363 5363
     foreach (self::$ENCODINGS as $encodingTmp) {
5364 5364
       # INFO: //IGNORE but still throw notice
5365 5365
       /** @noinspection PhpUsageOfSilenceOperatorInspection */
5366
-      if ((string)@\iconv($encodingTmp, $encodingTmp . '//IGNORE', $str) === $str) {
5366
+      if ((string)@\iconv($encodingTmp, $encodingTmp.'//IGNORE', $str) === $str) {
5367 5367
         return $encodingTmp;
5368 5368
       }
5369 5369
     }
@@ -5425,7 +5425,7 @@  discard block
 block discarded – undo
5425 5425
   public static function str_ensure_left(string $str, string $substring): string
5426 5426
   {
5427 5427
     if (!self::str_starts_with($str, $substring)) {
5428
-      $str = $substring . $str;
5428
+      $str = $substring.$str;
5429 5429
     }
5430 5430
 
5431 5431
     return $str;
@@ -5634,7 +5634,7 @@  discard block
 block discarded – undo
5634 5634
     $start = self::substr($str, 0, $index, $encoding);
5635 5635
     $end = self::substr($str, $index, $len, $encoding);
5636 5636
 
5637
-    return $start . $substring . $end;
5637
+    return $start.$substring.$end;
5638 5638
   }
5639 5639
 
5640 5640
   /**
@@ -5671,7 +5671,7 @@  discard block
 block discarded – undo
5671 5671
       if ('' === $s .= '') {
5672 5672
         $s = '/^(?<=.)$/';
5673 5673
       } else {
5674
-        $s = '/' . \preg_quote($s, '/') . '/ui';
5674
+        $s = '/'.\preg_quote($s, '/').'/ui';
5675 5675
       }
5676 5676
     }
5677 5677
 
@@ -5954,7 +5954,7 @@  discard block
 block discarded – undo
5954 5954
       return $str;
5955 5955
     }
5956 5956
 
5957
-    return self::substr($str, 0, $length - self::strlen($strAddOn), $encoding) . $strAddOn;
5957
+    return self::substr($str, 0, $length - self::strlen($strAddOn), $encoding).$strAddOn;
5958 5958
   }
5959 5959
 
5960 5960
   /**
@@ -5982,7 +5982,7 @@  discard block
 block discarded – undo
5982 5982
     }
5983 5983
 
5984 5984
     if (self::substr($str, $length - 1, 1, $encoding) === ' ') {
5985
-      return self::substr($str, 0, $length - 1, $encoding) . $strAddOn;
5985
+      return self::substr($str, 0, $length - 1, $encoding).$strAddOn;
5986 5986
     }
5987 5987
 
5988 5988
     $str = (string)self::substr($str, 0, $length, $encoding);
@@ -5991,9 +5991,9 @@  discard block
 block discarded – undo
5991 5991
     $new_str = \implode(' ', $array);
5992 5992
 
5993 5993
     if ($new_str === '') {
5994
-      $str = self::substr($str, 0, $length - 1, $encoding) . $strAddOn;
5994
+      $str = self::substr($str, 0, $length - 1, $encoding).$strAddOn;
5995 5995
     } else {
5996
-      $str = $new_str . $strAddOn;
5996
+      $str = $new_str.$strAddOn;
5997 5997
     }
5998 5998
 
5999 5999
     return $str;
@@ -6096,7 +6096,7 @@  discard block
 block discarded – undo
6096 6096
       $char = self::substr($str, -$i, 1, $encoding);
6097 6097
 
6098 6098
       if ($char == self::substr($otherStr, -$i, 1, $encoding)) {
6099
-        $longestCommonSuffix = $char . $longestCommonSuffix;
6099
+        $longestCommonSuffix = $char.$longestCommonSuffix;
6100 6100
       } else {
6101 6101
         break;
6102 6102
       }
@@ -6115,7 +6115,7 @@  discard block
 block discarded – undo
6115 6115
    */
6116 6116
   public static function str_matches_pattern(string $str, string $pattern): bool
6117 6117
   {
6118
-    if (\preg_match('/' . $pattern . '/u', $str)) {
6118
+    if (\preg_match('/'.$pattern.'/u', $str)) {
6119 6119
       return true;
6120 6120
     }
6121 6121
 
@@ -6205,7 +6205,7 @@  discard block
 block discarded – undo
6205 6205
         $pad_type = STR_PAD_BOTH;
6206 6206
       } else {
6207 6207
         throw new \InvalidArgumentException(
6208
-            'Pad expects $padType to be "STR_PAD_*" or ' . "to be one of 'left', 'right' or 'both'"
6208
+            'Pad expects $padType to be "STR_PAD_*" or '."to be one of 'left', 'right' or 'both'"
6209 6209
         );
6210 6210
       }
6211 6211
     }
@@ -6242,7 +6242,7 @@  discard block
 block discarded – undo
6242 6242
           $pre = '';
6243 6243
       }
6244 6244
 
6245
-      return $pre . $str . $post;
6245
+      return $pre.$str.$post;
6246 6246
     }
6247 6247
 
6248 6248
     return $str;
@@ -6370,7 +6370,7 @@  discard block
 block discarded – undo
6370 6370
   {
6371 6371
     return self::regex_replace(
6372 6372
         $str,
6373
-        '^' . \preg_quote($search, '/'),
6373
+        '^'.\preg_quote($search, '/'),
6374 6374
         self::str_replace('\\', '\\\\', $replacement)
6375 6375
     );
6376 6376
   }
@@ -6388,7 +6388,7 @@  discard block
 block discarded – undo
6388 6388
   {
6389 6389
     return self::regex_replace(
6390 6390
         $str,
6391
-        \preg_quote($search, '/') . '$',
6391
+        \preg_quote($search, '/').'$',
6392 6392
         self::str_replace('\\', '\\\\', $replacement)
6393 6393
     );
6394 6394
   }
@@ -6499,24 +6499,24 @@  discard block
 block discarded – undo
6499 6499
 
6500 6500
     $str = (string)\preg_replace_callback(
6501 6501
         '/([\d|A-Z])/u',
6502
-        function ($matches) use ($encoding) {
6502
+        function($matches) use ($encoding) {
6503 6503
           $match = $matches[1];
6504 6504
           $matchInt = (int)$match;
6505 6505
 
6506 6506
           if ((string)$matchInt == $match) {
6507
-            return '_' . $match . '_';
6507
+            return '_'.$match.'_';
6508 6508
           }
6509 6509
 
6510
-          return '_' . UTF8::strtolower($match, $encoding);
6510
+          return '_'.UTF8::strtolower($match, $encoding);
6511 6511
         },
6512 6512
         $str
6513 6513
     );
6514 6514
 
6515 6515
     $str = (string)\preg_replace(
6516 6516
         [
6517
-            '/\s+/',        // convert spaces to "_"
6518
-            '/^\s+|\s+$/',  // trim leading & trailing spaces
6519
-            '/_+/',         // remove double "_"
6517
+            '/\s+/', // convert spaces to "_"
6518
+            '/^\s+|\s+$/', // trim leading & trailing spaces
6519
+            '/_+/', // remove double "_"
6520 6520
         ],
6521 6521
         [
6522 6522
             '_',
@@ -6604,7 +6604,7 @@  discard block
 block discarded – undo
6604 6604
       $limit = -1;
6605 6605
     }
6606 6606
 
6607
-    $array = \preg_split('/' . \preg_quote($pattern, '/') . '/u', $str, $limit);
6607
+    $array = \preg_split('/'.\preg_quote($pattern, '/').'/u', $str, $limit);
6608 6608
 
6609 6609
     if ($array === false) {
6610 6610
       return [];
@@ -6886,7 +6886,7 @@  discard block
 block discarded – undo
6886 6886
 
6887 6887
     $str = (string)\preg_replace_callback(
6888 6888
         '/([\S]+)/u',
6889
-        function ($match) use ($encoding, $ignore) {
6889
+        function($match) use ($encoding, $ignore) {
6890 6890
           if ($ignore && \in_array($match[0], $ignore, true)) {
6891 6891
             return $match[0];
6892 6892
           }
@@ -6955,16 +6955,16 @@  discard block
 block discarded – undo
6955 6955
     $str = (string)\preg_replace_callback(
6956 6956
         '~\b (_*) (?:                                                              # 1. Leading underscore and
6957 6957
                         ( (?<=[ ][/\\\\]) [[:alpha:]]+ [-_[:alpha:]/\\\\]+ |              # 2. file path or 
6958
-                          [-_[:alpha:]]+ [@.:] [-_[:alpha:]@.:/]+ ' . $apostropheRx . ' ) #    URL, domain, or email
6958
+                          [-_[:alpha:]]+ [@.:] [-_[:alpha:]@.:/]+ ' . $apostropheRx.' ) #    URL, domain, or email
6959 6959
                         |
6960
-                        ( (?i: ' . $smallWordsRx . ' ) ' . $apostropheRx . ' )            # 3. or small word (case-insensitive)
6960
+                        ( (?i: ' . $smallWordsRx.' ) '.$apostropheRx.' )            # 3. or small word (case-insensitive)
6961 6961
                         |
6962
-                        ( [[:alpha:]] [[:lower:]\'’()\[\]{}]* ' . $apostropheRx . ' )     # 4. or word w/o internal caps
6962
+                        ( [[:alpha:]] [[:lower:]\'’()\[\]{}]* ' . $apostropheRx.' )     # 4. or word w/o internal caps
6963 6963
                         |
6964
-                        ( [[:alpha:]] [[:alpha:]\'’()\[\]{}]* ' . $apostropheRx . ' )     # 5. or some other word
6964
+                        ( [[:alpha:]] [[:alpha:]\'’()\[\]{}]* ' . $apostropheRx.' )     # 5. or some other word
6965 6965
                       ) (_*) \b                                                           # 6. With trailing underscore
6966 6966
                     ~ux',
6967
-        function ($matches) use ($encoding) {
6967
+        function($matches) use ($encoding) {
6968 6968
           // Preserve leading underscore
6969 6969
           $str = $matches[1];
6970 6970
           if ($matches[2]) {
@@ -6993,21 +6993,21 @@  discard block
 block discarded – undo
6993 6993
         '~(  \A [[:punct:]]*                # start of title...
6994 6994
                       |  [:.;?!][ ]+               # or of subsentence...
6995 6995
                       |  [ ][\'"“‘(\[][ ]* )       # or of inserted subphrase...
6996
-                      ( ' . $smallWordsRx . ' ) \b # ...followed by small word
6996
+                      ( ' . $smallWordsRx.' ) \b # ...followed by small word
6997 6997
                      ~uxi',
6998
-        function ($matches) use ($encoding) {
6999
-          return $matches[1] . static::str_upper_first($matches[2], $encoding);
6998
+        function($matches) use ($encoding) {
6999
+          return $matches[1].static::str_upper_first($matches[2], $encoding);
7000 7000
         },
7001 7001
         $str
7002 7002
     );
7003 7003
 
7004 7004
     // ...and end of title
7005 7005
     $str = (string)\preg_replace_callback(
7006
-        '~\b ( ' . $smallWordsRx . ' ) # small word...
7006
+        '~\b ( '.$smallWordsRx.' ) # small word...
7007 7007
                       (?= [[:punct:]]* \Z     # ...at the end of the title...
7008 7008
                       |   [\'"’”)\]] [ ] )    # ...or of an inserted subphrase?
7009 7009
                      ~uxi',
7010
-        function ($matches) use ($encoding) {
7010
+        function($matches) use ($encoding) {
7011 7011
           return static::str_upper_first($matches[1], $encoding);
7012 7012
         },
7013 7013
         $str
@@ -7018,10 +7018,10 @@  discard block
 block discarded – undo
7018 7018
     $str = (string)\preg_replace_callback(
7019 7019
         '~\b
7020 7020
                         (?<! -)                   # Negative lookbehind for a hyphen; we do not want to match man-in-the-middle but do want (in-flight)
7021
-                        ( ' . $smallWordsRx . ' )
7021
+                        ( ' . $smallWordsRx.' )
7022 7022
                         (?= -[[:alpha:]]+)        # lookahead for "-someword"
7023 7023
                        ~uxi',
7024
-        function ($matches) use ($encoding) {
7024
+        function($matches) use ($encoding) {
7025 7025
           return static::str_upper_first($matches[1], $encoding);
7026 7026
         },
7027 7027
         $str
@@ -7032,11 +7032,11 @@  discard block
 block discarded – undo
7032 7032
         '~\b
7033 7033
                       (?<!…)                    # Negative lookbehind for a hyphen; we do not want to match man-in-the-middle but do want (stand-in)
7034 7034
                       ( [[:alpha:]]+- )         # $1 = first word and hyphen, should already be properly capped
7035
-                      ( ' . $smallWordsRx . ' ) # ...followed by small word
7035
+                      ( ' . $smallWordsRx.' ) # ...followed by small word
7036 7036
                       (?!	- )                   # Negative lookahead for another -
7037 7037
                      ~uxi',
7038
-        function ($matches) use ($encoding) {
7039
-          return $matches[1] . static::str_upper_first($matches[2], $encoding);
7038
+        function($matches) use ($encoding) {
7039
+          return $matches[1].static::str_upper_first($matches[2], $encoding);
7040 7040
         },
7041 7041
         $str
7042 7042
     );
@@ -7186,7 +7186,7 @@  discard block
 block discarded – undo
7186 7186
 
7187 7187
     $truncated = self::substr($str, 0, $length, $encoding);
7188 7188
 
7189
-    return $truncated . $substring;
7189
+    return $truncated.$substring;
7190 7190
   }
7191 7191
 
7192 7192
   /**
@@ -7228,7 +7228,7 @@  discard block
 block discarded – undo
7228 7228
       }
7229 7229
     }
7230 7230
 
7231
-    $str = $truncated . $substring;
7231
+    $str = $truncated.$substring;
7232 7232
 
7233 7233
     return $str;
7234 7234
   }
@@ -7377,7 +7377,7 @@  discard block
 block discarded – undo
7377 7377
   public static function strcmp(string $str1, string $str2): int
7378 7378
   {
7379 7379
     /** @noinspection PhpUndefinedClassInspection */
7380
-    return $str1 . '' === $str2 . '' ? 0 : \strcmp(
7380
+    return $str1.'' === $str2.'' ? 0 : \strcmp(
7381 7381
         \Normalizer::normalize($str1, \Normalizer::NFD),
7382 7382
         \Normalizer::normalize($str2, \Normalizer::NFD)
7383 7383
     );
@@ -7411,7 +7411,7 @@  discard block
 block discarded – undo
7411 7411
       return null;
7412 7412
     }
7413 7413
 
7414
-    if (\preg_match('/^(.*?)' . self::rxClass($charList) . '/us', $str, $length)) {
7414
+    if (\preg_match('/^(.*?)'.self::rxClass($charList).'/us', $str, $length)) {
7415 7415
       return self::strlen($length[1]);
7416 7416
     }
7417 7417
 
@@ -7648,7 +7648,7 @@  discard block
 block discarded – undo
7648 7648
         &&
7649 7649
         self::$SUPPORT['mbstring'] === false
7650 7650
     ) {
7651
-      \trigger_error('UTF8::stristr() without mbstring cannot handle "' . $encoding . '" encoding', E_USER_WARNING);
7651
+      \trigger_error('UTF8::stristr() without mbstring cannot handle "'.$encoding.'" encoding', E_USER_WARNING);
7652 7652
     }
7653 7653
 
7654 7654
     if (self::$SUPPORT['mbstring'] === true) {
@@ -7670,7 +7670,7 @@  discard block
 block discarded – undo
7670 7670
       return \stristr($haystack, $needle, $before_needle);
7671 7671
     }
7672 7672
 
7673
-    \preg_match('/^(.*?)' . \preg_quote($needle, '/') . '/usi', $haystack, $match);
7673
+    \preg_match('/^(.*?)'.\preg_quote($needle, '/').'/usi', $haystack, $match);
7674 7674
 
7675 7675
     if (!isset($match[1])) {
7676 7676
       return false;
@@ -7737,7 +7737,7 @@  discard block
 block discarded – undo
7737 7737
         &&
7738 7738
         self::$SUPPORT['iconv'] === false
7739 7739
     ) {
7740
-      \trigger_error('UTF8::strlen() without mbstring / iconv cannot handle "' . $encoding . '" encoding', E_USER_WARNING);
7740
+      \trigger_error('UTF8::strlen() without mbstring / iconv cannot handle "'.$encoding.'" encoding', E_USER_WARNING);
7741 7741
     }
7742 7742
 
7743 7743
     //
@@ -7863,7 +7863,7 @@  discard block
 block discarded – undo
7863 7863
    */
7864 7864
   public static function strnatcmp(string $str1, string $str2): int
7865 7865
   {
7866
-    return $str1 . '' === $str2 . '' ? 0 : \strnatcmp(self::strtonatfold($str1), self::strtonatfold($str2));
7866
+    return $str1.'' === $str2.'' ? 0 : \strnatcmp(self::strtonatfold($str1), self::strtonatfold($str2));
7867 7867
   }
7868 7868
 
7869 7869
   /**
@@ -7928,7 +7928,7 @@  discard block
 block discarded – undo
7928 7928
       return false;
7929 7929
     }
7930 7930
 
7931
-    if (\preg_match('/' . self::rxClass($char_list) . '/us', $haystack, $m)) {
7931
+    if (\preg_match('/'.self::rxClass($char_list).'/us', $haystack, $m)) {
7932 7932
       return \substr($haystack, (int)\strpos($haystack, $m[0]));
7933 7933
     }
7934 7934
 
@@ -8000,7 +8000,7 @@  discard block
 block discarded – undo
8000 8000
         &&
8001 8001
         self::$SUPPORT['mbstring'] === false
8002 8002
     ) {
8003
-      \trigger_error('UTF8::strpos() without mbstring / iconv cannot handle "' . $encoding . '" encoding', E_USER_WARNING);
8003
+      \trigger_error('UTF8::strpos() without mbstring / iconv cannot handle "'.$encoding.'" encoding', E_USER_WARNING);
8004 8004
     }
8005 8005
 
8006 8006
     //
@@ -8166,7 +8166,7 @@  discard block
 block discarded – undo
8166 8166
         &&
8167 8167
         self::$SUPPORT['mbstring'] === false
8168 8168
     ) {
8169
-      \trigger_error('UTF8::strrchr() without mbstring cannot handle "' . $encoding . '" encoding', E_USER_WARNING);
8169
+      \trigger_error('UTF8::strrchr() without mbstring cannot handle "'.$encoding.'" encoding', E_USER_WARNING);
8170 8170
     }
8171 8171
 
8172 8172
     if (self::$SUPPORT['mbstring'] === true) {
@@ -8387,7 +8387,7 @@  discard block
 block discarded – undo
8387 8387
         &&
8388 8388
         self::$SUPPORT['mbstring'] === false
8389 8389
     ) {
8390
-      \trigger_error('UTF8::strripos() without mbstring cannot handle "' . $encoding . '" encoding', E_USER_WARNING);
8390
+      \trigger_error('UTF8::strripos() without mbstring cannot handle "'.$encoding.'" encoding', E_USER_WARNING);
8391 8391
     }
8392 8392
 
8393 8393
     //
@@ -8534,7 +8534,7 @@  discard block
 block discarded – undo
8534 8534
         &&
8535 8535
         self::$SUPPORT['mbstring'] === false
8536 8536
     ) {
8537
-      \trigger_error('UTF8::strrpos() without mbstring cannot handle "' . $encoding . '" encoding', E_USER_WARNING);
8537
+      \trigger_error('UTF8::strrpos() without mbstring cannot handle "'.$encoding.'" encoding', E_USER_WARNING);
8538 8538
     }
8539 8539
 
8540 8540
     //
@@ -8665,7 +8665,7 @@  discard block
 block discarded – undo
8665 8665
       return 0;
8666 8666
     }
8667 8667
 
8668
-    return \preg_match('/^' . self::rxClass($mask) . '+/u', $str, $str) ? self::strlen($str[0]) : 0;
8668
+    return \preg_match('/^'.self::rxClass($mask).'+/u', $str, $str) ? self::strlen($str[0]) : 0;
8669 8669
   }
8670 8670
 
8671 8671
   /**
@@ -8721,7 +8721,7 @@  discard block
 block discarded – undo
8721 8721
         &&
8722 8722
         self::$SUPPORT['mbstring'] === false
8723 8723
     ) {
8724
-      \trigger_error('UTF8::strstr() without mbstring cannot handle "' . $encoding . '" encoding', E_USER_WARNING);
8724
+      \trigger_error('UTF8::strstr() without mbstring cannot handle "'.$encoding.'" encoding', E_USER_WARNING);
8725 8725
     }
8726 8726
 
8727 8727
     //
@@ -8759,7 +8759,7 @@  discard block
 block discarded – undo
8759 8759
     // fallback via vanilla php
8760 8760
     //
8761 8761
 
8762
-    \preg_match('/^(.*?)' . \preg_quote($needle, '/') . '/us', $haystack, $match);
8762
+    \preg_match('/^(.*?)'.\preg_quote($needle, '/').'/us', $haystack, $match);
8763 8763
 
8764 8764
     if (!isset($match[1])) {
8765 8765
       return false;
@@ -8897,9 +8897,9 @@  discard block
 block discarded – undo
8897 8897
 
8898 8898
       if (self::$SUPPORT['intl'] === true) {
8899 8899
 
8900
-        $langCode = $lang . '-Lower';
8900
+        $langCode = $lang.'-Lower';
8901 8901
         if (!\in_array($langCode, self::$SUPPORT['intl__transliterator_list_ids'], true)) {
8902
-          \trigger_error('UTF8::strtolower() cannot handle special language: ' . $lang, E_USER_WARNING);
8902
+          \trigger_error('UTF8::strtolower() cannot handle special language: '.$lang, E_USER_WARNING);
8903 8903
 
8904 8904
           $langCode = 'Any-Lower';
8905 8905
         }
@@ -8908,7 +8908,7 @@  discard block
 block discarded – undo
8908 8908
         return transliterator_transliterate($langCode, $str);
8909 8909
       }
8910 8910
 
8911
-      \trigger_error('UTF8::strtolower() without intl cannot handle the "lang" parameter: ' . $lang, E_USER_WARNING);
8911
+      \trigger_error('UTF8::strtolower() without intl cannot handle the "lang" parameter: '.$lang, E_USER_WARNING);
8912 8912
     }
8913 8913
 
8914 8914
     // always fallback via symfony polyfill
@@ -8973,9 +8973,9 @@  discard block
 block discarded – undo
8973 8973
 
8974 8974
       if (self::$SUPPORT['intl'] === true) {
8975 8975
 
8976
-        $langCode = $lang . '-Upper';
8976
+        $langCode = $lang.'-Upper';
8977 8977
         if (!\in_array($langCode, self::$SUPPORT['intl__transliterator_list_ids'], true)) {
8978
-          \trigger_error('UTF8::strtoupper() without intl for special language: ' . $lang, E_USER_WARNING);
8978
+          \trigger_error('UTF8::strtoupper() without intl for special language: '.$lang, E_USER_WARNING);
8979 8979
 
8980 8980
           $langCode = 'Any-Upper';
8981 8981
         }
@@ -8984,7 +8984,7 @@  discard block
 block discarded – undo
8984 8984
         return transliterator_transliterate($langCode, $str);
8985 8985
       }
8986 8986
 
8987
-      \trigger_error('UTF8::strtolower() without intl + PHP >= 5.4 cannot handle the "lang"-parameter: ' . $lang, E_USER_WARNING);
8987
+      \trigger_error('UTF8::strtolower() without intl + PHP >= 5.4 cannot handle the "lang"-parameter: '.$lang, E_USER_WARNING);
8988 8988
     }
8989 8989
 
8990 8990
     // always fallback via symfony polyfill
@@ -9188,7 +9188,7 @@  discard block
 block discarded – undo
9188 9188
         &&
9189 9189
         self::$SUPPORT['mbstring'] === false
9190 9190
     ) {
9191
-      \trigger_error('UTF8::substr() without mbstring cannot handle "' . $encoding . '" encoding', E_USER_WARNING);
9191
+      \trigger_error('UTF8::substr() without mbstring cannot handle "'.$encoding.'" encoding', E_USER_WARNING);
9192 9192
     }
9193 9193
 
9194 9194
     //
@@ -9368,14 +9368,14 @@  discard block
 block discarded – undo
9368 9368
         &&
9369 9369
         self::$SUPPORT['mbstring'] === false
9370 9370
     ) {
9371
-      \trigger_error('UTF8::substr_count() without mbstring cannot handle "' . $encoding . '" encoding', E_USER_WARNING);
9371
+      \trigger_error('UTF8::substr_count() without mbstring cannot handle "'.$encoding.'" encoding', E_USER_WARNING);
9372 9372
     }
9373 9373
 
9374 9374
     if (self::$SUPPORT['mbstring'] === true) {
9375 9375
       return \mb_substr_count($haystack, $needle, $encoding);
9376 9376
     }
9377 9377
 
9378
-    \preg_match_all('/' . \preg_quote($needle, '/') . '/us', $haystack, $matches, PREG_SET_ORDER);
9378
+    \preg_match_all('/'.\preg_quote($needle, '/').'/us', $haystack, $matches, PREG_SET_ORDER);
9379 9379
 
9380 9380
     return \count($matches);
9381 9381
   }
@@ -9699,8 +9699,7 @@  discard block
 block discarded – undo
9699 9699
 
9700 9700
     if (self::is_ascii($str)) {
9701 9701
       return ($length === null) ?
9702
-          \substr_replace($str, $replacement, $offset) :
9703
-          \substr_replace($str, $replacement, $offset, $length);
9702
+          \substr_replace($str, $replacement, $offset) : \substr_replace($str, $replacement, $offset, $length);
9704 9703
     }
9705 9704
 
9706 9705
     \preg_match_all('/./us', $str, $smatches);
@@ -10186,7 +10185,7 @@  discard block
 block discarded – undo
10186 10185
           $c2 = $i + 1 >= $max ? "\x00" : $str[$i + 1];
10187 10186
 
10188 10187
           if ($c2 >= "\x80" && $c2 <= "\xBF") { // yeah, almost sure it's UTF8 already
10189
-            $buf .= $c1 . $c2;
10188
+            $buf .= $c1.$c2;
10190 10189
             $i++;
10191 10190
           } else { // not valid UTF8 - convert it
10192 10191
             $buf .= self::to_utf8_convert_helper($c1);
@@ -10198,7 +10197,7 @@  discard block
 block discarded – undo
10198 10197
           $c3 = $i + 2 >= $max ? "\x00" : $str[$i + 2];
10199 10198
 
10200 10199
           if ($c2 >= "\x80" && $c2 <= "\xBF" && $c3 >= "\x80" && $c3 <= "\xBF") { // yeah, almost sure it's UTF8 already
10201
-            $buf .= $c1 . $c2 . $c3;
10200
+            $buf .= $c1.$c2.$c3;
10202 10201
             $i += 2;
10203 10202
           } else { // not valid UTF8 - convert it
10204 10203
             $buf .= self::to_utf8_convert_helper($c1);
@@ -10211,7 +10210,7 @@  discard block
 block discarded – undo
10211 10210
           $c4 = $i + 3 >= $max ? "\x00" : $str[$i + 3];
10212 10211
 
10213 10212
           if ($c2 >= "\x80" && $c2 <= "\xBF" && $c3 >= "\x80" && $c3 <= "\xBF" && $c4 >= "\x80" && $c4 <= "\xBF") { // yeah, almost sure it's UTF8 already
10214
-            $buf .= $c1 . $c2 . $c3 . $c4;
10213
+            $buf .= $c1.$c2.$c3.$c4;
10215 10214
             $i += 3;
10216 10215
           } else { // not valid UTF8 - convert it
10217 10216
             $buf .= self::to_utf8_convert_helper($c1);
@@ -10233,7 +10232,7 @@  discard block
 block discarded – undo
10233 10232
     // decode unicode escape sequences
10234 10233
     $buf = \preg_replace_callback(
10235 10234
         '/\\\\u([0-9a-f]{4})/i',
10236
-        function ($match) {
10235
+        function($match) {
10237 10236
           // always fallback via symfony polyfill
10238 10237
           return \mb_convert_encoding(pack('H*', $match[1]), 'UTF-8', 'UCS-2BE');
10239 10238
         },
@@ -10276,7 +10275,7 @@  discard block
 block discarded – undo
10276 10275
     } else {
10277 10276
       $cc1 = self::$CHR[$ordC1 / 64] | "\xC0";
10278 10277
       $cc2 = ((string)$input & "\x3F") | "\x80";
10279
-      $buf .= $cc1 . $cc2;
10278
+      $buf .= $cc1.$cc2;
10280 10279
     }
10281 10280
 
10282 10281
     return $buf;
@@ -10340,7 +10339,7 @@  discard block
 block discarded – undo
10340 10339
         $cleanUtf8
10341 10340
     );
10342 10341
 
10343
-    return $strPartOne . $strPartTwo;
10342
+    return $strPartOne.$strPartTwo;
10344 10343
   }
10345 10344
 
10346 10345
   /**
@@ -10385,7 +10384,7 @@  discard block
 block discarded – undo
10385 10384
       $str = self::clean($str);
10386 10385
     }
10387 10386
 
10388
-    $usePhpDefaultFunctions = !(bool)($charlist . \implode('', $exceptions));
10387
+    $usePhpDefaultFunctions = !(bool)($charlist.\implode('', $exceptions));
10389 10388
 
10390 10389
     if (
10391 10390
         $usePhpDefaultFunctions === true
@@ -10889,7 +10888,7 @@  discard block
 block discarded – undo
10889 10888
       return '';
10890 10889
     }
10891 10890
 
10892
-    \preg_match('/^\s*+(?:\S++\s*+){1,' . $limit . '}/u', $str, $matches);
10891
+    \preg_match('/^\s*+(?:\S++\s*+){1,'.$limit.'}/u', $str, $matches);
10893 10892
 
10894 10893
     if (
10895 10894
         !isset($matches[0])
@@ -10899,7 +10898,7 @@  discard block
 block discarded – undo
10899 10898
       return $str;
10900 10899
     }
10901 10900
 
10902
-    return self::rtrim($matches[0]) . $strAddOn;
10901
+    return self::rtrim($matches[0]).$strAddOn;
10903 10902
   }
10904 10903
 
10905 10904
   /**
@@ -10970,7 +10969,7 @@  discard block
 block discarded – undo
10970 10969
       $strReturn .= $break;
10971 10970
     }
10972 10971
 
10973
-    return $strReturn . \implode('', $chars);
10972
+    return $strReturn.\implode('', $chars);
10974 10973
   }
10975 10974
 
10976 10975
   /**
Please login to merge, or discard this patch.