Passed
Push — master ( 7eed2c...0ce138 )
by Lars
03:23
created
src/voku/helper/UTF8.php 1 patch
Spacing   +120 added lines, -121 removed lines patch added patch discarded remove patch
@@ -243,7 +243,7 @@  discard block
 block discarded – undo
243 243
   public static function add_bom_to_string(string $str): string
244 244
   {
245 245
     if (self::string_has_bom($str) === false) {
246
-      $str = self::bom() . $str;
246
+      $str = self::bom().$str;
247 247
     }
248 248
 
249 249
     return $str;
@@ -510,10 +510,10 @@  discard block
 block discarded – undo
510 510
         &&
511 511
         self::$SUPPORT['mbstring'] === false
512 512
     ) {
513
-      \trigger_error('UTF8::chr() without mbstring cannot handle "' . $encoding . '" encoding', E_USER_WARNING);
513
+      \trigger_error('UTF8::chr() without mbstring cannot handle "'.$encoding.'" encoding', E_USER_WARNING);
514 514
     }
515 515
 
516
-    $cacheKey = $code_point . $encoding;
516
+    $cacheKey = $code_point.$encoding;
517 517
     if (isset($CHAR_CACHE[$cacheKey]) === true) {
518 518
       return $CHAR_CACHE[$cacheKey];
519 519
     }
@@ -560,16 +560,16 @@  discard block
 block discarded – undo
560 560
     if ($code_point <= 0x7F) {
561 561
       $chr = self::$CHR[$code_point];
562 562
     } elseif ($code_point <= 0x7FF) {
563
-      $chr = self::$CHR[($code_point >> 6) + 0xC0] .
563
+      $chr = self::$CHR[($code_point >> 6) + 0xC0].
564 564
              self::$CHR[($code_point & 0x3F) + 0x80];
565 565
     } elseif ($code_point <= 0xFFFF) {
566
-      $chr = self::$CHR[($code_point >> 12) + 0xE0] .
567
-             self::$CHR[(($code_point >> 6) & 0x3F) + 0x80] .
566
+      $chr = self::$CHR[($code_point >> 12) + 0xE0].
567
+             self::$CHR[(($code_point >> 6) & 0x3F) + 0x80].
568 568
              self::$CHR[($code_point & 0x3F) + 0x80];
569 569
     } else {
570
-      $chr = self::$CHR[($code_point >> 18) + 0xF0] .
571
-             self::$CHR[(($code_point >> 12) & 0x3F) + 0x80] .
572
-             self::$CHR[(($code_point >> 6) & 0x3F) + 0x80] .
570
+      $chr = self::$CHR[($code_point >> 18) + 0xF0].
571
+             self::$CHR[(($code_point >> 12) & 0x3F) + 0x80].
572
+             self::$CHR[(($code_point >> 6) & 0x3F) + 0x80].
573 573
              self::$CHR[($code_point & 0x3F) + 0x80];
574 574
     }
575 575
 
@@ -618,7 +618,7 @@  discard block
 block discarded – undo
618 618
 
619 619
     if (self::$SUPPORT['mbstring_func_overload'] === true) {
620 620
       return \array_map(
621
-          function ($data) {
621
+          function($data) {
622 622
             return UTF8::strlen_in_byte($data);
623 623
           },
624 624
           $strSplit
@@ -930,7 +930,7 @@  discard block
 block discarded – undo
930 930
    */
931 931
   public static function decimal_to_chr($int): string
932 932
   {
933
-    return self::html_entity_decode('&#' . $int . ';', ENT_QUOTES | ENT_HTML5);
933
+    return self::html_entity_decode('&#'.$int.';', ENT_QUOTES | ENT_HTML5);
934 934
   }
935 935
 
936 936
   /**
@@ -1010,7 +1010,7 @@  discard block
 block discarded – undo
1010 1010
           &&
1011 1011
           self::$SUPPORT['mbstring'] === false
1012 1012
       ) {
1013
-        \trigger_error('UTF8::encode() without mbstring cannot handle "' . $encoding . '" encoding', E_USER_WARNING);
1013
+        \trigger_error('UTF8::encode() without mbstring cannot handle "'.$encoding.'" encoding', E_USER_WARNING);
1014 1014
       }
1015 1015
 
1016 1016
       // always fallback via symfony polyfill
@@ -1072,7 +1072,7 @@  discard block
 block discarded – undo
1072 1072
           return '';
1073 1073
         }
1074 1074
 
1075
-        return \rtrim($strSub, $trimChars) . $replacerForSkippedText;
1075
+        return \rtrim($strSub, $trimChars).$replacerForSkippedText;
1076 1076
       }
1077 1077
 
1078 1078
       return $str;
@@ -1108,14 +1108,14 @@  discard block
 block discarded – undo
1108 1108
       if (!$pos_end || $pos_end <= 0) {
1109 1109
         $strSub = self::substr($str, $pos_start, self::strlen($str), $encoding);
1110 1110
         if ($strSub !== false) {
1111
-          $extract = $replacerForSkippedText . \ltrim($strSub, $trimChars);
1111
+          $extract = $replacerForSkippedText.\ltrim($strSub, $trimChars);
1112 1112
         } else {
1113 1113
           $extract = '';
1114 1114
         }
1115 1115
       } else {
1116 1116
         $strSub = self::substr($str, $pos_start, $pos_end, $encoding);
1117 1117
         if ($strSub !== false) {
1118
-          $extract = $replacerForSkippedText . \trim($strSub, $trimChars) . $replacerForSkippedText;
1118
+          $extract = $replacerForSkippedText.\trim($strSub, $trimChars).$replacerForSkippedText;
1119 1119
         } else {
1120 1120
           $extract = '';
1121 1121
         }
@@ -1138,7 +1138,7 @@  discard block
 block discarded – undo
1138 1138
       if ($pos_end) {
1139 1139
         $strSub = self::substr($str, 0, $pos_end, $encoding);
1140 1140
         if ($strSub !== false) {
1141
-          $extract = \rtrim($strSub, $trimChars) . $replacerForSkippedText;
1141
+          $extract = \rtrim($strSub, $trimChars).$replacerForSkippedText;
1142 1142
         } else {
1143 1143
           $extract = '';
1144 1144
         }
@@ -1256,7 +1256,7 @@  discard block
 block discarded – undo
1256 1256
   {
1257 1257
     $file_content = \file_get_contents($file_path);
1258 1258
     if ($file_content === false) {
1259
-      throw new \RuntimeException('file_get_contents() returned false for:' . $file_path);
1259
+      throw new \RuntimeException('file_get_contents() returned false for:'.$file_path);
1260 1260
     }
1261 1261
 
1262 1262
     return self::string_has_bom($file_content);
@@ -1316,7 +1316,7 @@  discard block
 block discarded – undo
1316 1316
           ) {
1317 1317
             // Prevent leading combining chars
1318 1318
             // for NFC-safe concatenations.
1319
-            $var = $leading_combining . $var;
1319
+            $var = $leading_combining.$var;
1320 1320
           }
1321 1321
         }
1322 1322
 
@@ -1801,7 +1801,7 @@  discard block
 block discarded – undo
1801 1801
    */
1802 1802
   private static function getData(string $file)
1803 1803
   {
1804
-    $file = __DIR__ . '/data/' . $file . '.php';
1804
+    $file = __DIR__.'/data/'.$file.'.php';
1805 1805
     if (\file_exists($file)) {
1806 1806
       /** @noinspection PhpIncludeInspection */
1807 1807
       return require $file;
@@ -1879,16 +1879,16 @@  discard block
 block discarded – undo
1879 1879
    */
1880 1880
   public static function get_unique_string($entropyExtra = '', bool $md5 = true): string
1881 1881
   {
1882
-    $uniqueHelper = \mt_rand() .
1883
-                    \session_id() .
1884
-                    ($_SERVER['REMOTE_ADDR'] ?? '') .
1885
-                    ($_SERVER['SERVER_ADDR'] ?? '') .
1882
+    $uniqueHelper = \mt_rand().
1883
+                    \session_id().
1884
+                    ($_SERVER['REMOTE_ADDR'] ?? '').
1885
+                    ($_SERVER['SERVER_ADDR'] ?? '').
1886 1886
                     $entropyExtra;
1887 1887
 
1888 1888
     $uniqueString = \uniqid($uniqueHelper, true);
1889 1889
 
1890 1890
     if ($md5) {
1891
-      $uniqueString = \md5($uniqueString . $uniqueHelper);
1891
+      $uniqueString = \md5($uniqueString.$uniqueHelper);
1892 1892
     }
1893 1893
 
1894 1894
     return $uniqueString;
@@ -2023,7 +2023,7 @@  discard block
 block discarded – undo
2023 2023
     return \implode(
2024 2024
         '',
2025 2025
         \array_map(
2026
-            function ($data) use ($keepAsciiChars, $encoding) {
2026
+            function($data) use ($keepAsciiChars, $encoding) {
2027 2027
               return UTF8::single_chr_html_encode($data, $keepAsciiChars, $encoding);
2028 2028
             },
2029 2029
             self::split($str)
@@ -2139,7 +2139,7 @@  discard block
 block discarded – undo
2139 2139
         &&
2140 2140
         self::$SUPPORT['mbstring'] === false
2141 2141
     ) {
2142
-      \trigger_error('UTF8::html_entity_decode() without mbstring cannot handle "' . $encoding . '" encoding', E_USER_WARNING);
2142
+      \trigger_error('UTF8::html_entity_decode() without mbstring cannot handle "'.$encoding.'" encoding', E_USER_WARNING);
2143 2143
     }
2144 2144
 
2145 2145
     do {
@@ -2147,7 +2147,7 @@  discard block
 block discarded – undo
2147 2147
 
2148 2148
       $str = (string)\preg_replace_callback(
2149 2149
           "/&#\d{2,6};/",
2150
-          function ($matches) use ($encoding) {
2150
+          function($matches) use ($encoding) {
2151 2151
             // always fallback via symfony polyfill
2152 2152
             $returnTmp = \mb_convert_encoding($matches[0], $encoding, 'HTML-ENTITIES');
2153 2153
 
@@ -2488,9 +2488,9 @@  discard block
 block discarded – undo
2488 2488
   {
2489 2489
     $hex = \dechex($int);
2490 2490
 
2491
-    $hex = (\strlen($hex) < 4 ? \substr('0000' . $hex, -4) : $hex);
2491
+    $hex = (\strlen($hex) < 4 ? \substr('0000'.$hex, -4) : $hex);
2492 2492
 
2493
-    return $pfix . $hex . '';
2493
+    return $pfix.$hex.'';
2494 2494
   }
2495 2495
 
2496 2496
   /**
@@ -3409,7 +3409,7 @@  discard block
 block discarded – undo
3409 3409
         $cleanUtf8
3410 3410
     );
3411 3411
 
3412
-    return $strPartOne . $strPartTwo;
3412
+    return $strPartOne.$strPartTwo;
3413 3413
   }
3414 3414
 
3415 3415
   /**
@@ -3872,7 +3872,7 @@  discard block
 block discarded – undo
3872 3872
       }
3873 3873
     }
3874 3874
 
3875
-    $cacheKey = $chr_orig . $encoding;
3875
+    $cacheKey = $chr_orig.$encoding;
3876 3876
     if (isset($CHAR_CACHE[$cacheKey]) === true) {
3877 3877
       return $CHAR_CACHE[$cacheKey];
3878 3878
     }
@@ -4114,7 +4114,7 @@  discard block
 block discarded – undo
4114 4114
     }
4115 4115
 
4116 4116
     $str = (string)\preg_replace(
4117
-        $delimiter . $pattern . $delimiter . 'u' . $options,
4117
+        $delimiter.$pattern.$delimiter.'u'.$options,
4118 4118
         $replacement,
4119 4119
         $str
4120 4120
     );
@@ -4181,7 +4181,7 @@  discard block
 block discarded – undo
4181 4181
     if (\is_array($what) === true) {
4182 4182
       /** @noinspection ForeachSourceInspection */
4183 4183
       foreach ($what as $item) {
4184
-        $str = (string)\preg_replace('/(' . \preg_quote($item, '/') . ')+/', $item, $str);
4184
+        $str = (string)\preg_replace('/('.\preg_quote($item, '/').')+/', $item, $str);
4185 4185
       }
4186 4186
     }
4187 4187
 
@@ -4429,7 +4429,7 @@  discard block
 block discarded – undo
4429 4429
   {
4430 4430
     static $RX_CLASSS_CACHE = [];
4431 4431
 
4432
-    $cacheKey = $s . $class;
4432
+    $cacheKey = $s.$class;
4433 4433
 
4434 4434
     if (isset($RX_CLASSS_CACHE[$cacheKey])) {
4435 4435
       return $RX_CLASSS_CACHE[$cacheKey];
@@ -4441,7 +4441,7 @@  discard block
 block discarded – undo
4441 4441
     /** @noinspection SuspiciousLoopInspection */
4442 4442
     foreach (self::str_split($s) as $s) {
4443 4443
       if ('-' === $s) {
4444
-        $class[0] = '-' . $class[0];
4444
+        $class[0] = '-'.$class[0];
4445 4445
       } elseif (!isset($s[2])) {
4446 4446
         $class[0] .= \preg_quote($s, '/');
4447 4447
       } elseif (1 === self::strlen($s)) {
@@ -4452,13 +4452,13 @@  discard block
 block discarded – undo
4452 4452
     }
4453 4453
 
4454 4454
     if ($class[0]) {
4455
-      $class[0] = '[' . $class[0] . ']';
4455
+      $class[0] = '['.$class[0].']';
4456 4456
     }
4457 4457
 
4458 4458
     if (1 === \count($class)) {
4459 4459
       $return = $class[0];
4460 4460
     } else {
4461
-      $return = '(?:' . \implode('|', $class) . ')';
4461
+      $return = '(?:'.\implode('|', $class).')';
4462 4462
     }
4463 4463
 
4464 4464
     $RX_CLASSS_CACHE[$cacheKey] = $return;
@@ -4477,7 +4477,7 @@  discard block
 block discarded – undo
4477 4477
 
4478 4478
     echo '<pre>';
4479 4479
     foreach (self::$SUPPORT as $key => $value) {
4480
-      echo $key . ' - ' . \print_r($value, true) . "\n<br>";
4480
+      echo $key.' - '.\print_r($value, true)."\n<br>";
4481 4481
     }
4482 4482
     echo '</pre>';
4483 4483
   }
@@ -4509,7 +4509,7 @@  discard block
 block discarded – undo
4509 4509
       $encoding = self::normalize_encoding($encoding, 'UTF-8');
4510 4510
     }
4511 4511
 
4512
-    return '&#' . self::ord($char, $encoding) . ';';
4512
+    return '&#'.self::ord($char, $encoding).';';
4513 4513
   }
4514 4514
 
4515 4515
   /**
@@ -4581,7 +4581,7 @@  discard block
 block discarded – undo
4581 4581
         ) {
4582 4582
 
4583 4583
           if (($str[$i + 1] & "\xC0") === "\x80") {
4584
-            $ret[] = $str[$i] . $str[$i + 1];
4584
+            $ret[] = $str[$i].$str[$i + 1];
4585 4585
 
4586 4586
             $i++;
4587 4587
           }
@@ -4597,7 +4597,7 @@  discard block
 block discarded – undo
4597 4597
               &&
4598 4598
               ($str[$i + 2] & "\xC0") === "\x80"
4599 4599
           ) {
4600
-            $ret[] = $str[$i] . $str[$i + 1] . $str[$i + 2];
4600
+            $ret[] = $str[$i].$str[$i + 1].$str[$i + 2];
4601 4601
 
4602 4602
             $i += 2;
4603 4603
           }
@@ -4615,7 +4615,7 @@  discard block
 block discarded – undo
4615 4615
               &&
4616 4616
               ($str[$i + 3] & "\xC0") === "\x80"
4617 4617
           ) {
4618
-            $ret[] = $str[$i] . $str[$i + 1] . $str[$i + 2] . $str[$i + 3];
4618
+            $ret[] = $str[$i].$str[$i + 1].$str[$i + 2].$str[$i + 3];
4619 4619
 
4620 4620
             $i += 3;
4621 4621
           }
@@ -4628,7 +4628,7 @@  discard block
 block discarded – undo
4628 4628
       $ret = \array_chunk($ret, $length);
4629 4629
 
4630 4630
       return \array_map(
4631
-          function ($item) {
4631
+          function($item) {
4632 4632
             return \implode('', $item);
4633 4633
           }, $ret
4634 4634
       );
@@ -4658,7 +4658,7 @@  discard block
 block discarded – undo
4658 4658
 
4659 4659
     $str = (string)\preg_replace_callback(
4660 4660
         '/[-_\s]+(.)?/u',
4661
-        function ($match) use ($encoding) {
4661
+        function($match) use ($encoding) {
4662 4662
           if (isset($match[1])) {
4663 4663
             return UTF8::strtoupper($match[1], $encoding);
4664 4664
           }
@@ -4670,7 +4670,7 @@  discard block
 block discarded – undo
4670 4670
 
4671 4671
     $str = (string)\preg_replace_callback(
4672 4672
         '/[\d]+(.)?/u',
4673
-        function ($match) use ($encoding) {
4673
+        function($match) use ($encoding) {
4674 4674
           return UTF8::strtoupper($match[0], $encoding);
4675 4675
         },
4676 4676
         $str
@@ -5015,7 +5015,7 @@  discard block
 block discarded – undo
5015 5015
     foreach (self::$ENCODINGS as $encodingTmp) {
5016 5016
       # INFO: //IGNORE but still throw notice
5017 5017
       /** @noinspection PhpUsageOfSilenceOperatorInspection */
5018
-      if (\md5((string)@\iconv($encodingTmp, $encodingTmp . '//IGNORE', $str)) === $md5) {
5018
+      if (\md5((string)@\iconv($encodingTmp, $encodingTmp.'//IGNORE', $str)) === $md5) {
5019 5019
         return $encodingTmp;
5020 5020
       }
5021 5021
     }
@@ -5077,7 +5077,7 @@  discard block
 block discarded – undo
5077 5077
   public static function str_ensure_left(string $str, string $substring): string
5078 5078
   {
5079 5079
     if (!self::str_starts_with($str, $substring)) {
5080
-      $str = $substring . $str;
5080
+      $str = $substring.$str;
5081 5081
     }
5082 5082
 
5083 5083
     return $str;
@@ -5286,7 +5286,7 @@  discard block
 block discarded – undo
5286 5286
     $start = self::substr($str, 0, $index, $encoding);
5287 5287
     $end = self::substr($str, $index, $len, $encoding);
5288 5288
 
5289
-    return $start . $substring . $end;
5289
+    return $start.$substring.$end;
5290 5290
   }
5291 5291
 
5292 5292
   /**
@@ -5323,7 +5323,7 @@  discard block
 block discarded – undo
5323 5323
       if ('' === $s .= '') {
5324 5324
         $s = '/^(?<=.)$/';
5325 5325
       } else {
5326
-        $s = '/' . \preg_quote($s, '/') . '/ui';
5326
+        $s = '/'.\preg_quote($s, '/').'/ui';
5327 5327
       }
5328 5328
     }
5329 5329
 
@@ -5606,7 +5606,7 @@  discard block
 block discarded – undo
5606 5606
       return $str;
5607 5607
     }
5608 5608
 
5609
-    return self::substr($str, 0, $length - self::strlen($strAddOn), $encoding) . $strAddOn;
5609
+    return self::substr($str, 0, $length - self::strlen($strAddOn), $encoding).$strAddOn;
5610 5610
   }
5611 5611
 
5612 5612
   /**
@@ -5634,7 +5634,7 @@  discard block
 block discarded – undo
5634 5634
     }
5635 5635
 
5636 5636
     if (self::substr($str, $length - 1, 1, $encoding) === ' ') {
5637
-      return self::substr($str, 0, $length - 1, $encoding) . $strAddOn;
5637
+      return self::substr($str, 0, $length - 1, $encoding).$strAddOn;
5638 5638
     }
5639 5639
 
5640 5640
     $str = (string)self::substr($str, 0, $length, $encoding);
@@ -5643,9 +5643,9 @@  discard block
 block discarded – undo
5643 5643
     $new_str = \implode(' ', $array);
5644 5644
 
5645 5645
     if ($new_str === '') {
5646
-      $str = self::substr($str, 0, $length - 1, $encoding) . $strAddOn;
5646
+      $str = self::substr($str, 0, $length - 1, $encoding).$strAddOn;
5647 5647
     } else {
5648
-      $str = $new_str . $strAddOn;
5648
+      $str = $new_str.$strAddOn;
5649 5649
     }
5650 5650
 
5651 5651
     return $str;
@@ -5748,7 +5748,7 @@  discard block
 block discarded – undo
5748 5748
       $char = self::substr($str, -$i, 1, $encoding);
5749 5749
 
5750 5750
       if ($char == self::substr($otherStr, -$i, 1, $encoding)) {
5751
-        $longestCommonSuffix = $char . $longestCommonSuffix;
5751
+        $longestCommonSuffix = $char.$longestCommonSuffix;
5752 5752
       } else {
5753 5753
         break;
5754 5754
       }
@@ -5767,7 +5767,7 @@  discard block
 block discarded – undo
5767 5767
    */
5768 5768
   public static function str_matches_pattern(string $str, string $pattern): bool
5769 5769
   {
5770
-    if (\preg_match('/' . $pattern . '/u', $str)) {
5770
+    if (\preg_match('/'.$pattern.'/u', $str)) {
5771 5771
       return true;
5772 5772
     }
5773 5773
 
@@ -5857,7 +5857,7 @@  discard block
 block discarded – undo
5857 5857
         $pad_type = STR_PAD_BOTH;
5858 5858
       } else {
5859 5859
         throw new \InvalidArgumentException(
5860
-            'Pad expects $padType to be "STR_PAD_*" or ' . "to be one of 'left', 'right' or 'both'"
5860
+            'Pad expects $padType to be "STR_PAD_*" or '."to be one of 'left', 'right' or 'both'"
5861 5861
         );
5862 5862
       }
5863 5863
     }
@@ -5894,7 +5894,7 @@  discard block
 block discarded – undo
5894 5894
           $pre = '';
5895 5895
       }
5896 5896
 
5897
-      return $pre . $str . $post;
5897
+      return $pre.$str.$post;
5898 5898
     }
5899 5899
 
5900 5900
     return $str;
@@ -6022,7 +6022,7 @@  discard block
 block discarded – undo
6022 6022
   {
6023 6023
     return self::regex_replace(
6024 6024
         $str,
6025
-        '^' . \preg_quote($search, '/'),
6025
+        '^'.\preg_quote($search, '/'),
6026 6026
         self::str_replace('\\', '\\\\', $replacement)
6027 6027
     );
6028 6028
   }
@@ -6040,7 +6040,7 @@  discard block
 block discarded – undo
6040 6040
   {
6041 6041
     return self::regex_replace(
6042 6042
         $str,
6043
-        \preg_quote($search, '/') . '$',
6043
+        \preg_quote($search, '/').'$',
6044 6044
         self::str_replace('\\', '\\\\', $replacement)
6045 6045
     );
6046 6046
   }
@@ -6153,24 +6153,24 @@  discard block
 block discarded – undo
6153 6153
 
6154 6154
     $str = (string)\preg_replace_callback(
6155 6155
         '/([\d|A-Z])/u',
6156
-        function ($matches) use ($encoding) {
6156
+        function($matches) use ($encoding) {
6157 6157
           $match = $matches[1];
6158 6158
           $matchInt = (int)$match;
6159 6159
 
6160 6160
           if ((string)$matchInt == $match) {
6161
-            return '_' . $match . '_';
6161
+            return '_'.$match.'_';
6162 6162
           }
6163 6163
 
6164
-          return '_' . UTF8::strtolower($match, $encoding);
6164
+          return '_'.UTF8::strtolower($match, $encoding);
6165 6165
         },
6166 6166
         $str
6167 6167
     );
6168 6168
 
6169 6169
     $str = (string)\preg_replace(
6170 6170
         [
6171
-            '/\s+/',        // convert spaces to "_"
6172
-            '/^\s+|\s+$/',  // trim leading & trailing spaces
6173
-            '/_+/',         // remove double "_"
6171
+            '/\s+/', // convert spaces to "_"
6172
+            '/^\s+|\s+$/', // trim leading & trailing spaces
6173
+            '/_+/', // remove double "_"
6174 6174
         ],
6175 6175
         [
6176 6176
             '_',
@@ -6239,7 +6239,7 @@  discard block
 block discarded – undo
6239 6239
     }
6240 6240
 
6241 6241
     /** @noinspection NotOptimalRegularExpressionsInspection */
6242
-    \preg_match_all('/' . self::GRAPHEME_CLUSTER_RX . '/u', $str, $a);
6242
+    \preg_match_all('/'.self::GRAPHEME_CLUSTER_RX.'/u', $str, $a);
6243 6243
     $a = $a[0];
6244 6244
 
6245 6245
     if ($len === 1) {
@@ -6292,7 +6292,7 @@  discard block
 block discarded – undo
6292 6292
       $limit = -1;
6293 6293
     }
6294 6294
 
6295
-    $array = \preg_split('/' . \preg_quote($pattern, '/') . '/u', $str, $limit);
6295
+    $array = \preg_split('/'.\preg_quote($pattern, '/').'/u', $str, $limit);
6296 6296
 
6297 6297
     if ($array === false) {
6298 6298
       return [];
@@ -6574,7 +6574,7 @@  discard block
 block discarded – undo
6574 6574
 
6575 6575
     $str = (string)\preg_replace_callback(
6576 6576
         '/([\S]+)/u',
6577
-        function ($match) use ($encoding, $ignore) {
6577
+        function($match) use ($encoding, $ignore) {
6578 6578
           if ($ignore && \in_array($match[0], $ignore, true)) {
6579 6579
             return $match[0];
6580 6580
           }
@@ -6643,16 +6643,16 @@  discard block
 block discarded – undo
6643 6643
     $str = (string)\preg_replace_callback(
6644 6644
         '~\b (_*) (?:                                                              # 1. Leading underscore and
6645 6645
                         ( (?<=[ ][/\\\\]) [[:alpha:]]+ [-_[:alpha:]/\\\\]+ |              # 2. file path or 
6646
-                          [-_[:alpha:]]+ [@.:] [-_[:alpha:]@.:/]+ ' . $apostropheRx . ' ) #    URL, domain, or email
6646
+                          [-_[:alpha:]]+ [@.:] [-_[:alpha:]@.:/]+ ' . $apostropheRx.' ) #    URL, domain, or email
6647 6647
                         |
6648
-                        ( (?i: ' . $smallWordsRx . ' ) ' . $apostropheRx . ' )            # 3. or small word (case-insensitive)
6648
+                        ( (?i: ' . $smallWordsRx.' ) '.$apostropheRx.' )            # 3. or small word (case-insensitive)
6649 6649
                         |
6650
-                        ( [[:alpha:]] [[:lower:]\'’()\[\]{}]* ' . $apostropheRx . ' )     # 4. or word w/o internal caps
6650
+                        ( [[:alpha:]] [[:lower:]\'’()\[\]{}]* ' . $apostropheRx.' )     # 4. or word w/o internal caps
6651 6651
                         |
6652
-                        ( [[:alpha:]] [[:alpha:]\'’()\[\]{}]* ' . $apostropheRx . ' )     # 5. or some other word
6652
+                        ( [[:alpha:]] [[:alpha:]\'’()\[\]{}]* ' . $apostropheRx.' )     # 5. or some other word
6653 6653
                       ) (_*) \b                                                           # 6. With trailing underscore
6654 6654
                     ~ux',
6655
-        function ($matches) use ($encoding) {
6655
+        function($matches) use ($encoding) {
6656 6656
           // Preserve leading underscore
6657 6657
           $str = $matches[1];
6658 6658
           if ($matches[2]) {
@@ -6681,21 +6681,21 @@  discard block
 block discarded – undo
6681 6681
         '~(  \A [[:punct:]]*                # start of title...
6682 6682
                       |  [:.;?!][ ]+               # or of subsentence...
6683 6683
                       |  [ ][\'"“‘(\[][ ]* )       # or of inserted subphrase...
6684
-                      ( ' . $smallWordsRx . ' ) \b # ...followed by small word
6684
+                      ( ' . $smallWordsRx.' ) \b # ...followed by small word
6685 6685
                      ~uxi',
6686
-        function ($matches) use ($encoding) {
6687
-          return $matches[1] . static::str_upper_first($matches[2], $encoding);
6686
+        function($matches) use ($encoding) {
6687
+          return $matches[1].static::str_upper_first($matches[2], $encoding);
6688 6688
         },
6689 6689
         $str
6690 6690
     );
6691 6691
 
6692 6692
     // ...and end of title
6693 6693
     $str = (string)\preg_replace_callback(
6694
-        '~\b ( ' . $smallWordsRx . ' ) # small word...
6694
+        '~\b ( '.$smallWordsRx.' ) # small word...
6695 6695
                       (?= [[:punct:]]* \Z     # ...at the end of the title...
6696 6696
                       |   [\'"’”)\]] [ ] )    # ...or of an inserted subphrase?
6697 6697
                      ~uxi',
6698
-        function ($matches) use ($encoding) {
6698
+        function($matches) use ($encoding) {
6699 6699
           return static::str_upper_first($matches[1], $encoding);
6700 6700
         },
6701 6701
         $str
@@ -6706,10 +6706,10 @@  discard block
 block discarded – undo
6706 6706
     $str = (string)\preg_replace_callback(
6707 6707
         '~\b
6708 6708
                         (?<! -)                   # Negative lookbehind for a hyphen; we do not want to match man-in-the-middle but do want (in-flight)
6709
-                        ( ' . $smallWordsRx . ' )
6709
+                        ( ' . $smallWordsRx.' )
6710 6710
                         (?= -[[:alpha:]]+)        # lookahead for "-someword"
6711 6711
                        ~uxi',
6712
-        function ($matches) use ($encoding) {
6712
+        function($matches) use ($encoding) {
6713 6713
           return static::str_upper_first($matches[1], $encoding);
6714 6714
         },
6715 6715
         $str
@@ -6720,11 +6720,11 @@  discard block
 block discarded – undo
6720 6720
         '~\b
6721 6721
                       (?<!…)                    # Negative lookbehind for a hyphen; we do not want to match man-in-the-middle but do want (stand-in)
6722 6722
                       ( [[:alpha:]]+- )         # $1 = first word and hyphen, should already be properly capped
6723
-                      ( ' . $smallWordsRx . ' ) # ...followed by small word
6723
+                      ( ' . $smallWordsRx.' ) # ...followed by small word
6724 6724
                       (?!	- )                   # Negative lookahead for another -
6725 6725
                      ~uxi',
6726
-        function ($matches) use ($encoding) {
6727
-          return $matches[1] . static::str_upper_first($matches[2], $encoding);
6726
+        function($matches) use ($encoding) {
6727
+          return $matches[1].static::str_upper_first($matches[2], $encoding);
6728 6728
         },
6729 6729
         $str
6730 6730
     );
@@ -6874,7 +6874,7 @@  discard block
 block discarded – undo
6874 6874
 
6875 6875
     $truncated = self::substr($str, 0, $length, $encoding);
6876 6876
 
6877
-    return $truncated . $substring;
6877
+    return $truncated.$substring;
6878 6878
   }
6879 6879
 
6880 6880
   /**
@@ -6916,7 +6916,7 @@  discard block
 block discarded – undo
6916 6916
       }
6917 6917
     }
6918 6918
 
6919
-    $str = $truncated . $substring;
6919
+    $str = $truncated.$substring;
6920 6920
 
6921 6921
     return $str;
6922 6922
   }
@@ -7061,7 +7061,7 @@  discard block
 block discarded – undo
7061 7061
   public static function strcmp(string $str1, string $str2): int
7062 7062
   {
7063 7063
     /** @noinspection PhpUndefinedClassInspection */
7064
-    return $str1 . '' === $str2 . '' ? 0 : \strcmp(
7064
+    return $str1.'' === $str2.'' ? 0 : \strcmp(
7065 7065
         \Normalizer::normalize($str1, \Normalizer::NFD),
7066 7066
         \Normalizer::normalize($str2, \Normalizer::NFD)
7067 7067
     );
@@ -7095,7 +7095,7 @@  discard block
 block discarded – undo
7095 7095
       return null;
7096 7096
     }
7097 7097
 
7098
-    if (\preg_match('/^(.*?)' . self::rxClass($charList) . '/us', $str, $length)) {
7098
+    if (\preg_match('/^(.*?)'.self::rxClass($charList).'/us', $str, $length)) {
7099 7099
       return self::strlen($length[1]);
7100 7100
     }
7101 7101
 
@@ -7332,7 +7332,7 @@  discard block
 block discarded – undo
7332 7332
         &&
7333 7333
         self::$SUPPORT['mbstring'] === false
7334 7334
     ) {
7335
-      \trigger_error('UTF8::stristr() without mbstring cannot handle "' . $encoding . '" encoding', E_USER_WARNING);
7335
+      \trigger_error('UTF8::stristr() without mbstring cannot handle "'.$encoding.'" encoding', E_USER_WARNING);
7336 7336
     }
7337 7337
 
7338 7338
     if (self::$SUPPORT['mbstring'] === true) {
@@ -7354,7 +7354,7 @@  discard block
 block discarded – undo
7354 7354
       return \stristr($haystack, $needle, $before_needle);
7355 7355
     }
7356 7356
 
7357
-    \preg_match('/^(.*?)' . \preg_quote($needle, '/') . '/usi', $haystack, $match);
7357
+    \preg_match('/^(.*?)'.\preg_quote($needle, '/').'/usi', $haystack, $match);
7358 7358
 
7359 7359
     if (!isset($match[1])) {
7360 7360
       return false;
@@ -7413,7 +7413,7 @@  discard block
 block discarded – undo
7413 7413
         &&
7414 7414
         self::$SUPPORT['iconv'] === false
7415 7415
     ) {
7416
-      \trigger_error('UTF8::strlen() without mbstring / iconv cannot handle "' . $encoding . '" encoding', E_USER_WARNING);
7416
+      \trigger_error('UTF8::strlen() without mbstring / iconv cannot handle "'.$encoding.'" encoding', E_USER_WARNING);
7417 7417
     }
7418 7418
 
7419 7419
     if (
@@ -7530,7 +7530,7 @@  discard block
 block discarded – undo
7530 7530
    */
7531 7531
   public static function strnatcmp(string $str1, string $str2): int
7532 7532
   {
7533
-    return $str1 . '' === $str2 . '' ? 0 : \strnatcmp(self::strtonatfold($str1), self::strtonatfold($str2));
7533
+    return $str1.'' === $str2.'' ? 0 : \strnatcmp(self::strtonatfold($str1), self::strtonatfold($str2));
7534 7534
   }
7535 7535
 
7536 7536
   /**
@@ -7590,7 +7590,7 @@  discard block
 block discarded – undo
7590 7590
       return false;
7591 7591
     }
7592 7592
 
7593
-    if (\preg_match('/' . self::rxClass($char_list) . '/us', $haystack, $m)) {
7593
+    if (\preg_match('/'.self::rxClass($char_list).'/us', $haystack, $m)) {
7594 7594
       return \substr($haystack, (int)\strpos($haystack, $m[0]));
7595 7595
     }
7596 7596
 
@@ -7658,7 +7658,7 @@  discard block
 block discarded – undo
7658 7658
         &&
7659 7659
         self::$SUPPORT['mbstring'] === false
7660 7660
     ) {
7661
-      \trigger_error('UTF8::strpos() without mbstring / iconv cannot handle "' . $encoding . '" encoding', E_USER_WARNING);
7661
+      \trigger_error('UTF8::strpos() without mbstring / iconv cannot handle "'.$encoding.'" encoding', E_USER_WARNING);
7662 7662
     }
7663 7663
 
7664 7664
     if (
@@ -7791,7 +7791,7 @@  discard block
 block discarded – undo
7791 7791
         &&
7792 7792
         self::$SUPPORT['mbstring'] === false
7793 7793
     ) {
7794
-      \trigger_error('UTF8::strrchr() without mbstring cannot handle "' . $encoding . '" encoding', E_USER_WARNING);
7794
+      \trigger_error('UTF8::strrchr() without mbstring cannot handle "'.$encoding.'" encoding', E_USER_WARNING);
7795 7795
     }
7796 7796
 
7797 7797
     if (self::$SUPPORT['mbstring'] === true) {
@@ -7938,7 +7938,7 @@  discard block
 block discarded – undo
7938 7938
         &&
7939 7939
         self::$SUPPORT['mbstring'] === false
7940 7940
     ) {
7941
-      \trigger_error('UTF8::strripos() without mbstring cannot handle "' . $encoding . '" encoding', E_USER_WARNING);
7941
+      \trigger_error('UTF8::strripos() without mbstring cannot handle "'.$encoding.'" encoding', E_USER_WARNING);
7942 7942
     }
7943 7943
 
7944 7944
     if (self::$SUPPORT['mbstring'] === true) {
@@ -8029,7 +8029,7 @@  discard block
 block discarded – undo
8029 8029
         &&
8030 8030
         self::$SUPPORT['mbstring'] === false
8031 8031
     ) {
8032
-      \trigger_error('UTF8::strrpos() without mbstring cannot handle "' . $encoding . '" encoding', E_USER_WARNING);
8032
+      \trigger_error('UTF8::strrpos() without mbstring cannot handle "'.$encoding.'" encoding', E_USER_WARNING);
8033 8033
     }
8034 8034
 
8035 8035
     if (self::$SUPPORT['mbstring'] === true) {
@@ -8117,7 +8117,7 @@  discard block
 block discarded – undo
8117 8117
       return 0;
8118 8118
     }
8119 8119
 
8120
-    return \preg_match('/^' . self::rxClass($mask) . '+/u', $str, $str) ? self::strlen($str[0]) : 0;
8120
+    return \preg_match('/^'.self::rxClass($mask).'+/u', $str, $str) ? self::strlen($str[0]) : 0;
8121 8121
   }
8122 8122
 
8123 8123
   /**
@@ -8161,7 +8161,7 @@  discard block
 block discarded – undo
8161 8161
         &&
8162 8162
         self::$SUPPORT['mbstring'] === false
8163 8163
     ) {
8164
-      \trigger_error('UTF8::strstr() without mbstring cannot handle "' . $encoding . '" encoding', E_USER_WARNING);
8164
+      \trigger_error('UTF8::strstr() without mbstring cannot handle "'.$encoding.'" encoding', E_USER_WARNING);
8165 8165
     }
8166 8166
 
8167 8167
     if (self::$SUPPORT['mbstring'] === true) {
@@ -8179,7 +8179,7 @@  discard block
 block discarded – undo
8179 8179
       }
8180 8180
     }
8181 8181
 
8182
-    \preg_match('/^(.*?)' . \preg_quote($needle, '/') . '/us', $haystack, $match);
8182
+    \preg_match('/^(.*?)'.\preg_quote($needle, '/').'/us', $haystack, $match);
8183 8183
 
8184 8184
     if (!isset($match[1])) {
8185 8185
       return false;
@@ -8284,9 +8284,9 @@  discard block
 block discarded – undo
8284 8284
 
8285 8285
       if (self::$SUPPORT['intl'] === true) {
8286 8286
 
8287
-        $langCode = $lang . '-Lower';
8287
+        $langCode = $lang.'-Lower';
8288 8288
         if (!\in_array($langCode, self::$SUPPORT['intl__transliterator_list_ids'], true)) {
8289
-          \trigger_error('UTF8::strtolower() cannot handle special language: ' . $lang, E_USER_WARNING);
8289
+          \trigger_error('UTF8::strtolower() cannot handle special language: '.$lang, E_USER_WARNING);
8290 8290
 
8291 8291
           $langCode = 'Any-Lower';
8292 8292
         }
@@ -8295,7 +8295,7 @@  discard block
 block discarded – undo
8295 8295
         return transliterator_transliterate($langCode, $str);
8296 8296
       }
8297 8297
 
8298
-      \trigger_error('UTF8::strtolower() without intl cannot handle the "lang" parameter: ' . $lang, E_USER_WARNING);
8298
+      \trigger_error('UTF8::strtolower() without intl cannot handle the "lang" parameter: '.$lang, E_USER_WARNING);
8299 8299
     }
8300 8300
 
8301 8301
     // always fallback via symfony polyfill
@@ -8360,9 +8360,9 @@  discard block
 block discarded – undo
8360 8360
 
8361 8361
       if (self::$SUPPORT['intl'] === true) {
8362 8362
 
8363
-        $langCode = $lang . '-Upper';
8363
+        $langCode = $lang.'-Upper';
8364 8364
         if (!\in_array($langCode, self::$SUPPORT['intl__transliterator_list_ids'], true)) {
8365
-          \trigger_error('UTF8::strtoupper() without intl for special language: ' . $lang, E_USER_WARNING);
8365
+          \trigger_error('UTF8::strtoupper() without intl for special language: '.$lang, E_USER_WARNING);
8366 8366
 
8367 8367
           $langCode = 'Any-Upper';
8368 8368
         }
@@ -8371,7 +8371,7 @@  discard block
 block discarded – undo
8371 8371
         return transliterator_transliterate($langCode, $str);
8372 8372
       }
8373 8373
 
8374
-      \trigger_error('UTF8::strtolower() without intl + PHP >= 5.4 cannot handle the "lang"-parameter: ' . $lang, E_USER_WARNING);
8374
+      \trigger_error('UTF8::strtolower() without intl + PHP >= 5.4 cannot handle the "lang"-parameter: '.$lang, E_USER_WARNING);
8375 8375
     }
8376 8376
 
8377 8377
     // always fallback via symfony polyfill
@@ -8492,7 +8492,7 @@  discard block
 block discarded – undo
8492 8492
     }
8493 8493
 
8494 8494
     // e.g.: invalid chars + mbstring not installed
8495
-    if ($str_length === false ) {
8495
+    if ($str_length === false) {
8496 8496
       return false;
8497 8497
     }
8498 8498
 
@@ -8533,7 +8533,7 @@  discard block
 block discarded – undo
8533 8533
         &&
8534 8534
         self::$SUPPORT['mbstring'] === false
8535 8535
     ) {
8536
-      \trigger_error('UTF8::substr() without mbstring cannot handle "' . $encoding . '" encoding', E_USER_WARNING);
8536
+      \trigger_error('UTF8::substr() without mbstring cannot handle "'.$encoding.'" encoding', E_USER_WARNING);
8537 8537
     }
8538 8538
 
8539 8539
     if (self::$SUPPORT['mbstring'] === true) {
@@ -8709,14 +8709,14 @@  discard block
 block discarded – undo
8709 8709
         &&
8710 8710
         self::$SUPPORT['mbstring'] === false
8711 8711
     ) {
8712
-      \trigger_error('UTF8::substr_count() without mbstring cannot handle "' . $encoding . '" encoding', E_USER_WARNING);
8712
+      \trigger_error('UTF8::substr_count() without mbstring cannot handle "'.$encoding.'" encoding', E_USER_WARNING);
8713 8713
     }
8714 8714
 
8715 8715
     if (self::$SUPPORT['mbstring'] === true) {
8716 8716
       return \mb_substr_count($haystack, $needle, $encoding);
8717 8717
     }
8718 8718
 
8719
-    \preg_match_all('/' . \preg_quote($needle, '/') . '/us', $haystack, $matches, PREG_SET_ORDER);
8719
+    \preg_match_all('/'.\preg_quote($needle, '/').'/us', $haystack, $matches, PREG_SET_ORDER);
8720 8720
 
8721 8721
     return \count($matches);
8722 8722
   }
@@ -8938,8 +8938,7 @@  discard block
 block discarded – undo
8938 8938
 
8939 8939
     if (self::is_ascii($str)) {
8940 8940
       return ($length === null) ?
8941
-          \substr_replace($str, $replacement, $offset) :
8942
-          \substr_replace($str, $replacement, $offset, $length);
8941
+          \substr_replace($str, $replacement, $offset) : \substr_replace($str, $replacement, $offset, $length);
8943 8942
     }
8944 8943
 
8945 8944
     \preg_match_all('/./us', $str, $smatches);
@@ -9424,7 +9423,7 @@  discard block
 block discarded – undo
9424 9423
           $c2 = $i + 1 >= $max ? "\x00" : $str[$i + 1];
9425 9424
 
9426 9425
           if ($c2 >= "\x80" && $c2 <= "\xBF") { // yeah, almost sure it's UTF8 already
9427
-            $buf .= $c1 . $c2;
9426
+            $buf .= $c1.$c2;
9428 9427
             $i++;
9429 9428
           } else { // not valid UTF8 - convert it
9430 9429
             $buf .= self::to_utf8_convert_helper($c1);
@@ -9436,7 +9435,7 @@  discard block
 block discarded – undo
9436 9435
           $c3 = $i + 2 >= $max ? "\x00" : $str[$i + 2];
9437 9436
 
9438 9437
           if ($c2 >= "\x80" && $c2 <= "\xBF" && $c3 >= "\x80" && $c3 <= "\xBF") { // yeah, almost sure it's UTF8 already
9439
-            $buf .= $c1 . $c2 . $c3;
9438
+            $buf .= $c1.$c2.$c3;
9440 9439
             $i += 2;
9441 9440
           } else { // not valid UTF8 - convert it
9442 9441
             $buf .= self::to_utf8_convert_helper($c1);
@@ -9449,7 +9448,7 @@  discard block
 block discarded – undo
9449 9448
           $c4 = $i + 3 >= $max ? "\x00" : $str[$i + 3];
9450 9449
 
9451 9450
           if ($c2 >= "\x80" && $c2 <= "\xBF" && $c3 >= "\x80" && $c3 <= "\xBF" && $c4 >= "\x80" && $c4 <= "\xBF") { // yeah, almost sure it's UTF8 already
9452
-            $buf .= $c1 . $c2 . $c3 . $c4;
9451
+            $buf .= $c1.$c2.$c3.$c4;
9453 9452
             $i += 3;
9454 9453
           } else { // not valid UTF8 - convert it
9455 9454
             $buf .= self::to_utf8_convert_helper($c1);
@@ -9471,7 +9470,7 @@  discard block
 block discarded – undo
9471 9470
     // decode unicode escape sequences
9472 9471
     $buf = \preg_replace_callback(
9473 9472
         '/\\\\u([0-9a-f]{4})/i',
9474
-        function ($match) {
9473
+        function($match) {
9475 9474
           // always fallback via symfony polyfill
9476 9475
           return \mb_convert_encoding(pack('H*', $match[1]), 'UTF-8', 'UCS-2BE');
9477 9476
         },
@@ -9514,7 +9513,7 @@  discard block
 block discarded – undo
9514 9513
     } else {
9515 9514
       $cc1 = self::$CHR[$ordC1 / 64] | "\xC0";
9516 9515
       $cc2 = ((string)$input & "\x3F") | "\x80";
9517
-      $buf .= $cc1 . $cc2;
9516
+      $buf .= $cc1.$cc2;
9518 9517
     }
9519 9518
 
9520 9519
     return $buf;
@@ -9578,7 +9577,7 @@  discard block
 block discarded – undo
9578 9577
         $cleanUtf8
9579 9578
     );
9580 9579
 
9581
-    return $strPartOne . $strPartTwo;
9580
+    return $strPartOne.$strPartTwo;
9582 9581
   }
9583 9582
 
9584 9583
   /**
@@ -9623,7 +9622,7 @@  discard block
 block discarded – undo
9623 9622
       $str = self::clean($str);
9624 9623
     }
9625 9624
 
9626
-    $usePhpDefaultFunctions = !(bool)($charlist . \implode('', $exceptions));
9625
+    $usePhpDefaultFunctions = !(bool)($charlist.\implode('', $exceptions));
9627 9626
 
9628 9627
     if (
9629 9628
         $usePhpDefaultFunctions === true
@@ -10127,7 +10126,7 @@  discard block
 block discarded – undo
10127 10126
       return '';
10128 10127
     }
10129 10128
 
10130
-    \preg_match('/^\s*+(?:\S++\s*+){1,' . $limit . '}/u', $str, $matches);
10129
+    \preg_match('/^\s*+(?:\S++\s*+){1,'.$limit.'}/u', $str, $matches);
10131 10130
 
10132 10131
     if (
10133 10132
         !isset($matches[0])
@@ -10137,7 +10136,7 @@  discard block
 block discarded – undo
10137 10136
       return $str;
10138 10137
     }
10139 10138
 
10140
-    return self::rtrim($matches[0]) . $strAddOn;
10139
+    return self::rtrim($matches[0]).$strAddOn;
10141 10140
   }
10142 10141
 
10143 10142
   /**
@@ -10208,7 +10207,7 @@  discard block
 block discarded – undo
10208 10207
       $strReturn .= $break;
10209 10208
     }
10210 10209
 
10211
-    return $strReturn . \implode('', $chars);
10210
+    return $strReturn.\implode('', $chars);
10212 10211
   }
10213 10212
 
10214 10213
   /**
Please login to merge, or discard this patch.