Completed
Push — master ( 224446...a1c48e )
by Lars
02:37
created
src/voku/helper/data/x18.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -19,6 +19,6 @@
 block discarded – undo
19 19
 '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]',
20 20
 ];
21 21
 
22
-$result =& $data;
22
+$result = & $data;
23 23
 unset($data);
24 24
 return $result;
Please login to merge, or discard this patch.
src/voku/helper/Bootup.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
 
96 96
     $uri = (string)\preg_replace_callback(
97 97
         '/[\x80-\xFF]+/',
98
-        function ($m) {
98
+        function($m) {
99 99
           return \rawurlencode($m[0]);
100 100
         },
101 101
         $uri
@@ -103,7 +103,7 @@  discard block
 block discarded – undo
103 103
 
104 104
     $uri = (string)\preg_replace_callback(
105 105
         '/(?:%[89A-F][0-9A-F])+/i',
106
-        function ($m) {
106
+        function($m) {
107 107
           return \rawurlencode(UTF8::rawurldecode($m[0]));
108 108
         },
109 109
         $uri
@@ -118,8 +118,8 @@  discard block
 block discarded – undo
118 118
     ) {
119 119
       // Use ob_start() to buffer content and avoid problem of headers already sent...
120 120
       $severProtocol = ($_SERVER['SERVER_PROTOCOL'] ?? 'HTTP/1.1');
121
-      \header($severProtocol . ' 301 Moved Permanently');
122
-      \header('Location: ' . $uri);
121
+      \header($severProtocol.' 301 Moved Permanently');
122
+      \header('Location: '.$uri);
123 123
       exit();
124 124
     }
125 125
 
Please login to merge, or discard this patch.
src/voku/helper/UTF8.php 3 patches
Doc Comments   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -430,7 +430,7 @@  discard block
 block discarded – undo
430 430
    *
431 431
    * INFO: opposite to UTF8::ord()
432 432
    *
433
-   * @param int|string $code_point <p>The code point for which to generate a character.</p>
433
+   * @param integer $code_point <p>The code point for which to generate a character.</p>
434 434
    * @param string     $encoding   [optional] <p>Default is UTF-8</p>
435 435
    *
436 436
    * @return string|null <p>Multi-Byte character, returns null on failure or empty input.</p>
@@ -2939,7 +2939,7 @@  discard block
 block discarded – undo
2939 2939
    *
2940 2940
    * @see    http://hsivonen.iki.fi/php-utf8/
2941 2941
    *
2942
-   * @param string|string[] $str    <p>The string to be checked.</p>
2942
+   * @param string $str    <p>The string to be checked.</p>
2943 2943
    * @param bool            $strict <p>Check also if the string is not UTF-16 or UTF-32.</p>
2944 2944
    *
2945 2945
    * @return bool
@@ -3327,7 +3327,7 @@  discard block
 block discarded – undo
3327 3327
    * @param string $otherStr <p>Second string for comparison.</p>
3328 3328
    * @param string $encoding [optional] <p>Set the charset for e.g. "\mb_" function</p>
3329 3329
    *
3330
-   * @return static <p>Object with its $str being the longest common substring.</p>
3330
+   * @return string <p>Object with its $str being the longest common substring.</p>
3331 3331
    */
3332 3332
   public static function longestCommonSubstring(string $str, string $otherStr, string $encoding = 'UTF-8'): string
3333 3333
   {
@@ -5515,7 +5515,7 @@  discard block
 block discarded – undo
5515 5515
    * @param string $encoding  [optional] <p>Set the charset for e.g. "\mb_" function</p>
5516 5516
    * @param bool   $cleanUtf8 [optional] <p>Remove non UTF-8 chars from the string.</p>
5517 5517
    *
5518
-   * @return int|false <p>
5518
+   * @return string <p>
5519 5519
    *                   Return the numeric position of the first occurrence of needle in the haystack string,<br>
5520 5520
    *                   or false if needle is not found.
5521 5521
    *                   </p>
@@ -6155,7 +6155,7 @@  discard block
 block discarded – undo
6155 6155
    * @link http://php.net/manual/en/function.mb-strrpos.php
6156 6156
    *
6157 6157
    * @param string     $haystack  <p>The string being checked, for the last occurrence of needle</p>
6158
-   * @param string|int $needle    <p>The string to find in haystack.<br>Or a code point as int.</p>
6158
+   * @param string $needle    <p>The string to find in haystack.<br>Or a code point as int.</p>
6159 6159
    * @param int        $offset    [optional] <p>May be specified to begin searching an arbitrary number of characters
6160 6160
    *                              into the string. Negative values will stop searching at an arbitrary point prior to
6161 6161
    *                              the end of the string.
@@ -6936,8 +6936,8 @@  discard block
 block discarded – undo
6936 6936
    *
6937 6937
    * source: https://gist.github.com/stemar/8287074
6938 6938
    *
6939
-   * @param string|string[] $str              <p>The input string or an array of stings.</p>
6940
-   * @param string|string[] $replacement      <p>The replacement string or an array of stings.</p>
6939
+   * @param string $str              <p>The input string or an array of stings.</p>
6940
+   * @param string $replacement      <p>The replacement string or an array of stings.</p>
6941 6941
    * @param int|int[]       $offset           <p>
6942 6942
    *                                          If start is positive, the replacing will begin at the start'th offset
6943 6943
    *                                          into string.
@@ -6945,7 +6945,7 @@  discard block
 block discarded – undo
6945 6945
    *                                          If start is negative, the replacing will begin at the start'th character
6946 6946
    *                                          from the end of string.
6947 6947
    *                                          </p>
6948
-   * @param int|int[]|null  $length           [optional] <p>If given and is positive, it represents the length of the
6948
+   * @param integer  $length           [optional] <p>If given and is positive, it represents the length of the
6949 6949
    *                                          portion of string which is to be replaced. If it is negative, it
6950 6950
    *                                          represents the number of characters from the end of string at which to
6951 6951
    *                                          stop replacing. If it is not given, then it will default to strlen(
Please login to merge, or discard this patch.
Indentation   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -498,16 +498,16 @@  discard block
 block discarded – undo
498 498
       $chr = self::$CHR[$code_point];
499 499
     } elseif ($code_point <= 0x7FF) {
500 500
       $chr = self::$CHR[($code_point >> 6) + 0xC0] .
501
-             self::$CHR[($code_point & 0x3F) + 0x80];
501
+              self::$CHR[($code_point & 0x3F) + 0x80];
502 502
     } elseif ($code_point <= 0xFFFF) {
503 503
       $chr = self::$CHR[($code_point >> 12) + 0xE0] .
504
-             self::$CHR[(($code_point >> 6) & 0x3F) + 0x80] .
505
-             self::$CHR[($code_point & 0x3F) + 0x80];
504
+              self::$CHR[(($code_point >> 6) & 0x3F) + 0x80] .
505
+              self::$CHR[($code_point & 0x3F) + 0x80];
506 506
     } else {
507 507
       $chr = self::$CHR[($code_point >> 18) + 0xF0] .
508
-             self::$CHR[(($code_point >> 12) & 0x3F) + 0x80] .
509
-             self::$CHR[(($code_point >> 6) & 0x3F) + 0x80] .
510
-             self::$CHR[($code_point & 0x3F) + 0x80];
508
+              self::$CHR[(($code_point >> 12) & 0x3F) + 0x80] .
509
+              self::$CHR[(($code_point >> 6) & 0x3F) + 0x80] .
510
+              self::$CHR[($code_point & 0x3F) + 0x80];
511 511
     }
512 512
 
513 513
     if ($encoding !== 'UTF-8') {
@@ -994,9 +994,9 @@  discard block
 block discarded – undo
994 994
 
995 995
       if ($pos) {
996 996
         return \rtrim(
997
-                   self::substr($text, 0, $pos, $encoding),
998
-                   $trimChars
999
-               ) . $replacerForSkippedText;
997
+                    self::substr($text, 0, $pos, $encoding),
998
+                    $trimChars
999
+                ) . $replacerForSkippedText;
1000 1000
       }
1001 1001
 
1002 1002
       return $text;
@@ -1035,9 +1035,9 @@  discard block
 block discarded – undo
1035 1035
       }
1036 1036
 
1037 1037
       $pos_end = \min(
1038
-                     self::strpos($text, ' ', $l, $encoding),
1039
-                     self::strpos($text, '.', $l, $encoding)
1040
-                 ) - $pos_start;
1038
+                      self::strpos($text, ' ', $l, $encoding),
1039
+                      self::strpos($text, '.', $l, $encoding)
1040
+                  ) - $pos_start;
1041 1041
 
1042 1042
       if (!$pos_end || $pos_end <= 0) {
1043 1043
         $extract = $replacerForSkippedText . \ltrim(
@@ -1077,9 +1077,9 @@  discard block
 block discarded – undo
1077 1077
 
1078 1078
       if ($pos_end) {
1079 1079
         $extract = \rtrim(
1080
-                       self::substr($text, 0, $pos_end, $encoding),
1081
-                       $trimChars
1082
-                   ) . $replacerForSkippedText;
1080
+                        self::substr($text, 0, $pos_end, $encoding),
1081
+                        $trimChars
1082
+                    ) . $replacerForSkippedText;
1083 1083
       } else {
1084 1084
         $extract = $text;
1085 1085
       }
@@ -2745,10 +2745,10 @@  discard block
 block discarded – undo
2745 2745
     $json = self::json_decode($str);
2746 2746
 
2747 2747
     return (
2748
-               \is_object($json) === true
2748
+                \is_object($json) === true
2749 2749
                ||
2750 2750
                \is_array($json) === true
2751
-           )
2751
+            )
2752 2752
            &&
2753 2753
            \json_last_error() === JSON_ERROR_NONE;
2754 2754
   }
Please login to merge, or discard this patch.
Spacing   +89 added lines, -91 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;
@@ -457,10 +457,10 @@  discard block
 block discarded – undo
457 457
         &&
458 458
         self::$SUPPORT['mbstring'] === false
459 459
     ) {
460
-      \trigger_error('UTF8::chr() without mbstring cannot handle "' . $encoding . '" encoding', E_USER_WARNING);
460
+      \trigger_error('UTF8::chr() without mbstring cannot handle "'.$encoding.'" encoding', E_USER_WARNING);
461 461
     }
462 462
 
463
-    $cacheKey = $code_point . $encoding;
463
+    $cacheKey = $code_point.$encoding;
464 464
     if (isset($CHAR_CACHE[$cacheKey]) === true) {
465 465
       return $CHAR_CACHE[$cacheKey];
466 466
     }
@@ -497,16 +497,16 @@  discard block
 block discarded – undo
497 497
     if ($code_point <= 0x7F) {
498 498
       $chr = self::$CHR[$code_point];
499 499
     } elseif ($code_point <= 0x7FF) {
500
-      $chr = self::$CHR[($code_point >> 6) + 0xC0] .
500
+      $chr = self::$CHR[($code_point >> 6) + 0xC0].
501 501
              self::$CHR[($code_point & 0x3F) + 0x80];
502 502
     } elseif ($code_point <= 0xFFFF) {
503
-      $chr = self::$CHR[($code_point >> 12) + 0xE0] .
504
-             self::$CHR[(($code_point >> 6) & 0x3F) + 0x80] .
503
+      $chr = self::$CHR[($code_point >> 12) + 0xE0].
504
+             self::$CHR[(($code_point >> 6) & 0x3F) + 0x80].
505 505
              self::$CHR[($code_point & 0x3F) + 0x80];
506 506
     } else {
507
-      $chr = self::$CHR[($code_point >> 18) + 0xF0] .
508
-             self::$CHR[(($code_point >> 12) & 0x3F) + 0x80] .
509
-             self::$CHR[(($code_point >> 6) & 0x3F) + 0x80] .
507
+      $chr = self::$CHR[($code_point >> 18) + 0xF0].
508
+             self::$CHR[(($code_point >> 12) & 0x3F) + 0x80].
509
+             self::$CHR[(($code_point >> 6) & 0x3F) + 0x80].
510 510
              self::$CHR[($code_point & 0x3F) + 0x80];
511 511
     }
512 512
 
@@ -554,7 +554,7 @@  discard block
 block discarded – undo
554 554
 
555 555
     if (self::$SUPPORT['mbstring_func_overload'] === true) {
556 556
       return \array_map(
557
-          function ($data) {
557
+          function($data) {
558 558
             return UTF8::strlen($data, 'CP850'); // 8-BIT
559 559
           },
560 560
           $strSplit
@@ -838,7 +838,7 @@  discard block
 block discarded – undo
838 838
    */
839 839
   public static function decimal_to_chr($int): string
840 840
   {
841
-    return self::html_entity_decode('&#' . $int . ';', ENT_QUOTES | ENT_HTML5);
841
+    return self::html_entity_decode('&#'.$int.';', ENT_QUOTES | ENT_HTML5);
842 842
   }
843 843
 
844 844
   /**
@@ -934,7 +934,7 @@  discard block
 block discarded – undo
934 934
           &&
935 935
           self::$SUPPORT['mbstring'] === false
936 936
       ) {
937
-        \trigger_error('UTF8::encode() without mbstring cannot handle "' . $encoding . '" encoding', E_USER_WARNING);
937
+        \trigger_error('UTF8::encode() without mbstring cannot handle "'.$encoding.'" encoding', E_USER_WARNING);
938 938
       }
939 939
 
940 940
       $strEncoded = \mb_convert_encoding(
@@ -996,7 +996,7 @@  discard block
 block discarded – undo
996 996
         return \rtrim(
997 997
                    self::substr($text, 0, $pos, $encoding),
998 998
                    $trimChars
999
-               ) . $replacerForSkippedText;
999
+               ).$replacerForSkippedText;
1000 1000
       }
1001 1001
 
1002 1002
       return $text;
@@ -1040,7 +1040,7 @@  discard block
 block discarded – undo
1040 1040
                  ) - $pos_start;
1041 1041
 
1042 1042
       if (!$pos_end || $pos_end <= 0) {
1043
-        $extract = $replacerForSkippedText . \ltrim(
1043
+        $extract = $replacerForSkippedText.\ltrim(
1044 1044
                 self::substr(
1045 1045
                     $text,
1046 1046
                     $pos_start,
@@ -1050,7 +1050,7 @@  discard block
 block discarded – undo
1050 1050
                 $trimChars
1051 1051
             );
1052 1052
       } else {
1053
-        $extract = $replacerForSkippedText . \trim(
1053
+        $extract = $replacerForSkippedText.\trim(
1054 1054
                 self::substr(
1055 1055
                     $text,
1056 1056
                     $pos_start,
@@ -1058,7 +1058,7 @@  discard block
 block discarded – undo
1058 1058
                     $encoding
1059 1059
                 ),
1060 1060
                 $trimChars
1061
-            ) . $replacerForSkippedText;
1061
+            ).$replacerForSkippedText;
1062 1062
       }
1063 1063
 
1064 1064
     } else {
@@ -1079,7 +1079,7 @@  discard block
 block discarded – undo
1079 1079
         $extract = \rtrim(
1080 1080
                        self::substr($text, 0, $pos_end, $encoding),
1081 1081
                        $trimChars
1082
-                   ) . $replacerForSkippedText;
1082
+                   ).$replacerForSkippedText;
1083 1083
       } else {
1084 1084
         $extract = $text;
1085 1085
       }
@@ -1187,7 +1187,7 @@  discard block
 block discarded – undo
1187 1187
   public static function offset_exists($offset, string $str, string $encoding = 'UTF-8'): bool
1188 1188
   {
1189 1189
     // init
1190
-    $length = self::strlen($str, $encoding);;
1190
+    $length = self::strlen($str, $encoding); ;
1191 1191
     $offset = (int)$offset;
1192 1192
 
1193 1193
     if ($offset >= 0) {
@@ -1263,7 +1263,7 @@  discard block
 block discarded – undo
1263 1263
           ) {
1264 1264
             // Prevent leading combining chars
1265 1265
             // for NFC-safe concatenations.
1266
-            $var = $leading_combining . $var;
1266
+            $var = $leading_combining.$var;
1267 1267
           }
1268 1268
         }
1269 1269
 
@@ -1703,7 +1703,7 @@  discard block
 block discarded – undo
1703 1703
    */
1704 1704
   private static function getData(string $file)
1705 1705
   {
1706
-    $file = __DIR__ . '/data/' . $file . '.php';
1706
+    $file = __DIR__.'/data/'.$file.'.php';
1707 1707
     if (\file_exists($file)) {
1708 1708
       /** @noinspection PhpIncludeInspection */
1709 1709
       return require $file;
@@ -1780,16 +1780,16 @@  discard block
 block discarded – undo
1780 1780
    */
1781 1781
   public static function get_unique_string($entropyExtra = '', bool $md5 = true): string
1782 1782
   {
1783
-    $uniqueHelper = \mt_rand() .
1784
-                    \session_id() .
1785
-                    ($_SERVER['REMOTE_ADDR'] ?? '') .
1786
-                    ($_SERVER['SERVER_ADDR'] ?? '') .
1783
+    $uniqueHelper = \mt_rand().
1784
+                    \session_id().
1785
+                    ($_SERVER['REMOTE_ADDR'] ?? '').
1786
+                    ($_SERVER['SERVER_ADDR'] ?? '').
1787 1787
                     $entropyExtra;
1788 1788
 
1789 1789
     $uniqueString = \uniqid($uniqueHelper, true);
1790 1790
 
1791 1791
     if ($md5) {
1792
-      $uniqueString = \md5($uniqueString . $uniqueHelper);
1792
+      $uniqueString = \md5($uniqueString.$uniqueHelper);
1793 1793
     }
1794 1794
 
1795 1795
     return $uniqueString;
@@ -1924,7 +1924,7 @@  discard block
 block discarded – undo
1924 1924
     return \implode(
1925 1925
         '',
1926 1926
         \array_map(
1927
-            function ($data) use ($keepAsciiChars, $encoding) {
1927
+            function($data) use ($keepAsciiChars, $encoding) {
1928 1928
               return UTF8::single_chr_html_encode($data, $keepAsciiChars, $encoding);
1929 1929
             },
1930 1930
             self::split($str)
@@ -2040,7 +2040,7 @@  discard block
 block discarded – undo
2040 2040
         &&
2041 2041
         self::$SUPPORT['mbstring'] === false
2042 2042
     ) {
2043
-      \trigger_error('UTF8::html_entity_decode() without mbstring cannot handle "' . $encoding . '" encoding', E_USER_WARNING);
2043
+      \trigger_error('UTF8::html_entity_decode() without mbstring cannot handle "'.$encoding.'" encoding', E_USER_WARNING);
2044 2044
     }
2045 2045
 
2046 2046
     do {
@@ -2048,7 +2048,7 @@  discard block
 block discarded – undo
2048 2048
 
2049 2049
       $str = (string)\preg_replace_callback(
2050 2050
           "/&#\d{2,6};/",
2051
-          function ($matches) use ($encoding) {
2051
+          function($matches) use ($encoding) {
2052 2052
             $returnTmp = \mb_convert_encoding($matches[0], $encoding, 'HTML-ENTITIES');
2053 2053
 
2054 2054
             if ($returnTmp !== '"' && $returnTmp !== "'") {
@@ -2352,9 +2352,9 @@  discard block
 block discarded – undo
2352 2352
   {
2353 2353
     $hex = \dechex($int);
2354 2354
 
2355
-    $hex = (\strlen($hex) < 4 ? \substr('0000' . $hex, -4) : $hex);
2355
+    $hex = (\strlen($hex) < 4 ? \substr('0000'.$hex, -4) : $hex);
2356 2356
 
2357
-    return $pfix . $hex;
2357
+    return $pfix.$hex;
2358 2358
   }
2359 2359
 
2360 2360
   /**
@@ -3223,7 +3223,7 @@  discard block
 block discarded – undo
3223 3223
         $cleanUtf8
3224 3224
     );
3225 3225
 
3226
-    return $strPartOne . $strPartTwo;
3226
+    return $strPartOne.$strPartTwo;
3227 3227
   }
3228 3228
 
3229 3229
   /**
@@ -3392,7 +3392,7 @@  discard block
 block discarded – undo
3392 3392
       $char = self::substr($str, -$i, 1, $encoding);
3393 3393
 
3394 3394
       if ($char == self::substr($otherStr, -$i, 1, $encoding)) {
3395
-        $longestCommonSuffix = $char . $longestCommonSuffix;
3395
+        $longestCommonSuffix = $char.$longestCommonSuffix;
3396 3396
       } else {
3397 3397
         break;
3398 3398
       }
@@ -3436,7 +3436,7 @@  discard block
 block discarded – undo
3436 3436
    */
3437 3437
   public static function matchesPattern(string $str, string $pattern): bool
3438 3438
   {
3439
-    if (\preg_match('/' . $pattern . '/u', $str)) {
3439
+    if (\preg_match('/'.$pattern.'/u', $str)) {
3440 3440
       return true;
3441 3441
     }
3442 3442
 
@@ -3759,7 +3759,7 @@  discard block
 block discarded – undo
3759 3759
       }
3760 3760
     }
3761 3761
 
3762
-    $cacheKey = $chr_orig . $encoding;
3762
+    $cacheKey = $chr_orig.$encoding;
3763 3763
     if (isset($CHAR_CACHE[$cacheKey]) === true) {
3764 3764
       return $CHAR_CACHE[$cacheKey];
3765 3765
     }
@@ -3985,7 +3985,7 @@  discard block
 block discarded – undo
3985 3985
     }
3986 3986
 
3987 3987
     $str = (string)\preg_replace(
3988
-        $delimiter . $pattern . $delimiter . 'u' . $options,
3988
+        $delimiter.$pattern.$delimiter.'u'.$options,
3989 3989
         $replacement,
3990 3990
         $str
3991 3991
     );
@@ -4052,7 +4052,7 @@  discard block
 block discarded – undo
4052 4052
     if (\is_array($what) === true) {
4053 4053
       /** @noinspection ForeachSourceInspection */
4054 4054
       foreach ($what as $item) {
4055
-        $str = (string)\preg_replace('/(' . \preg_quote($item, '/') . ')+/', $item, $str);
4055
+        $str = (string)\preg_replace('/('.\preg_quote($item, '/').')+/', $item, $str);
4056 4056
       }
4057 4057
     }
4058 4058
 
@@ -4180,7 +4180,7 @@  discard block
 block discarded – undo
4180 4180
   {
4181 4181
     static $RX_CLASSS_CACHE = [];
4182 4182
 
4183
-    $cacheKey = $s . $class;
4183
+    $cacheKey = $s.$class;
4184 4184
 
4185 4185
     if (isset($RX_CLASSS_CACHE[$cacheKey])) {
4186 4186
       return $RX_CLASSS_CACHE[$cacheKey];
@@ -4192,7 +4192,7 @@  discard block
 block discarded – undo
4192 4192
     /** @noinspection SuspiciousLoopInspection */
4193 4193
     foreach (self::str_split($s) as $s) {
4194 4194
       if ('-' === $s) {
4195
-        $class[0] = '-' . $class[0];
4195
+        $class[0] = '-'.$class[0];
4196 4196
       } elseif (!isset($s[2])) {
4197 4197
         $class[0] .= \preg_quote($s, '/');
4198 4198
       } elseif (1 === self::strlen($s)) {
@@ -4203,13 +4203,13 @@  discard block
 block discarded – undo
4203 4203
     }
4204 4204
 
4205 4205
     if ($class[0]) {
4206
-      $class[0] = '[' . $class[0] . ']';
4206
+      $class[0] = '['.$class[0].']';
4207 4207
     }
4208 4208
 
4209 4209
     if (1 === \count($class)) {
4210 4210
       $return = $class[0];
4211 4211
     } else {
4212
-      $return = '(?:' . \implode('|', $class) . ')';
4212
+      $return = '(?:'.\implode('|', $class).')';
4213 4213
     }
4214 4214
 
4215 4215
     $RX_CLASSS_CACHE[$cacheKey] = $return;
@@ -4228,7 +4228,7 @@  discard block
 block discarded – undo
4228 4228
 
4229 4229
     echo '<pre>';
4230 4230
     foreach (self::$SUPPORT as $key => $value) {
4231
-      echo $key . ' - ' . \print_r($value, true) . "\n<br>";
4231
+      echo $key.' - '.\print_r($value, true)."\n<br>";
4232 4232
     }
4233 4233
     echo '</pre>';
4234 4234
   }
@@ -4260,7 +4260,7 @@  discard block
 block discarded – undo
4260 4260
       $encoding = self::normalize_encoding($encoding, 'UTF-8');
4261 4261
     }
4262 4262
 
4263
-    return '&#' . self::ord($char, $encoding) . ';';
4263
+    return '&#'.self::ord($char, $encoding).';';
4264 4264
   }
4265 4265
 
4266 4266
   /**
@@ -4332,7 +4332,7 @@  discard block
 block discarded – undo
4332 4332
         ) {
4333 4333
 
4334 4334
           if (($str[$i + 1] & "\xC0") === "\x80") {
4335
-            $ret[] = $str[$i] . $str[$i + 1];
4335
+            $ret[] = $str[$i].$str[$i + 1];
4336 4336
 
4337 4337
             $i++;
4338 4338
           }
@@ -4348,7 +4348,7 @@  discard block
 block discarded – undo
4348 4348
               &&
4349 4349
               ($str[$i + 2] & "\xC0") === "\x80"
4350 4350
           ) {
4351
-            $ret[] = $str[$i] . $str[$i + 1] . $str[$i + 2];
4351
+            $ret[] = $str[$i].$str[$i + 1].$str[$i + 2];
4352 4352
 
4353 4353
             $i += 2;
4354 4354
           }
@@ -4366,7 +4366,7 @@  discard block
 block discarded – undo
4366 4366
               &&
4367 4367
               ($str[$i + 3] & "\xC0") === "\x80"
4368 4368
           ) {
4369
-            $ret[] = $str[$i] . $str[$i + 1] . $str[$i + 2] . $str[$i + 3];
4369
+            $ret[] = $str[$i].$str[$i + 1].$str[$i + 2].$str[$i + 3];
4370 4370
 
4371 4371
             $i += 3;
4372 4372
           }
@@ -4379,7 +4379,7 @@  discard block
 block discarded – undo
4379 4379
       $ret = \array_chunk($ret, $length);
4380 4380
 
4381 4381
       return \array_map(
4382
-          function ($item) {
4382
+          function($item) {
4383 4383
             return \implode('', $item);
4384 4384
           }, $ret
4385 4385
       );
@@ -4582,7 +4582,7 @@  discard block
 block discarded – undo
4582 4582
     foreach (self::$ENCODINGS as $encodingTmp) {
4583 4583
       # INFO: //IGNORE and //TRANSLIT still throw notice
4584 4584
       /** @noinspection PhpUsageOfSilenceOperatorInspection */
4585
-      if (\md5(@\iconv($encodingTmp, $encodingTmp . '//IGNORE', $str)) === $md5) {
4585
+      if (\md5(@\iconv($encodingTmp, $encodingTmp.'//IGNORE', $str)) === $md5) {
4586 4586
         return $encodingTmp;
4587 4587
       }
4588 4588
     }
@@ -4644,7 +4644,7 @@  discard block
 block discarded – undo
4644 4644
   public static function str_ensure_left(string $str, string $substring): string
4645 4645
   {
4646 4646
     if (!self::str_starts_with($str, $substring)) {
4647
-      $str = $substring . $str;
4647
+      $str = $substring.$str;
4648 4648
     }
4649 4649
 
4650 4650
     return $str;
@@ -4734,7 +4734,7 @@  discard block
 block discarded – undo
4734 4734
     $start = self::substr($str, 0, $index, $encoding);
4735 4735
     $end = self::substr($str, $index, $len, $encoding);
4736 4736
 
4737
-    return $start . $substring . $end;
4737
+    return $start.$substring.$end;
4738 4738
   }
4739 4739
 
4740 4740
   /**
@@ -4771,7 +4771,7 @@  discard block
 block discarded – undo
4771 4771
       if ('' === $s .= '') {
4772 4772
         $s = '/^(?<=.)$/';
4773 4773
       } else {
4774
-        $s = '/' . \preg_quote($s, '/') . '/ui';
4774
+        $s = '/'.\preg_quote($s, '/').'/ui';
4775 4775
       }
4776 4776
     }
4777 4777
 
@@ -4851,7 +4851,7 @@  discard block
 block discarded – undo
4851 4851
     }
4852 4852
 
4853 4853
     if (self::substr($str, $length - 1, 1) === ' ') {
4854
-      return (string)self::substr($str, 0, $length - 1) . $strAddOn;
4854
+      return (string)self::substr($str, 0, $length - 1).$strAddOn;
4855 4855
     }
4856 4856
 
4857 4857
     $str = (string)self::substr($str, 0, $length);
@@ -4860,9 +4860,9 @@  discard block
 block discarded – undo
4860 4860
     $new_str = \implode(' ', $array);
4861 4861
 
4862 4862
     if ($new_str === '') {
4863
-      $str = (string)self::substr($str, 0, $length - 1) . $strAddOn;
4863
+      $str = (string)self::substr($str, 0, $length - 1).$strAddOn;
4864 4864
     } else {
4865
-      $str = $new_str . $strAddOn;
4865
+      $str = $new_str.$strAddOn;
4866 4866
     }
4867 4867
 
4868 4868
     return $str;
@@ -4917,7 +4917,7 @@  discard block
 block discarded – undo
4917 4917
           $pre = '';
4918 4918
       }
4919 4919
 
4920
-      return $pre . $str . $post;
4920
+      return $pre.$str.$post;
4921 4921
     }
4922 4922
 
4923 4923
     return $str;
@@ -5078,7 +5078,7 @@  discard block
 block discarded – undo
5078 5078
     }
5079 5079
 
5080 5080
     /** @noinspection NotOptimalRegularExpressionsInspection */
5081
-    \preg_match_all('/' . self::GRAPHEME_CLUSTER_RX . '/u', $str, $a);
5081
+    \preg_match_all('/'.self::GRAPHEME_CLUSTER_RX.'/u', $str, $a);
5082 5082
     $a = $a[0];
5083 5083
 
5084 5084
     if ($len === 1) {
@@ -5353,7 +5353,7 @@  discard block
 block discarded – undo
5353 5353
   public static function strcmp(string $str1, string $str2): int
5354 5354
   {
5355 5355
     /** @noinspection PhpUndefinedClassInspection */
5356
-    return $str1 . '' === $str2 . '' ? 0 : \strcmp(
5356
+    return $str1.'' === $str2.'' ? 0 : \strcmp(
5357 5357
         \Normalizer::normalize($str1, \Normalizer::NFD),
5358 5358
         \Normalizer::normalize($str2, \Normalizer::NFD)
5359 5359
     );
@@ -5387,7 +5387,7 @@  discard block
 block discarded – undo
5387 5387
       return null;
5388 5388
     }
5389 5389
 
5390
-    if (\preg_match('/^(.*?)' . self::rxClass($charList) . '/us', $str, $length)) {
5390
+    if (\preg_match('/^(.*?)'.self::rxClass($charList).'/us', $str, $length)) {
5391 5391
       return self::strlen($length[1]);
5392 5392
     }
5393 5393
 
@@ -5597,7 +5597,7 @@  discard block
 block discarded – undo
5597 5597
         &&
5598 5598
         self::$SUPPORT['mbstring'] === false
5599 5599
     ) {
5600
-      \trigger_error('UTF8::stristr() without mbstring cannot handle "' . $encoding . '" encoding', E_USER_WARNING);
5600
+      \trigger_error('UTF8::stristr() without mbstring cannot handle "'.$encoding.'" encoding', E_USER_WARNING);
5601 5601
     }
5602 5602
 
5603 5603
     if (self::$SUPPORT['mbstring'] === true) {
@@ -5616,7 +5616,7 @@  discard block
 block discarded – undo
5616 5616
       return \stristr($haystack, $needle, $before_needle);
5617 5617
     }
5618 5618
 
5619
-    \preg_match('/^(.*?)' . \preg_quote($needle, '/') . '/usi', $haystack, $match);
5619
+    \preg_match('/^(.*?)'.\preg_quote($needle, '/').'/usi', $haystack, $match);
5620 5620
 
5621 5621
     if (!isset($match[1])) {
5622 5622
       return false;
@@ -5682,7 +5682,7 @@  discard block
 block discarded – undo
5682 5682
         &&
5683 5683
         self::$SUPPORT['iconv'] === false
5684 5684
     ) {
5685
-      \trigger_error('UTF8::strlen() without mbstring / iconv cannot handle "' . $encoding . '" encoding', E_USER_WARNING);
5685
+      \trigger_error('UTF8::strlen() without mbstring / iconv cannot handle "'.$encoding.'" encoding', E_USER_WARNING);
5686 5686
     }
5687 5687
 
5688 5688
     if (
@@ -5786,7 +5786,7 @@  discard block
 block discarded – undo
5786 5786
    */
5787 5787
   public static function strnatcmp(string $str1, string $str2): int
5788 5788
   {
5789
-    return $str1 . '' === $str2 . '' ? 0 : \strnatcmp(self::strtonatfold($str1), self::strtonatfold($str2));
5789
+    return $str1.'' === $str2.'' ? 0 : \strnatcmp(self::strtonatfold($str1), self::strtonatfold($str2));
5790 5790
   }
5791 5791
 
5792 5792
   /**
@@ -5844,7 +5844,7 @@  discard block
 block discarded – undo
5844 5844
       return false;
5845 5845
     }
5846 5846
 
5847
-    if (\preg_match('/' . self::rxClass($char_list) . '/us', $haystack, $m)) {
5847
+    if (\preg_match('/'.self::rxClass($char_list).'/us', $haystack, $m)) {
5848 5848
       return \substr($haystack, \strpos($haystack, $m[0]));
5849 5849
     }
5850 5850
 
@@ -5908,7 +5908,7 @@  discard block
 block discarded – undo
5908 5908
         &&
5909 5909
         self::$SUPPORT['mbstring'] === false
5910 5910
     ) {
5911
-      \trigger_error('UTF8::strpos() without mbstring / iconv cannot handle "' . $encoding . '" encoding', E_USER_WARNING);
5911
+      \trigger_error('UTF8::strpos() without mbstring / iconv cannot handle "'.$encoding.'" encoding', E_USER_WARNING);
5912 5912
     }
5913 5913
 
5914 5914
     if (
@@ -6129,7 +6129,7 @@  discard block
 block discarded – undo
6129 6129
         &&
6130 6130
         self::$SUPPORT['mbstring'] === false
6131 6131
     ) {
6132
-      \trigger_error('UTF8::strripos() without mbstring cannot handle "' . $encoding . '" encoding', E_USER_WARNING);
6132
+      \trigger_error('UTF8::strripos() without mbstring cannot handle "'.$encoding.'" encoding', E_USER_WARNING);
6133 6133
     }
6134 6134
 
6135 6135
     if (self::$SUPPORT['mbstring'] === true) {
@@ -6200,7 +6200,7 @@  discard block
 block discarded – undo
6200 6200
         &&
6201 6201
         self::$SUPPORT['mbstring'] === false
6202 6202
     ) {
6203
-      \trigger_error('UTF8::strrpos() without mbstring cannot handle "' . $encoding . '" encoding', E_USER_WARNING);
6203
+      \trigger_error('UTF8::strrpos() without mbstring cannot handle "'.$encoding.'" encoding', E_USER_WARNING);
6204 6204
     }
6205 6205
 
6206 6206
     if (self::$SUPPORT['mbstring'] === true) {
@@ -6265,7 +6265,7 @@  discard block
 block discarded – undo
6265 6265
       return 0;
6266 6266
     }
6267 6267
 
6268
-    return \preg_match('/^' . self::rxClass($mask) . '+/u', $str, $str) ? self::strlen($str[0]) : 0;
6268
+    return \preg_match('/^'.self::rxClass($mask).'+/u', $str, $str) ? self::strlen($str[0]) : 0;
6269 6269
   }
6270 6270
 
6271 6271
   /**
@@ -6308,7 +6308,7 @@  discard block
 block discarded – undo
6308 6308
         &&
6309 6309
         self::$SUPPORT['mbstring'] === false
6310 6310
     ) {
6311
-      \trigger_error('UTF8::strstr() without mbstring cannot handle "' . $encoding . '" encoding', E_USER_WARNING);
6311
+      \trigger_error('UTF8::strstr() without mbstring cannot handle "'.$encoding.'" encoding', E_USER_WARNING);
6312 6312
     }
6313 6313
 
6314 6314
     if (self::$SUPPORT['mbstring'] === true) {
@@ -6323,7 +6323,7 @@  discard block
 block discarded – undo
6323 6323
       return \grapheme_strstr($haystack, $needle, $before_needle);
6324 6324
     }
6325 6325
 
6326
-    \preg_match('/^(.*?)' . \preg_quote($needle, '/') . '/us', $haystack, $match);
6326
+    \preg_match('/^(.*?)'.\preg_quote($needle, '/').'/us', $haystack, $match);
6327 6327
 
6328 6328
     if (!isset($match[1])) {
6329 6329
       return false;
@@ -6421,9 +6421,9 @@  discard block
 block discarded – undo
6421 6421
 
6422 6422
       if (self::$SUPPORT['intl'] === true) {
6423 6423
 
6424
-        $langCode = $lang . '-Lower';
6424
+        $langCode = $lang.'-Lower';
6425 6425
         if (!\in_array($langCode, self::$SUPPORT['intl__transliterator_list_ids'], true)) {
6426
-          \trigger_error('UTF8::strtolower() without intl for special language: ' . $lang, E_USER_WARNING);
6426
+          \trigger_error('UTF8::strtolower() without intl for special language: '.$lang, E_USER_WARNING);
6427 6427
 
6428 6428
           $langCode = 'Any-Lower';
6429 6429
         }
@@ -6431,7 +6431,7 @@  discard block
 block discarded – undo
6431 6431
         return transliterator_transliterate($langCode, $str);
6432 6432
       }
6433 6433
 
6434
-      \trigger_error('UTF8::strtolower() without intl + PHP >= 5.4 cannot handle the "lang"-parameter: ' . $lang, E_USER_WARNING);
6434
+      \trigger_error('UTF8::strtolower() without intl + PHP >= 5.4 cannot handle the "lang"-parameter: '.$lang, E_USER_WARNING);
6435 6435
     }
6436 6436
 
6437 6437
     return \mb_strtolower($str, $encoding);
@@ -6487,9 +6487,9 @@  discard block
 block discarded – undo
6487 6487
 
6488 6488
       if (self::$SUPPORT['intl'] === true) {
6489 6489
 
6490
-        $langCode = $lang . '-Upper';
6490
+        $langCode = $lang.'-Upper';
6491 6491
         if (!\in_array($langCode, self::$SUPPORT['intl__transliterator_list_ids'], true)) {
6492
-          \trigger_error('UTF8::strtoupper() without intl for special language: ' . $lang, E_USER_WARNING);
6492
+          \trigger_error('UTF8::strtoupper() without intl for special language: '.$lang, E_USER_WARNING);
6493 6493
 
6494 6494
           $langCode = 'Any-Upper';
6495 6495
         }
@@ -6497,7 +6497,7 @@  discard block
 block discarded – undo
6497 6497
         return transliterator_transliterate($langCode, $str);
6498 6498
       }
6499 6499
 
6500
-      \trigger_error('UTF8::strtolower() without intl + PHP >= 5.4 cannot handle the "lang"-parameter: ' . $lang, E_USER_WARNING);
6500
+      \trigger_error('UTF8::strtolower() without intl + PHP >= 5.4 cannot handle the "lang"-parameter: '.$lang, E_USER_WARNING);
6501 6501
     }
6502 6502
 
6503 6503
     return \mb_strtoupper($str, $encoding);
@@ -6653,7 +6653,7 @@  discard block
 block discarded – undo
6653 6653
         &&
6654 6654
         self::$SUPPORT['mbstring'] === false
6655 6655
     ) {
6656
-      \trigger_error('UTF8::substr() without mbstring cannot handle "' . $encoding . '" encoding', E_USER_WARNING);
6656
+      \trigger_error('UTF8::substr() without mbstring cannot handle "'.$encoding.'" encoding', E_USER_WARNING);
6657 6657
     }
6658 6658
 
6659 6659
     if (self::$SUPPORT['mbstring'] === true) {
@@ -6681,8 +6681,7 @@  discard block
 block discarded – undo
6681 6681
 
6682 6682
     if (self::is_ascii($str)) {
6683 6683
       return ($length === null) ?
6684
-          \substr($str, $offset) :
6685
-          \substr($str, $offset, $length);
6684
+          \substr($str, $offset) : \substr($str, $offset, $length);
6686 6685
     }
6687 6686
 
6688 6687
     // fallback via vanilla php
@@ -6810,14 +6809,14 @@  discard block
 block discarded – undo
6810 6809
         &&
6811 6810
         self::$SUPPORT['mbstring'] === false
6812 6811
     ) {
6813
-      \trigger_error('UTF8::substr_count() without mbstring cannot handle "' . $encoding . '" encoding', E_USER_WARNING);
6812
+      \trigger_error('UTF8::substr_count() without mbstring cannot handle "'.$encoding.'" encoding', E_USER_WARNING);
6814 6813
     }
6815 6814
 
6816 6815
     if (self::$SUPPORT['mbstring'] === true) {
6817 6816
       return \mb_substr_count($haystack, $needle, $encoding);
6818 6817
     }
6819 6818
 
6820
-    \preg_match_all('/' . \preg_quote($needle, '/') . '/us', $haystack, $matches, PREG_SET_ORDER);
6819
+    \preg_match_all('/'.\preg_quote($needle, '/').'/us', $haystack, $matches, PREG_SET_ORDER);
6821 6820
 
6822 6821
     return \count($matches);
6823 6822
   }
@@ -7017,8 +7016,7 @@  discard block
 block discarded – undo
7017 7016
 
7018 7017
     if (self::is_ascii($str)) {
7019 7018
       return ($length === null) ?
7020
-          \substr_replace($str, $replacement, $offset) :
7021
-          \substr_replace($str, $replacement, $offset, $length);
7019
+          \substr_replace($str, $replacement, $offset) : \substr_replace($str, $replacement, $offset, $length);
7022 7020
     }
7023 7021
 
7024 7022
     \preg_match_all('/./us', $str, $smatches);
@@ -7461,7 +7459,7 @@  discard block
 block discarded – undo
7461 7459
           $c2 = $i + 1 >= $max ? "\x00" : $str[$i + 1];
7462 7460
 
7463 7461
           if ($c2 >= "\x80" && $c2 <= "\xBF") { // yeah, almost sure it's UTF8 already
7464
-            $buf .= $c1 . $c2;
7462
+            $buf .= $c1.$c2;
7465 7463
             $i++;
7466 7464
           } else { // not valid UTF8 - convert it
7467 7465
             $buf .= self::to_utf8_convert($c1);
@@ -7473,7 +7471,7 @@  discard block
 block discarded – undo
7473 7471
           $c3 = $i + 2 >= $max ? "\x00" : $str[$i + 2];
7474 7472
 
7475 7473
           if ($c2 >= "\x80" && $c2 <= "\xBF" && $c3 >= "\x80" && $c3 <= "\xBF") { // yeah, almost sure it's UTF8 already
7476
-            $buf .= $c1 . $c2 . $c3;
7474
+            $buf .= $c1.$c2.$c3;
7477 7475
             $i += 2;
7478 7476
           } else { // not valid UTF8 - convert it
7479 7477
             $buf .= self::to_utf8_convert($c1);
@@ -7486,7 +7484,7 @@  discard block
 block discarded – undo
7486 7484
           $c4 = $i + 3 >= $max ? "\x00" : $str[$i + 3];
7487 7485
 
7488 7486
           if ($c2 >= "\x80" && $c2 <= "\xBF" && $c3 >= "\x80" && $c3 <= "\xBF" && $c4 >= "\x80" && $c4 <= "\xBF") { // yeah, almost sure it's UTF8 already
7489
-            $buf .= $c1 . $c2 . $c3 . $c4;
7487
+            $buf .= $c1.$c2.$c3.$c4;
7490 7488
             $i += 3;
7491 7489
           } else { // not valid UTF8 - convert it
7492 7490
             $buf .= self::to_utf8_convert($c1);
@@ -7508,7 +7506,7 @@  discard block
 block discarded – undo
7508 7506
     // decode unicode escape sequences
7509 7507
     $buf = \preg_replace_callback(
7510 7508
         '/\\\\u([0-9a-f]{4})/i',
7511
-        function ($match) {
7509
+        function($match) {
7512 7510
           return \mb_convert_encoding(pack('H*', $match[1]), 'UTF-8', 'UCS-2BE');
7513 7511
         },
7514 7512
         $buf
@@ -7550,7 +7548,7 @@  discard block
 block discarded – undo
7550 7548
     } else {
7551 7549
       $cc1 = self::$CHR[$ordC1 / 64] | "\xC0";
7552 7550
       $cc2 = ($int & "\x3F") | "\x80";
7553
-      $buf .= $cc1 . $cc2;
7551
+      $buf .= $cc1.$cc2;
7554 7552
     }
7555 7553
 
7556 7554
     return $buf;
@@ -7614,7 +7612,7 @@  discard block
 block discarded – undo
7614 7612
         $cleanUtf8
7615 7613
     );
7616 7614
 
7617
-    return $strPartOne . $strPartTwo;
7615
+    return $strPartOne.$strPartTwo;
7618 7616
   }
7619 7617
 
7620 7618
   /**
@@ -7659,7 +7657,7 @@  discard block
 block discarded – undo
7659 7657
       $str = self::clean($str);
7660 7658
     }
7661 7659
 
7662
-    $usePhpDefaultFunctions = !(bool)($charlist . \implode('', $exceptions));
7660
+    $usePhpDefaultFunctions = !(bool)($charlist.\implode('', $exceptions));
7663 7661
 
7664 7662
     if (
7665 7663
         $usePhpDefaultFunctions === true
@@ -8161,7 +8159,7 @@  discard block
 block discarded – undo
8161 8159
       return '';
8162 8160
     }
8163 8161
 
8164
-    \preg_match('/^\s*+(?:\S++\s*+){1,' . $limit . '}/u', $str, $matches);
8162
+    \preg_match('/^\s*+(?:\S++\s*+){1,'.$limit.'}/u', $str, $matches);
8165 8163
 
8166 8164
     if (
8167 8165
         !isset($matches[0])
@@ -8171,7 +8169,7 @@  discard block
 block discarded – undo
8171 8169
       return $str;
8172 8170
     }
8173 8171
 
8174
-    return self::rtrim($matches[0]) . $strAddOn;
8172
+    return self::rtrim($matches[0]).$strAddOn;
8175 8173
   }
8176 8174
 
8177 8175
   /**
@@ -8236,7 +8234,7 @@  discard block
 block discarded – undo
8236 8234
       $strReturn .= $break;
8237 8235
     }
8238 8236
 
8239
-    return $strReturn . \implode('', $chars);
8237
+    return $strReturn.\implode('', $chars);
8240 8238
   }
8241 8239
 
8242 8240
   /**
Please login to merge, or discard this patch.