Passed
Push — master ( ab26c7...dd0550 )
by Lars
03:42
created
src/voku/helper/UTF8.php 1 patch
Spacing   +122 added lines, -123 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
   /**
@@ -1111,7 +1111,7 @@  discard block
 block discarded – undo
1111 1111
         &&
1112 1112
         self::$SUPPORT['mbstring'] === false
1113 1113
     ) {
1114
-      \trigger_error('UTF8::encode() without mbstring cannot handle "' . $toEncoding . '" encoding', E_USER_WARNING);
1114
+      \trigger_error('UTF8::encode() without mbstring cannot handle "'.$toEncoding.'" encoding', E_USER_WARNING);
1115 1115
     }
1116 1116
 
1117 1117
     if (!isset(self::$SUPPORT['already_checked_via_portable_utf8'])) {
@@ -1227,7 +1227,7 @@  discard block
 block discarded – undo
1227 1227
           return '';
1228 1228
         }
1229 1229
 
1230
-        return \rtrim($strSub, $trimChars) . $replacerForSkippedText;
1230
+        return \rtrim($strSub, $trimChars).$replacerForSkippedText;
1231 1231
       }
1232 1232
 
1233 1233
       return $str;
@@ -1263,14 +1263,14 @@  discard block
 block discarded – undo
1263 1263
       if (!$pos_end || $pos_end <= 0) {
1264 1264
         $strSub = self::substr($str, $pos_start, self::strlen($str), $encoding);
1265 1265
         if ($strSub !== false) {
1266
-          $extract = $replacerForSkippedText . \ltrim($strSub, $trimChars);
1266
+          $extract = $replacerForSkippedText.\ltrim($strSub, $trimChars);
1267 1267
         } else {
1268 1268
           $extract = '';
1269 1269
         }
1270 1270
       } else {
1271 1271
         $strSub = self::substr($str, $pos_start, $pos_end, $encoding);
1272 1272
         if ($strSub !== false) {
1273
-          $extract = $replacerForSkippedText . \trim($strSub, $trimChars) . $replacerForSkippedText;
1273
+          $extract = $replacerForSkippedText.\trim($strSub, $trimChars).$replacerForSkippedText;
1274 1274
         } else {
1275 1275
           $extract = '';
1276 1276
         }
@@ -1293,7 +1293,7 @@  discard block
 block discarded – undo
1293 1293
       if ($pos_end) {
1294 1294
         $strSub = self::substr($str, 0, $pos_end, $encoding);
1295 1295
         if ($strSub !== false) {
1296
-          $extract = \rtrim($strSub, $trimChars) . $replacerForSkippedText;
1296
+          $extract = \rtrim($strSub, $trimChars).$replacerForSkippedText;
1297 1297
         } else {
1298 1298
           $extract = '';
1299 1299
         }
@@ -1415,7 +1415,7 @@  discard block
 block discarded – undo
1415 1415
   {
1416 1416
     $file_content = \file_get_contents($file_path);
1417 1417
     if ($file_content === false) {
1418
-      throw new \RuntimeException('file_get_contents() returned false for:' . $file_path);
1418
+      throw new \RuntimeException('file_get_contents() returned false for:'.$file_path);
1419 1419
     }
1420 1420
 
1421 1421
     return self::string_has_bom($file_content);
@@ -1475,7 +1475,7 @@  discard block
 block discarded – undo
1475 1475
           ) {
1476 1476
             // Prevent leading combining chars
1477 1477
             // for NFC-safe concatenations.
1478
-            $var = $leading_combining . $var;
1478
+            $var = $leading_combining.$var;
1479 1479
           }
1480 1480
         }
1481 1481
 
@@ -1970,7 +1970,7 @@  discard block
 block discarded – undo
1970 1970
    */
1971 1971
   private static function getData(string $file)
1972 1972
   {
1973
-    $file = __DIR__ . '/data/' . $file . '.php';
1973
+    $file = __DIR__.'/data/'.$file.'.php';
1974 1974
     if (\file_exists($file)) {
1975 1975
       /** @noinspection PhpIncludeInspection */
1976 1976
       return require $file;
@@ -2023,7 +2023,7 @@  discard block
 block discarded – undo
2023 2023
     }
2024 2024
 
2025 2025
     $str_info = \unpack('C2chars', $str_info);
2026
-    $type_code = (int)($str_info['chars1'] . $str_info['chars2']);
2026
+    $type_code = (int)($str_info['chars1'].$str_info['chars2']);
2027 2027
 
2028 2028
     // DEBUG
2029 2029
     //var_dump($type_code);
@@ -2116,16 +2116,16 @@  discard block
 block discarded – undo
2116 2116
    */
2117 2117
   public static function get_unique_string($entropyExtra = '', bool $md5 = true): string
2118 2118
   {
2119
-    $uniqueHelper = \mt_rand() .
2120
-                    \session_id() .
2121
-                    ($_SERVER['REMOTE_ADDR'] ?? '') .
2122
-                    ($_SERVER['SERVER_ADDR'] ?? '') .
2119
+    $uniqueHelper = \mt_rand().
2120
+                    \session_id().
2121
+                    ($_SERVER['REMOTE_ADDR'] ?? '').
2122
+                    ($_SERVER['SERVER_ADDR'] ?? '').
2123 2123
                     $entropyExtra;
2124 2124
 
2125 2125
     $uniqueString = \uniqid($uniqueHelper, true);
2126 2126
 
2127 2127
     if ($md5) {
2128
-      $uniqueString = \md5($uniqueString . $uniqueHelper);
2128
+      $uniqueString = \md5($uniqueString.$uniqueHelper);
2129 2129
     }
2130 2130
 
2131 2131
     return $uniqueString;
@@ -2270,7 +2270,7 @@  discard block
 block discarded – undo
2270 2270
     return \implode(
2271 2271
         '',
2272 2272
         \array_map(
2273
-            function ($chr) use ($keepAsciiChars, $encoding) {
2273
+            function($chr) use ($keepAsciiChars, $encoding) {
2274 2274
               return UTF8::single_chr_html_encode($chr, $keepAsciiChars, $encoding);
2275 2275
             },
2276 2276
             self::split($str)
@@ -2386,7 +2386,7 @@  discard block
 block discarded – undo
2386 2386
         &&
2387 2387
         self::$SUPPORT['mbstring'] === false
2388 2388
     ) {
2389
-      \trigger_error('UTF8::html_entity_decode() without mbstring cannot handle "' . $encoding . '" encoding', E_USER_WARNING);
2389
+      \trigger_error('UTF8::html_entity_decode() without mbstring cannot handle "'.$encoding.'" encoding', E_USER_WARNING);
2390 2390
     }
2391 2391
 
2392 2392
     if (!isset(self::$SUPPORT['already_checked_via_portable_utf8'])) {
@@ -2409,7 +2409,7 @@  discard block
 block discarded – undo
2409 2409
 
2410 2410
         $str = (string)\preg_replace_callback(
2411 2411
             "/&#\d{2,6};/",
2412
-            function ($matches) use ($encoding) {
2412
+            function($matches) use ($encoding) {
2413 2413
               // always fallback via symfony polyfill
2414 2414
               $returnTmp = \mb_convert_encoding($matches[0], $encoding, 'HTML-ENTITIES');
2415 2415
 
@@ -2752,9 +2752,9 @@  discard block
 block discarded – undo
2752 2752
   {
2753 2753
     $hex = \dechex($int);
2754 2754
 
2755
-    $hex = (\strlen($hex) < 4 ? \substr('0000' . $hex, -4) : $hex);
2755
+    $hex = (\strlen($hex) < 4 ? \substr('0000'.$hex, -4) : $hex);
2756 2756
 
2757
-    return $pfix . $hex . '';
2757
+    return $pfix.$hex.'';
2758 2758
   }
2759 2759
 
2760 2760
   /**
@@ -3691,7 +3691,7 @@  discard block
 block discarded – undo
3691 3691
         $cleanUtf8
3692 3692
     );
3693 3693
 
3694
-    return $strPartOne . $strPartTwo;
3694
+    return $strPartOne.$strPartTwo;
3695 3695
   }
3696 3696
 
3697 3697
   /**
@@ -4174,7 +4174,7 @@  discard block
 block discarded – undo
4174 4174
       }
4175 4175
     }
4176 4176
 
4177
-    $cacheKey = $chr_orig . $encoding;
4177
+    $cacheKey = $chr_orig.$encoding;
4178 4178
     if (isset($CHAR_CACHE[$cacheKey]) === true) {
4179 4179
       return $CHAR_CACHE[$cacheKey];
4180 4180
     }
@@ -4427,7 +4427,7 @@  discard block
 block discarded – undo
4427 4427
     }
4428 4428
 
4429 4429
     $str = (string)\preg_replace(
4430
-        $delimiter . $pattern . $delimiter . 'u' . $options,
4430
+        $delimiter.$pattern.$delimiter.'u'.$options,
4431 4431
         $replacement,
4432 4432
         $str
4433 4433
     );
@@ -4498,7 +4498,7 @@  discard block
 block discarded – undo
4498 4498
     if (\is_array($what) === true) {
4499 4499
       /** @noinspection ForeachSourceInspection */
4500 4500
       foreach ($what as $item) {
4501
-        $str = (string)\preg_replace('/(' . \preg_quote($item, '/') . ')+/', $item, $str);
4501
+        $str = (string)\preg_replace('/('.\preg_quote($item, '/').')+/', $item, $str);
4502 4502
       }
4503 4503
     }
4504 4504
 
@@ -4746,7 +4746,7 @@  discard block
 block discarded – undo
4746 4746
   {
4747 4747
     static $RX_CLASSS_CACHE = [];
4748 4748
 
4749
-    $cacheKey = $s . $class;
4749
+    $cacheKey = $s.$class;
4750 4750
 
4751 4751
     if (isset($RX_CLASSS_CACHE[$cacheKey])) {
4752 4752
       return $RX_CLASSS_CACHE[$cacheKey];
@@ -4758,7 +4758,7 @@  discard block
 block discarded – undo
4758 4758
     /** @noinspection SuspiciousLoopInspection */
4759 4759
     foreach (self::str_split($s) as $s) {
4760 4760
       if ('-' === $s) {
4761
-        $class[0] = '-' . $class[0];
4761
+        $class[0] = '-'.$class[0];
4762 4762
       } elseif (!isset($s[2])) {
4763 4763
         $class[0] .= \preg_quote($s, '/');
4764 4764
       } elseif (1 === self::strlen($s)) {
@@ -4769,13 +4769,13 @@  discard block
 block discarded – undo
4769 4769
     }
4770 4770
 
4771 4771
     if ($class[0]) {
4772
-      $class[0] = '[' . $class[0] . ']';
4772
+      $class[0] = '['.$class[0].']';
4773 4773
     }
4774 4774
 
4775 4775
     if (1 === \count($class)) {
4776 4776
       $return = $class[0];
4777 4777
     } else {
4778
-      $return = '(?:' . \implode('|', $class) . ')';
4778
+      $return = '(?:'.\implode('|', $class).')';
4779 4779
     }
4780 4780
 
4781 4781
     $RX_CLASSS_CACHE[$cacheKey] = $return;
@@ -4794,7 +4794,7 @@  discard block
 block discarded – undo
4794 4794
 
4795 4795
     echo '<pre>';
4796 4796
     foreach (self::$SUPPORT as $key => $value) {
4797
-      echo $key . ' - ' . \print_r($value, true) . "\n<br>";
4797
+      echo $key.' - '.\print_r($value, true)."\n<br>";
4798 4798
     }
4799 4799
     echo '</pre>';
4800 4800
   }
@@ -4826,7 +4826,7 @@  discard block
 block discarded – undo
4826 4826
       $encoding = self::normalize_encoding($encoding, 'UTF-8');
4827 4827
     }
4828 4828
 
4829
-    return '&#' . self::ord($char, $encoding) . ';';
4829
+    return '&#'.self::ord($char, $encoding).';';
4830 4830
   }
4831 4831
 
4832 4832
   /**
@@ -4913,7 +4913,7 @@  discard block
 block discarded – undo
4913 4913
         ) {
4914 4914
 
4915 4915
           if (($str[$i + 1] & "\xC0") === "\x80") {
4916
-            $ret[] = $str[$i] . $str[$i + 1];
4916
+            $ret[] = $str[$i].$str[$i + 1];
4917 4917
 
4918 4918
             $i++;
4919 4919
           }
@@ -4929,7 +4929,7 @@  discard block
 block discarded – undo
4929 4929
               &&
4930 4930
               ($str[$i + 2] & "\xC0") === "\x80"
4931 4931
           ) {
4932
-            $ret[] = $str[$i] . $str[$i + 1] . $str[$i + 2];
4932
+            $ret[] = $str[$i].$str[$i + 1].$str[$i + 2];
4933 4933
 
4934 4934
             $i += 2;
4935 4935
           }
@@ -4947,7 +4947,7 @@  discard block
 block discarded – undo
4947 4947
               &&
4948 4948
               ($str[$i + 3] & "\xC0") === "\x80"
4949 4949
           ) {
4950
-            $ret[] = $str[$i] . $str[$i + 1] . $str[$i + 2] . $str[$i + 3];
4950
+            $ret[] = $str[$i].$str[$i + 1].$str[$i + 2].$str[$i + 3];
4951 4951
 
4952 4952
             $i += 3;
4953 4953
           }
@@ -4960,7 +4960,7 @@  discard block
 block discarded – undo
4960 4960
       $ret = \array_chunk($ret, $length);
4961 4961
 
4962 4962
       return \array_map(
4963
-          function ($item) {
4963
+          function($item) {
4964 4964
             return \implode('', $item);
4965 4965
           }, $ret
4966 4966
       );
@@ -4990,7 +4990,7 @@  discard block
 block discarded – undo
4990 4990
 
4991 4991
     $str = (string)\preg_replace_callback(
4992 4992
         '/[-_\s]+(.)?/u',
4993
-        function ($match) use ($encoding) {
4993
+        function($match) use ($encoding) {
4994 4994
           if (isset($match[1])) {
4995 4995
             return UTF8::strtoupper($match[1], $encoding);
4996 4996
           }
@@ -5002,7 +5002,7 @@  discard block
 block discarded – undo
5002 5002
 
5003 5003
     $str = (string)\preg_replace_callback(
5004 5004
         '/[\d]+(.)?/u',
5005
-        function ($match) use ($encoding) {
5005
+        function($match) use ($encoding) {
5006 5006
           return UTF8::strtoupper($match[0], $encoding);
5007 5007
         },
5008 5008
         $str
@@ -5369,7 +5369,7 @@  discard block
 block discarded – undo
5369 5369
     foreach (self::$ENCODINGS as $encodingTmp) {
5370 5370
       # INFO: //IGNORE but still throw notice
5371 5371
       /** @noinspection PhpUsageOfSilenceOperatorInspection */
5372
-      if ((string)@\iconv($encodingTmp, $encodingTmp . '//IGNORE', $str) === $str) {
5372
+      if ((string)@\iconv($encodingTmp, $encodingTmp.'//IGNORE', $str) === $str) {
5373 5373
         return $encodingTmp;
5374 5374
       }
5375 5375
     }
@@ -5431,7 +5431,7 @@  discard block
 block discarded – undo
5431 5431
   public static function str_ensure_left(string $str, string $substring): string
5432 5432
   {
5433 5433
     if (!self::str_starts_with($str, $substring)) {
5434
-      $str = $substring . $str;
5434
+      $str = $substring.$str;
5435 5435
     }
5436 5436
 
5437 5437
     return $str;
@@ -5640,7 +5640,7 @@  discard block
 block discarded – undo
5640 5640
     $start = self::substr($str, 0, $index, $encoding);
5641 5641
     $end = self::substr($str, $index, $len, $encoding);
5642 5642
 
5643
-    return $start . $substring . $end;
5643
+    return $start.$substring.$end;
5644 5644
   }
5645 5645
 
5646 5646
   /**
@@ -5677,7 +5677,7 @@  discard block
 block discarded – undo
5677 5677
       if ('' === $s .= '') {
5678 5678
         $s = '/^(?<=.)$/';
5679 5679
       } else {
5680
-        $s = '/' . \preg_quote($s, '/') . '/ui';
5680
+        $s = '/'.\preg_quote($s, '/').'/ui';
5681 5681
       }
5682 5682
     }
5683 5683
 
@@ -5960,7 +5960,7 @@  discard block
 block discarded – undo
5960 5960
       return $str;
5961 5961
     }
5962 5962
 
5963
-    return self::substr($str, 0, $length - self::strlen($strAddOn), $encoding) . $strAddOn;
5963
+    return self::substr($str, 0, $length - self::strlen($strAddOn), $encoding).$strAddOn;
5964 5964
   }
5965 5965
 
5966 5966
   /**
@@ -5988,7 +5988,7 @@  discard block
 block discarded – undo
5988 5988
     }
5989 5989
 
5990 5990
     if (self::substr($str, $length - 1, 1, $encoding) === ' ') {
5991
-      return self::substr($str, 0, $length - 1, $encoding) . $strAddOn;
5991
+      return self::substr($str, 0, $length - 1, $encoding).$strAddOn;
5992 5992
     }
5993 5993
 
5994 5994
     $str = (string)self::substr($str, 0, $length, $encoding);
@@ -5997,9 +5997,9 @@  discard block
 block discarded – undo
5997 5997
     $new_str = \implode(' ', $array);
5998 5998
 
5999 5999
     if ($new_str === '') {
6000
-      $str = self::substr($str, 0, $length - 1, $encoding) . $strAddOn;
6000
+      $str = self::substr($str, 0, $length - 1, $encoding).$strAddOn;
6001 6001
     } else {
6002
-      $str = $new_str . $strAddOn;
6002
+      $str = $new_str.$strAddOn;
6003 6003
     }
6004 6004
 
6005 6005
     return $str;
@@ -6102,7 +6102,7 @@  discard block
 block discarded – undo
6102 6102
       $char = self::substr($str, -$i, 1, $encoding);
6103 6103
 
6104 6104
       if ($char == self::substr($otherStr, -$i, 1, $encoding)) {
6105
-        $longestCommonSuffix = $char . $longestCommonSuffix;
6105
+        $longestCommonSuffix = $char.$longestCommonSuffix;
6106 6106
       } else {
6107 6107
         break;
6108 6108
       }
@@ -6121,7 +6121,7 @@  discard block
 block discarded – undo
6121 6121
    */
6122 6122
   public static function str_matches_pattern(string $str, string $pattern): bool
6123 6123
   {
6124
-    if (\preg_match('/' . $pattern . '/u', $str)) {
6124
+    if (\preg_match('/'.$pattern.'/u', $str)) {
6125 6125
       return true;
6126 6126
     }
6127 6127
 
@@ -6211,7 +6211,7 @@  discard block
 block discarded – undo
6211 6211
         $pad_type = STR_PAD_BOTH;
6212 6212
       } else {
6213 6213
         throw new \InvalidArgumentException(
6214
-            'Pad expects $padType to be "STR_PAD_*" or ' . "to be one of 'left', 'right' or 'both'"
6214
+            'Pad expects $padType to be "STR_PAD_*" or '."to be one of 'left', 'right' or 'both'"
6215 6215
         );
6216 6216
       }
6217 6217
     }
@@ -6248,7 +6248,7 @@  discard block
 block discarded – undo
6248 6248
           $pre = '';
6249 6249
       }
6250 6250
 
6251
-      return $pre . $str . $post;
6251
+      return $pre.$str.$post;
6252 6252
     }
6253 6253
 
6254 6254
     return $str;
@@ -6376,7 +6376,7 @@  discard block
 block discarded – undo
6376 6376
   {
6377 6377
     return self::regex_replace(
6378 6378
         $str,
6379
-        '^' . \preg_quote($search, '/'),
6379
+        '^'.\preg_quote($search, '/'),
6380 6380
         self::str_replace('\\', '\\\\', $replacement)
6381 6381
     );
6382 6382
   }
@@ -6394,7 +6394,7 @@  discard block
 block discarded – undo
6394 6394
   {
6395 6395
     return self::regex_replace(
6396 6396
         $str,
6397
-        \preg_quote($search, '/') . '$',
6397
+        \preg_quote($search, '/').'$',
6398 6398
         self::str_replace('\\', '\\\\', $replacement)
6399 6399
     );
6400 6400
   }
@@ -6505,24 +6505,24 @@  discard block
 block discarded – undo
6505 6505
 
6506 6506
     $str = (string)\preg_replace_callback(
6507 6507
         '/([\d|A-Z])/u',
6508
-        function ($matches) use ($encoding) {
6508
+        function($matches) use ($encoding) {
6509 6509
           $match = $matches[1];
6510 6510
           $matchInt = (int)$match;
6511 6511
 
6512 6512
           if ((string)$matchInt == $match) {
6513
-            return '_' . $match . '_';
6513
+            return '_'.$match.'_';
6514 6514
           }
6515 6515
 
6516
-          return '_' . UTF8::strtolower($match, $encoding);
6516
+          return '_'.UTF8::strtolower($match, $encoding);
6517 6517
         },
6518 6518
         $str
6519 6519
     );
6520 6520
 
6521 6521
     $str = (string)\preg_replace(
6522 6522
         [
6523
-            '/\s+/',        // convert spaces to "_"
6524
-            '/^\s+|\s+$/',  // trim leading & trailing spaces
6525
-            '/_+/',         // remove double "_"
6523
+            '/\s+/', // convert spaces to "_"
6524
+            '/^\s+|\s+$/', // trim leading & trailing spaces
6525
+            '/_+/', // remove double "_"
6526 6526
         ],
6527 6527
         [
6528 6528
             '_',
@@ -6610,7 +6610,7 @@  discard block
 block discarded – undo
6610 6610
       $limit = -1;
6611 6611
     }
6612 6612
 
6613
-    $array = \preg_split('/' . \preg_quote($pattern, '/') . '/u', $str, $limit);
6613
+    $array = \preg_split('/'.\preg_quote($pattern, '/').'/u', $str, $limit);
6614 6614
 
6615 6615
     if ($array === false) {
6616 6616
       return [];
@@ -6892,7 +6892,7 @@  discard block
 block discarded – undo
6892 6892
 
6893 6893
     $str = (string)\preg_replace_callback(
6894 6894
         '/([\S]+)/u',
6895
-        function ($match) use ($encoding, $ignore) {
6895
+        function($match) use ($encoding, $ignore) {
6896 6896
           if ($ignore && \in_array($match[0], $ignore, true)) {
6897 6897
             return $match[0];
6898 6898
           }
@@ -6961,16 +6961,16 @@  discard block
 block discarded – undo
6961 6961
     $str = (string)\preg_replace_callback(
6962 6962
         '~\b (_*) (?:                                                              # 1. Leading underscore and
6963 6963
                         ( (?<=[ ][/\\\\]) [[:alpha:]]+ [-_[:alpha:]/\\\\]+ |              # 2. file path or 
6964
-                          [-_[:alpha:]]+ [@.:] [-_[:alpha:]@.:/]+ ' . $apostropheRx . ' ) #    URL, domain, or email
6964
+                          [-_[:alpha:]]+ [@.:] [-_[:alpha:]@.:/]+ ' . $apostropheRx.' ) #    URL, domain, or email
6965 6965
                         |
6966
-                        ( (?i: ' . $smallWordsRx . ' ) ' . $apostropheRx . ' )            # 3. or small word (case-insensitive)
6966
+                        ( (?i: ' . $smallWordsRx.' ) '.$apostropheRx.' )            # 3. or small word (case-insensitive)
6967 6967
                         |
6968
-                        ( [[:alpha:]] [[:lower:]\'’()\[\]{}]* ' . $apostropheRx . ' )     # 4. or word w/o internal caps
6968
+                        ( [[:alpha:]] [[:lower:]\'’()\[\]{}]* ' . $apostropheRx.' )     # 4. or word w/o internal caps
6969 6969
                         |
6970
-                        ( [[:alpha:]] [[:alpha:]\'’()\[\]{}]* ' . $apostropheRx . ' )     # 5. or some other word
6970
+                        ( [[:alpha:]] [[:alpha:]\'’()\[\]{}]* ' . $apostropheRx.' )     # 5. or some other word
6971 6971
                       ) (_*) \b                                                           # 6. With trailing underscore
6972 6972
                     ~ux',
6973
-        function ($matches) use ($encoding) {
6973
+        function($matches) use ($encoding) {
6974 6974
           // Preserve leading underscore
6975 6975
           $str = $matches[1];
6976 6976
           if ($matches[2]) {
@@ -6999,21 +6999,21 @@  discard block
 block discarded – undo
6999 6999
         '~(  \A [[:punct:]]*                # start of title...
7000 7000
                       |  [:.;?!][ ]+               # or of subsentence...
7001 7001
                       |  [ ][\'"“‘(\[][ ]* )       # or of inserted subphrase...
7002
-                      ( ' . $smallWordsRx . ' ) \b # ...followed by small word
7002
+                      ( ' . $smallWordsRx.' ) \b # ...followed by small word
7003 7003
                      ~uxi',
7004
-        function ($matches) use ($encoding) {
7005
-          return $matches[1] . static::str_upper_first($matches[2], $encoding);
7004
+        function($matches) use ($encoding) {
7005
+          return $matches[1].static::str_upper_first($matches[2], $encoding);
7006 7006
         },
7007 7007
         $str
7008 7008
     );
7009 7009
 
7010 7010
     // ...and end of title
7011 7011
     $str = (string)\preg_replace_callback(
7012
-        '~\b ( ' . $smallWordsRx . ' ) # small word...
7012
+        '~\b ( '.$smallWordsRx.' ) # small word...
7013 7013
                       (?= [[:punct:]]* \Z     # ...at the end of the title...
7014 7014
                       |   [\'"’”)\]] [ ] )    # ...or of an inserted subphrase?
7015 7015
                      ~uxi',
7016
-        function ($matches) use ($encoding) {
7016
+        function($matches) use ($encoding) {
7017 7017
           return static::str_upper_first($matches[1], $encoding);
7018 7018
         },
7019 7019
         $str
@@ -7024,10 +7024,10 @@  discard block
 block discarded – undo
7024 7024
     $str = (string)\preg_replace_callback(
7025 7025
         '~\b
7026 7026
                         (?<! -)                   # Negative lookbehind for a hyphen; we do not want to match man-in-the-middle but do want (in-flight)
7027
-                        ( ' . $smallWordsRx . ' )
7027
+                        ( ' . $smallWordsRx.' )
7028 7028
                         (?= -[[:alpha:]]+)        # lookahead for "-someword"
7029 7029
                        ~uxi',
7030
-        function ($matches) use ($encoding) {
7030
+        function($matches) use ($encoding) {
7031 7031
           return static::str_upper_first($matches[1], $encoding);
7032 7032
         },
7033 7033
         $str
@@ -7038,11 +7038,11 @@  discard block
 block discarded – undo
7038 7038
         '~\b
7039 7039
                       (?<!…)                    # Negative lookbehind for a hyphen; we do not want to match man-in-the-middle but do want (stand-in)
7040 7040
                       ( [[:alpha:]]+- )         # $1 = first word and hyphen, should already be properly capped
7041
-                      ( ' . $smallWordsRx . ' ) # ...followed by small word
7041
+                      ( ' . $smallWordsRx.' ) # ...followed by small word
7042 7042
                       (?!	- )                   # Negative lookahead for another -
7043 7043
                      ~uxi',
7044
-        function ($matches) use ($encoding) {
7045
-          return $matches[1] . static::str_upper_first($matches[2], $encoding);
7044
+        function($matches) use ($encoding) {
7045
+          return $matches[1].static::str_upper_first($matches[2], $encoding);
7046 7046
         },
7047 7047
         $str
7048 7048
     );
@@ -7192,7 +7192,7 @@  discard block
 block discarded – undo
7192 7192
 
7193 7193
     $truncated = self::substr($str, 0, $length, $encoding);
7194 7194
 
7195
-    return $truncated . $substring;
7195
+    return $truncated.$substring;
7196 7196
   }
7197 7197
 
7198 7198
   /**
@@ -7234,7 +7234,7 @@  discard block
 block discarded – undo
7234 7234
       }
7235 7235
     }
7236 7236
 
7237
-    $str = $truncated . $substring;
7237
+    $str = $truncated.$substring;
7238 7238
 
7239 7239
     return $str;
7240 7240
   }
@@ -7383,7 +7383,7 @@  discard block
 block discarded – undo
7383 7383
   public static function strcmp(string $str1, string $str2): int
7384 7384
   {
7385 7385
     /** @noinspection PhpUndefinedClassInspection */
7386
-    return $str1 . '' === $str2 . '' ? 0 : \strcmp(
7386
+    return $str1.'' === $str2.'' ? 0 : \strcmp(
7387 7387
         \Normalizer::normalize($str1, \Normalizer::NFD),
7388 7388
         \Normalizer::normalize($str2, \Normalizer::NFD)
7389 7389
     );
@@ -7417,7 +7417,7 @@  discard block
 block discarded – undo
7417 7417
       return null;
7418 7418
     }
7419 7419
 
7420
-    if (\preg_match('/^(.*?)' . self::rxClass($charList) . '/us', $str, $length)) {
7420
+    if (\preg_match('/^(.*?)'.self::rxClass($charList).'/us', $str, $length)) {
7421 7421
       return self::strlen($length[1]);
7422 7422
     }
7423 7423
 
@@ -7654,7 +7654,7 @@  discard block
 block discarded – undo
7654 7654
         &&
7655 7655
         self::$SUPPORT['mbstring'] === false
7656 7656
     ) {
7657
-      \trigger_error('UTF8::stristr() without mbstring cannot handle "' . $encoding . '" encoding', E_USER_WARNING);
7657
+      \trigger_error('UTF8::stristr() without mbstring cannot handle "'.$encoding.'" encoding', E_USER_WARNING);
7658 7658
     }
7659 7659
 
7660 7660
     if (self::$SUPPORT['mbstring'] === true) {
@@ -7676,7 +7676,7 @@  discard block
 block discarded – undo
7676 7676
       return \stristr($haystack, $needle, $before_needle);
7677 7677
     }
7678 7678
 
7679
-    \preg_match('/^(.*?)' . \preg_quote($needle, '/') . '/usi', $haystack, $match);
7679
+    \preg_match('/^(.*?)'.\preg_quote($needle, '/').'/usi', $haystack, $match);
7680 7680
 
7681 7681
     if (!isset($match[1])) {
7682 7682
       return false;
@@ -7743,7 +7743,7 @@  discard block
 block discarded – undo
7743 7743
         &&
7744 7744
         self::$SUPPORT['iconv'] === false
7745 7745
     ) {
7746
-      \trigger_error('UTF8::strlen() without mbstring / iconv cannot handle "' . $encoding . '" encoding', E_USER_WARNING);
7746
+      \trigger_error('UTF8::strlen() without mbstring / iconv cannot handle "'.$encoding.'" encoding', E_USER_WARNING);
7747 7747
     }
7748 7748
 
7749 7749
     //
@@ -7869,7 +7869,7 @@  discard block
 block discarded – undo
7869 7869
    */
7870 7870
   public static function strnatcmp(string $str1, string $str2): int
7871 7871
   {
7872
-    return $str1 . '' === $str2 . '' ? 0 : \strnatcmp(self::strtonatfold($str1), self::strtonatfold($str2));
7872
+    return $str1.'' === $str2.'' ? 0 : \strnatcmp(self::strtonatfold($str1), self::strtonatfold($str2));
7873 7873
   }
7874 7874
 
7875 7875
   /**
@@ -7934,7 +7934,7 @@  discard block
 block discarded – undo
7934 7934
       return false;
7935 7935
     }
7936 7936
 
7937
-    if (\preg_match('/' . self::rxClass($char_list) . '/us', $haystack, $m)) {
7937
+    if (\preg_match('/'.self::rxClass($char_list).'/us', $haystack, $m)) {
7938 7938
       return \substr($haystack, (int)\strpos($haystack, $m[0]));
7939 7939
     }
7940 7940
 
@@ -8006,7 +8006,7 @@  discard block
 block discarded – undo
8006 8006
         &&
8007 8007
         self::$SUPPORT['mbstring'] === false
8008 8008
     ) {
8009
-      \trigger_error('UTF8::strpos() without mbstring / iconv cannot handle "' . $encoding . '" encoding', E_USER_WARNING);
8009
+      \trigger_error('UTF8::strpos() without mbstring / iconv cannot handle "'.$encoding.'" encoding', E_USER_WARNING);
8010 8010
     }
8011 8011
 
8012 8012
     //
@@ -8172,7 +8172,7 @@  discard block
 block discarded – undo
8172 8172
         &&
8173 8173
         self::$SUPPORT['mbstring'] === false
8174 8174
     ) {
8175
-      \trigger_error('UTF8::strrchr() without mbstring cannot handle "' . $encoding . '" encoding', E_USER_WARNING);
8175
+      \trigger_error('UTF8::strrchr() without mbstring cannot handle "'.$encoding.'" encoding', E_USER_WARNING);
8176 8176
     }
8177 8177
 
8178 8178
     if (self::$SUPPORT['mbstring'] === true) {
@@ -8393,7 +8393,7 @@  discard block
 block discarded – undo
8393 8393
         &&
8394 8394
         self::$SUPPORT['mbstring'] === false
8395 8395
     ) {
8396
-      \trigger_error('UTF8::strripos() without mbstring cannot handle "' . $encoding . '" encoding', E_USER_WARNING);
8396
+      \trigger_error('UTF8::strripos() without mbstring cannot handle "'.$encoding.'" encoding', E_USER_WARNING);
8397 8397
     }
8398 8398
 
8399 8399
     //
@@ -8540,7 +8540,7 @@  discard block
 block discarded – undo
8540 8540
         &&
8541 8541
         self::$SUPPORT['mbstring'] === false
8542 8542
     ) {
8543
-      \trigger_error('UTF8::strrpos() without mbstring cannot handle "' . $encoding . '" encoding', E_USER_WARNING);
8543
+      \trigger_error('UTF8::strrpos() without mbstring cannot handle "'.$encoding.'" encoding', E_USER_WARNING);
8544 8544
     }
8545 8545
 
8546 8546
     //
@@ -8671,7 +8671,7 @@  discard block
 block discarded – undo
8671 8671
       return 0;
8672 8672
     }
8673 8673
 
8674
-    return \preg_match('/^' . self::rxClass($mask) . '+/u', $str, $str) ? self::strlen($str[0]) : 0;
8674
+    return \preg_match('/^'.self::rxClass($mask).'+/u', $str, $str) ? self::strlen($str[0]) : 0;
8675 8675
   }
8676 8676
 
8677 8677
   /**
@@ -8727,7 +8727,7 @@  discard block
 block discarded – undo
8727 8727
         &&
8728 8728
         self::$SUPPORT['mbstring'] === false
8729 8729
     ) {
8730
-      \trigger_error('UTF8::strstr() without mbstring cannot handle "' . $encoding . '" encoding', E_USER_WARNING);
8730
+      \trigger_error('UTF8::strstr() without mbstring cannot handle "'.$encoding.'" encoding', E_USER_WARNING);
8731 8731
     }
8732 8732
 
8733 8733
     //
@@ -8765,7 +8765,7 @@  discard block
 block discarded – undo
8765 8765
     // fallback via vanilla php
8766 8766
     //
8767 8767
 
8768
-    \preg_match('/^(.*?)' . \preg_quote($needle, '/') . '/us', $haystack, $match);
8768
+    \preg_match('/^(.*?)'.\preg_quote($needle, '/').'/us', $haystack, $match);
8769 8769
 
8770 8770
     if (!isset($match[1])) {
8771 8771
       return false;
@@ -8903,9 +8903,9 @@  discard block
 block discarded – undo
8903 8903
 
8904 8904
       if (self::$SUPPORT['intl'] === true) {
8905 8905
 
8906
-        $langCode = $lang . '-Lower';
8906
+        $langCode = $lang.'-Lower';
8907 8907
         if (!\in_array($langCode, self::$SUPPORT['intl__transliterator_list_ids'], true)) {
8908
-          \trigger_error('UTF8::strtolower() cannot handle special language: ' . $lang, E_USER_WARNING);
8908
+          \trigger_error('UTF8::strtolower() cannot handle special language: '.$lang, E_USER_WARNING);
8909 8909
 
8910 8910
           $langCode = 'Any-Lower';
8911 8911
         }
@@ -8914,7 +8914,7 @@  discard block
 block discarded – undo
8914 8914
         return transliterator_transliterate($langCode, $str);
8915 8915
       }
8916 8916
 
8917
-      \trigger_error('UTF8::strtolower() without intl cannot handle the "lang" parameter: ' . $lang, E_USER_WARNING);
8917
+      \trigger_error('UTF8::strtolower() without intl cannot handle the "lang" parameter: '.$lang, E_USER_WARNING);
8918 8918
     }
8919 8919
 
8920 8920
     // always fallback via symfony polyfill
@@ -8979,9 +8979,9 @@  discard block
 block discarded – undo
8979 8979
 
8980 8980
       if (self::$SUPPORT['intl'] === true) {
8981 8981
 
8982
-        $langCode = $lang . '-Upper';
8982
+        $langCode = $lang.'-Upper';
8983 8983
         if (!\in_array($langCode, self::$SUPPORT['intl__transliterator_list_ids'], true)) {
8984
-          \trigger_error('UTF8::strtoupper() without intl for special language: ' . $lang, E_USER_WARNING);
8984
+          \trigger_error('UTF8::strtoupper() without intl for special language: '.$lang, E_USER_WARNING);
8985 8985
 
8986 8986
           $langCode = 'Any-Upper';
8987 8987
         }
@@ -8990,7 +8990,7 @@  discard block
 block discarded – undo
8990 8990
         return transliterator_transliterate($langCode, $str);
8991 8991
       }
8992 8992
 
8993
-      \trigger_error('UTF8::strtolower() without intl + PHP >= 5.4 cannot handle the "lang"-parameter: ' . $lang, E_USER_WARNING);
8993
+      \trigger_error('UTF8::strtolower() without intl + PHP >= 5.4 cannot handle the "lang"-parameter: '.$lang, E_USER_WARNING);
8994 8994
     }
8995 8995
 
8996 8996
     // always fallback via symfony polyfill
@@ -9197,7 +9197,7 @@  discard block
 block discarded – undo
9197 9197
         &&
9198 9198
         self::$SUPPORT['mbstring'] === false
9199 9199
     ) {
9200
-      \trigger_error('UTF8::substr() without mbstring cannot handle "' . $encoding . '" encoding', E_USER_WARNING);
9200
+      \trigger_error('UTF8::substr() without mbstring cannot handle "'.$encoding.'" encoding', E_USER_WARNING);
9201 9201
     }
9202 9202
 
9203 9203
     //
@@ -9377,14 +9377,14 @@  discard block
 block discarded – undo
9377 9377
         &&
9378 9378
         self::$SUPPORT['mbstring'] === false
9379 9379
     ) {
9380
-      \trigger_error('UTF8::substr_count() without mbstring cannot handle "' . $encoding . '" encoding', E_USER_WARNING);
9380
+      \trigger_error('UTF8::substr_count() without mbstring cannot handle "'.$encoding.'" encoding', E_USER_WARNING);
9381 9381
     }
9382 9382
 
9383 9383
     if (self::$SUPPORT['mbstring'] === true) {
9384 9384
       return \mb_substr_count($haystack, $needle, $encoding);
9385 9385
     }
9386 9386
 
9387
-    \preg_match_all('/' . \preg_quote($needle, '/') . '/us', $haystack, $matches, PREG_SET_ORDER);
9387
+    \preg_match_all('/'.\preg_quote($needle, '/').'/us', $haystack, $matches, PREG_SET_ORDER);
9388 9388
 
9389 9389
     return \count($matches);
9390 9390
   }
@@ -9708,8 +9708,7 @@  discard block
 block discarded – undo
9708 9708
 
9709 9709
     if (self::is_ascii($str)) {
9710 9710
       return ($length === null) ?
9711
-          \substr_replace($str, $replacement, $offset) :
9712
-          \substr_replace($str, $replacement, $offset, $length);
9711
+          \substr_replace($str, $replacement, $offset) : \substr_replace($str, $replacement, $offset, $length);
9713 9712
     }
9714 9713
 
9715 9714
     \preg_match_all('/./us', $str, $smatches);
@@ -10128,9 +10127,9 @@  discard block
 block discarded – undo
10128 10127
 
10129 10128
     $string = (string)\preg_replace(
10130 10129
         [
10131
-            '/[^' . $fallback_char_escaped . '\.\-a-zA-Z0-9\s]/', // 1) remove un-needed chars
10132
-            '/[\s]+/',                                            // 2) convert spaces to $fallback_char
10133
-            '/[' . $fallback_char_escaped . ']+/',                // 3) remove double $fallback_char's
10130
+            '/[^'.$fallback_char_escaped.'\.\-a-zA-Z0-9\s]/', // 1) remove un-needed chars
10131
+            '/[\s]+/', // 2) convert spaces to $fallback_char
10132
+            '/['.$fallback_char_escaped.']+/', // 3) remove double $fallback_char's
10134 10133
         ],
10135 10134
         [
10136 10135
             '',
@@ -10231,7 +10230,7 @@  discard block
 block discarded – undo
10231 10230
           $c2 = $i + 1 >= $max ? "\x00" : $str[$i + 1];
10232 10231
 
10233 10232
           if ($c2 >= "\x80" && $c2 <= "\xBF") { // yeah, almost sure it's UTF8 already
10234
-            $buf .= $c1 . $c2;
10233
+            $buf .= $c1.$c2;
10235 10234
             $i++;
10236 10235
           } else { // not valid UTF8 - convert it
10237 10236
             $buf .= self::to_utf8_convert_helper($c1);
@@ -10243,7 +10242,7 @@  discard block
 block discarded – undo
10243 10242
           $c3 = $i + 2 >= $max ? "\x00" : $str[$i + 2];
10244 10243
 
10245 10244
           if ($c2 >= "\x80" && $c2 <= "\xBF" && $c3 >= "\x80" && $c3 <= "\xBF") { // yeah, almost sure it's UTF8 already
10246
-            $buf .= $c1 . $c2 . $c3;
10245
+            $buf .= $c1.$c2.$c3;
10247 10246
             $i += 2;
10248 10247
           } else { // not valid UTF8 - convert it
10249 10248
             $buf .= self::to_utf8_convert_helper($c1);
@@ -10256,7 +10255,7 @@  discard block
 block discarded – undo
10256 10255
           $c4 = $i + 3 >= $max ? "\x00" : $str[$i + 3];
10257 10256
 
10258 10257
           if ($c2 >= "\x80" && $c2 <= "\xBF" && $c3 >= "\x80" && $c3 <= "\xBF" && $c4 >= "\x80" && $c4 <= "\xBF") { // yeah, almost sure it's UTF8 already
10259
-            $buf .= $c1 . $c2 . $c3 . $c4;
10258
+            $buf .= $c1.$c2.$c3.$c4;
10260 10259
             $i += 3;
10261 10260
           } else { // not valid UTF8 - convert it
10262 10261
             $buf .= self::to_utf8_convert_helper($c1);
@@ -10278,7 +10277,7 @@  discard block
 block discarded – undo
10278 10277
     // decode unicode escape sequences
10279 10278
     $buf = \preg_replace_callback(
10280 10279
         '/\\\\u([0-9a-f]{4})/i',
10281
-        function ($match) {
10280
+        function($match) {
10282 10281
           // always fallback via symfony polyfill
10283 10282
           return \mb_convert_encoding(pack('H*', $match[1]), 'UTF-8', 'UCS-2BE');
10284 10283
         },
@@ -10321,7 +10320,7 @@  discard block
 block discarded – undo
10321 10320
     } else {
10322 10321
       $cc1 = self::$CHR[$ordC1 / 64] | "\xC0";
10323 10322
       $cc2 = ((string)$input & "\x3F") | "\x80";
10324
-      $buf .= $cc1 . $cc2;
10323
+      $buf .= $cc1.$cc2;
10325 10324
     }
10326 10325
 
10327 10326
     return $buf;
@@ -10385,7 +10384,7 @@  discard block
 block discarded – undo
10385 10384
         $cleanUtf8
10386 10385
     );
10387 10386
 
10388
-    return $strPartOne . $strPartTwo;
10387
+    return $strPartOne.$strPartTwo;
10389 10388
   }
10390 10389
 
10391 10390
   /**
@@ -10430,7 +10429,7 @@  discard block
 block discarded – undo
10430 10429
       $str = self::clean($str);
10431 10430
     }
10432 10431
 
10433
-    $usePhpDefaultFunctions = !(bool)($charlist . \implode('', $exceptions));
10432
+    $usePhpDefaultFunctions = !(bool)($charlist.\implode('', $exceptions));
10434 10433
 
10435 10434
     if (
10436 10435
         $usePhpDefaultFunctions === true
@@ -10934,7 +10933,7 @@  discard block
 block discarded – undo
10934 10933
       return '';
10935 10934
     }
10936 10935
 
10937
-    \preg_match('/^\s*+(?:\S++\s*+){1,' . $limit . '}/u', $str, $matches);
10936
+    \preg_match('/^\s*+(?:\S++\s*+){1,'.$limit.'}/u', $str, $matches);
10938 10937
 
10939 10938
     if (
10940 10939
         !isset($matches[0])
@@ -10944,7 +10943,7 @@  discard block
 block discarded – undo
10944 10943
       return $str;
10945 10944
     }
10946 10945
 
10947
-    return self::rtrim($matches[0]) . $strAddOn;
10946
+    return self::rtrim($matches[0]).$strAddOn;
10948 10947
   }
10949 10948
 
10950 10949
   /**
@@ -11015,7 +11014,7 @@  discard block
 block discarded – undo
11015 11014
       $strReturn .= $break;
11016 11015
     }
11017 11016
 
11018
-    return $strReturn . \implode('', $chars);
11017
+    return $strReturn.\implode('', $chars);
11019 11018
   }
11020 11019
 
11021 11020
   /**
Please login to merge, or discard this patch.