Completed
Push — master ( 476d36...5785c8 )
by Lars
02:58
created
src/voku/helper/Bootup.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -94,7 +94,7 @@  discard block
 block discarded – undo
94 94
 
95 95
     $uri = preg_replace_callback(
96 96
         '/[\x80-\xFF]+/',
97
-        function ($m) {
97
+        function($m) {
98 98
           return urlencode($m[0]);
99 99
         },
100 100
         $uri
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
 
103 103
     $uri = preg_replace_callback(
104 104
         '/(?:%[89A-F][0-9A-F])+/i',
105
-        function ($m) {
105
+        function($m) {
106 106
           return urlencode(UTF8::encode('UTF-8', urldecode($m[0])));
107 107
         },
108 108
         $uri
@@ -117,8 +117,8 @@  discard block
 block discarded – undo
117 117
     ) {
118 118
       // Use ob_start() to buffer content and avoid problem of headers already sent...
119 119
       $severProtocol = (isset($_SERVER['SERVER_PROTOCOL']) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.1');
120
-      header($severProtocol . ' 301 Moved Permanently');
121
-      header('Location: ' . $uri);
120
+      header($severProtocol.' 301 Moved Permanently');
121
+      header('Location: '.$uri);
122 122
       exit();
123 123
     }
124 124
 
Please login to merge, or discard this patch.
src/voku/helper/UTF8.php 1 patch
Spacing   +68 added lines, -68 removed lines patch added patch discarded remove patch
@@ -850,7 +850,7 @@  discard block
 block discarded – undo
850 850
   public static function add_bom_to_string($str)
851 851
   {
852 852
     if (self::string_has_bom($str) === false) {
853
-      $str = self::bom() . $str;
853
+      $str = self::bom().$str;
854 854
     }
855 855
 
856 856
     return $str;
@@ -967,7 +967,7 @@  discard block
 block discarded – undo
967 967
 
968 968
     // use static cache, only if there is no support for "\IntlChar"
969 969
     static $CHAR_CACHE = array();
970
-    $cacheKey = $code_point . $encoding;
970
+    $cacheKey = $code_point.$encoding;
971 971
     if (isset($CHAR_CACHE[$cacheKey]) === true) {
972 972
       return $CHAR_CACHE[$cacheKey];
973 973
     }
@@ -975,16 +975,16 @@  discard block
 block discarded – undo
975 975
     if (0x80 > $code_point %= 0x200000) {
976 976
       $str = self::chr_and_parse_int($code_point);
977 977
     } elseif (0x800 > $code_point) {
978
-      $str = self::chr_and_parse_int(0xC0 | $code_point >> 6) .
978
+      $str = self::chr_and_parse_int(0xC0 | $code_point >> 6).
979 979
              self::chr_and_parse_int(0x80 | $code_point & 0x3F);
980 980
     } elseif (0x10000 > $code_point) {
981
-      $str = self::chr_and_parse_int(0xE0 | $code_point >> 12) .
982
-             self::chr_and_parse_int(0x80 | $code_point >> 6 & 0x3F) .
981
+      $str = self::chr_and_parse_int(0xE0 | $code_point >> 12).
982
+             self::chr_and_parse_int(0x80 | $code_point >> 6 & 0x3F).
983 983
              self::chr_and_parse_int(0x80 | $code_point & 0x3F);
984 984
     } else {
985
-      $str = self::chr_and_parse_int(0xF0 | $code_point >> 18) .
986
-             self::chr_and_parse_int(0x80 | $code_point >> 12 & 0x3F) .
987
-             self::chr_and_parse_int(0x80 | $code_point >> 6 & 0x3F) .
985
+      $str = self::chr_and_parse_int(0xF0 | $code_point >> 18).
986
+             self::chr_and_parse_int(0x80 | $code_point >> 12 & 0x3F).
987
+             self::chr_and_parse_int(0x80 | $code_point >> 6 & 0x3F).
988 988
              self::chr_and_parse_int(0x80 | $code_point & 0x3F);
989 989
     }
990 990
 
@@ -1044,7 +1044,7 @@  discard block
 block discarded – undo
1044 1044
     }
1045 1045
 
1046 1046
     return array_map(
1047
-        function ($data) {
1047
+        function($data) {
1048 1048
           return UTF8::strlen($data, '8BIT');
1049 1049
         },
1050 1050
         self::split($str)
@@ -1286,7 +1286,7 @@  discard block
 block discarded – undo
1286 1286
       $flags = ENT_QUOTES;
1287 1287
     }
1288 1288
 
1289
-    return self::html_entity_decode('&#' . $int . ';', $flags);
1289
+    return self::html_entity_decode('&#'.$int.';', $flags);
1290 1290
   }
1291 1291
 
1292 1292
   /**
@@ -1363,7 +1363,7 @@  discard block
 block discarded – undo
1363 1363
           &&
1364 1364
           self::$SUPPORT['mbstring'] === false
1365 1365
       ) {
1366
-        trigger_error('UTF8::encode() without mbstring cannot handle "' . $encoding . '" encoding', E_USER_WARNING);
1366
+        trigger_error('UTF8::encode() without mbstring cannot handle "'.$encoding.'" encoding', E_USER_WARNING);
1367 1367
       }
1368 1368
 
1369 1369
       $strEncoded = \mb_convert_encoding(
@@ -1572,7 +1572,7 @@  discard block
 block discarded – undo
1572 1572
           ) {
1573 1573
             // Prevent leading combining chars
1574 1574
             // for NFC-safe concatenations.
1575
-            $var = $leading_combining . $var;
1575
+            $var = $leading_combining.$var;
1576 1576
           }
1577 1577
         }
1578 1578
 
@@ -1993,7 +1993,7 @@  discard block
 block discarded – undo
1993 1993
    */
1994 1994
   private static function getData($file)
1995 1995
   {
1996
-    $file = __DIR__ . '/data/' . $file . '.php';
1996
+    $file = __DIR__.'/data/'.$file.'.php';
1997 1997
     if (file_exists($file)) {
1998 1998
       /** @noinspection PhpIncludeInspection */
1999 1999
       return require $file;
@@ -2138,7 +2138,7 @@  discard block
 block discarded – undo
2138 2138
     return implode(
2139 2139
         '',
2140 2140
         array_map(
2141
-            function ($data) use ($keepAsciiChars, $encoding) {
2141
+            function($data) use ($keepAsciiChars, $encoding) {
2142 2142
               return UTF8::single_chr_html_encode($data, $keepAsciiChars, $encoding);
2143 2143
             },
2144 2144
             self::split($str)
@@ -2257,7 +2257,7 @@  discard block
 block discarded – undo
2257 2257
 
2258 2258
       $str = preg_replace_callback(
2259 2259
           "/&#\d{2,6};/",
2260
-          function ($matches) use ($encoding) {
2260
+          function($matches) use ($encoding) {
2261 2261
             $returnTmp = \mb_convert_encoding($matches[0], $encoding, 'HTML-ENTITIES');
2262 2262
 
2263 2263
             if ($returnTmp !== '"' && $returnTmp !== "'") {
@@ -2581,9 +2581,9 @@  discard block
 block discarded – undo
2581 2581
     if ((int)$int === $int) {
2582 2582
       $hex = dechex($int);
2583 2583
 
2584
-      $hex = (strlen($hex) < 4 ? substr('0000' . $hex, -4) : $hex);
2584
+      $hex = (strlen($hex) < 4 ? substr('0000'.$hex, -4) : $hex);
2585 2585
 
2586
-      return $pfix . $hex;
2586
+      return $pfix.$hex;
2587 2587
     }
2588 2588
 
2589 2589
     return '';
@@ -3313,7 +3313,7 @@  discard block
 block discarded – undo
3313 3313
    */
3314 3314
   public static function lcfirst($str)
3315 3315
   {
3316
-    return self::strtolower(self::substr($str, 0, 1)) . self::substr($str, 1);
3316
+    return self::strtolower(self::substr($str, 0, 1)).self::substr($str, 1);
3317 3317
   }
3318 3318
 
3319 3319
   /**
@@ -3337,7 +3337,7 @@  discard block
 block discarded – undo
3337 3337
       return preg_replace('/^[\pZ\pC]+/u', '', $str);
3338 3338
     }
3339 3339
 
3340
-    return preg_replace('/^' . self::rxClass($chars) . '+/u', '', $str);
3340
+    return preg_replace('/^'.self::rxClass($chars).'+/u', '', $str);
3341 3341
   }
3342 3342
 
3343 3343
   /**
@@ -3852,7 +3852,7 @@  discard block
 block discarded – undo
3852 3852
     if (is_array($what) === true) {
3853 3853
       /** @noinspection ForeachSourceInspection */
3854 3854
       foreach ($what as $item) {
3855
-        $str = preg_replace('/(' . preg_quote($item, '/') . ')+/', $item, $str);
3855
+        $str = preg_replace('/('.preg_quote($item, '/').')+/', $item, $str);
3856 3856
       }
3857 3857
     }
3858 3858
 
@@ -3965,7 +3965,7 @@  discard block
 block discarded – undo
3965 3965
       return preg_replace('/[\pZ\pC]+$/u', '', $str);
3966 3966
     }
3967 3967
 
3968
-    return preg_replace('/' . self::rxClass($chars) . '+$/u', '', $str);
3968
+    return preg_replace('/'.self::rxClass($chars).'+$/u', '', $str);
3969 3969
   }
3970 3970
 
3971 3971
   /**
@@ -3980,7 +3980,7 @@  discard block
 block discarded – undo
3980 3980
   {
3981 3981
     static $RX_CLASSS_CACHE = array();
3982 3982
 
3983
-    $cacheKey = $s . $class;
3983
+    $cacheKey = $s.$class;
3984 3984
 
3985 3985
     if (isset($RX_CLASSS_CACHE[$cacheKey])) {
3986 3986
       return $RX_CLASSS_CACHE[$cacheKey];
@@ -3992,7 +3992,7 @@  discard block
 block discarded – undo
3992 3992
     /** @noinspection SuspiciousLoopInspection */
3993 3993
     foreach (self::str_split($s) as $s) {
3994 3994
       if ('-' === $s) {
3995
-        $class[0] = '-' . $class[0];
3995
+        $class[0] = '-'.$class[0];
3996 3996
       } elseif (!isset($s[2])) {
3997 3997
         $class[0] .= preg_quote($s, '/');
3998 3998
       } elseif (1 === self::strlen($s)) {
@@ -4003,13 +4003,13 @@  discard block
 block discarded – undo
4003 4003
     }
4004 4004
 
4005 4005
     if ($class[0]) {
4006
-      $class[0] = '[' . $class[0] . ']';
4006
+      $class[0] = '['.$class[0].']';
4007 4007
     }
4008 4008
 
4009 4009
     if (1 === count($class)) {
4010 4010
       $return = $class[0];
4011 4011
     } else {
4012
-      $return = '(?:' . implode('|', $class) . ')';
4012
+      $return = '(?:'.implode('|', $class).')';
4013 4013
     }
4014 4014
 
4015 4015
     $RX_CLASSS_CACHE[$cacheKey] = $return;
@@ -4027,7 +4027,7 @@  discard block
 block discarded – undo
4027 4027
     }
4028 4028
 
4029 4029
     foreach (self::$SUPPORT as $utf8Support) {
4030
-      echo $utf8Support . "\n<br>";
4030
+      echo $utf8Support."\n<br>";
4031 4031
     }
4032 4032
   }
4033 4033
 
@@ -4061,7 +4061,7 @@  discard block
 block discarded – undo
4061 4061
       $encoding = self::normalize_encoding($encoding, 'UTF-8');
4062 4062
     }
4063 4063
 
4064
-    return '&#' . self::ord($char, $encoding) . ';';
4064
+    return '&#'.self::ord($char, $encoding).';';
4065 4065
   }
4066 4066
 
4067 4067
   /**
@@ -4128,7 +4128,7 @@  discard block
 block discarded – undo
4128 4128
         ) {
4129 4129
 
4130 4130
           if (($str[$i + 1] & "\xC0") === "\x80") {
4131
-            $ret[] = $str[$i] . $str[$i + 1];
4131
+            $ret[] = $str[$i].$str[$i + 1];
4132 4132
 
4133 4133
             $i++;
4134 4134
           }
@@ -4144,7 +4144,7 @@  discard block
 block discarded – undo
4144 4144
               &&
4145 4145
               ($str[$i + 2] & "\xC0") === "\x80"
4146 4146
           ) {
4147
-            $ret[] = $str[$i] . $str[$i + 1] . $str[$i + 2];
4147
+            $ret[] = $str[$i].$str[$i + 1].$str[$i + 2];
4148 4148
 
4149 4149
             $i += 2;
4150 4150
           }
@@ -4162,7 +4162,7 @@  discard block
 block discarded – undo
4162 4162
               &&
4163 4163
               ($str[$i + 3] & "\xC0") === "\x80"
4164 4164
           ) {
4165
-            $ret[] = $str[$i] . $str[$i + 1] . $str[$i + 2] . $str[$i + 3];
4165
+            $ret[] = $str[$i].$str[$i + 1].$str[$i + 2].$str[$i + 3];
4166 4166
 
4167 4167
             $i += 3;
4168 4168
           }
@@ -4175,7 +4175,7 @@  discard block
 block discarded – undo
4175 4175
       $ret = array_chunk($ret, $length);
4176 4176
 
4177 4177
       return array_map(
4178
-          function ($item) {
4178
+          function($item) {
4179 4179
             return implode('', $item);
4180 4180
           }, $ret
4181 4181
       );
@@ -4274,7 +4274,7 @@  discard block
 block discarded – undo
4274 4274
     foreach (self::$ICONV_ENCODING as $encodingTmp) {
4275 4275
       # INFO: //IGNORE and //TRANSLIT still throw notice
4276 4276
       /** @noinspection PhpUsageOfSilenceOperatorInspection */
4277
-      if (md5(@\iconv($encodingTmp, $encodingTmp . '//IGNORE', $str)) === $md5) {
4277
+      if (md5(@\iconv($encodingTmp, $encodingTmp.'//IGNORE', $str)) === $md5) {
4278 4278
         return $encodingTmp;
4279 4279
       }
4280 4280
     }
@@ -4364,7 +4364,7 @@  discard block
 block discarded – undo
4364 4364
       if ('' === $s .= '') {
4365 4365
         $s = '/^(?<=.)$/';
4366 4366
       } else {
4367
-        $s = '/' . preg_quote($s, '/') . '/ui';
4367
+        $s = '/'.preg_quote($s, '/').'/ui';
4368 4368
       }
4369 4369
     }
4370 4370
 
@@ -4422,7 +4422,7 @@  discard block
 block discarded – undo
4422 4422
     }
4423 4423
 
4424 4424
     if (self::substr($str, $length - 1, 1) === ' ') {
4425
-      return self::substr($str, 0, $length - 1) . $strAddOn;
4425
+      return self::substr($str, 0, $length - 1).$strAddOn;
4426 4426
     }
4427 4427
 
4428 4428
     $str = self::substr($str, 0, $length);
@@ -4431,9 +4431,9 @@  discard block
 block discarded – undo
4431 4431
     $new_str = implode(' ', $array);
4432 4432
 
4433 4433
     if ($new_str === '') {
4434
-      $str = self::substr($str, 0, $length - 1) . $strAddOn;
4434
+      $str = self::substr($str, 0, $length - 1).$strAddOn;
4435 4435
     } else {
4436
-      $str = $new_str . $strAddOn;
4436
+      $str = $new_str.$strAddOn;
4437 4437
     }
4438 4438
 
4439 4439
     return $str;
@@ -4488,7 +4488,7 @@  discard block
 block discarded – undo
4488 4488
           $pre = '';
4489 4489
       }
4490 4490
 
4491
-      return $pre . $str . $post;
4491
+      return $pre.$str.$post;
4492 4492
     }
4493 4493
 
4494 4494
     return $str;
@@ -4638,7 +4638,7 @@  discard block
 block discarded – undo
4638 4638
     }
4639 4639
 
4640 4640
     /** @noinspection PhpInternalEntityUsedInspection */
4641
-    preg_match_all('/' . Grapheme::GRAPHEME_CLUSTER_RX . '/u', $str, $a);
4641
+    preg_match_all('/'.Grapheme::GRAPHEME_CLUSTER_RX.'/u', $str, $a);
4642 4642
     $a = $a[0];
4643 4643
 
4644 4644
     if ($len === 1) {
@@ -4833,7 +4833,7 @@  discard block
 block discarded – undo
4833 4833
   public static function strcmp($str1, $str2)
4834 4834
   {
4835 4835
     /** @noinspection PhpUndefinedClassInspection */
4836
-    return $str1 . '' === $str2 . '' ? 0 : strcmp(
4836
+    return $str1.'' === $str2.'' ? 0 : strcmp(
4837 4837
         \Normalizer::normalize($str1, \Normalizer::NFD),
4838 4838
         \Normalizer::normalize($str2, \Normalizer::NFD)
4839 4839
     );
@@ -4864,7 +4864,7 @@  discard block
 block discarded – undo
4864 4864
       return null;
4865 4865
     }
4866 4866
 
4867
-    if (preg_match('/^(.*?)' . self::rxClass($charList) . '/us', $str, $length)) {
4867
+    if (preg_match('/^(.*?)'.self::rxClass($charList).'/us', $str, $length)) {
4868 4868
       /** @noinspection OffsetOperationsInspection */
4869 4869
       return self::strlen($length[1]);
4870 4870
     }
@@ -5079,7 +5079,7 @@  discard block
 block discarded – undo
5079 5079
         &&
5080 5080
         self::$SUPPORT['mbstring'] === false
5081 5081
     ) {
5082
-      trigger_error('UTF8::stristr() without mbstring cannot handle "' . $encoding . '" encoding', E_USER_WARNING);
5082
+      trigger_error('UTF8::stristr() without mbstring cannot handle "'.$encoding.'" encoding', E_USER_WARNING);
5083 5083
     }
5084 5084
 
5085 5085
     if (self::$SUPPORT['mbstring'] === true) {
@@ -5096,7 +5096,7 @@  discard block
 block discarded – undo
5096 5096
       return \grapheme_stristr($haystack, $needle, $before_needle);
5097 5097
     }
5098 5098
 
5099
-    preg_match('/^(.*?)' . preg_quote($needle, '/') . '/usi', $haystack, $match);
5099
+    preg_match('/^(.*?)'.preg_quote($needle, '/').'/usi', $haystack, $match);
5100 5100
 
5101 5101
     if (!isset($match[1])) {
5102 5102
       return false;
@@ -5170,7 +5170,7 @@  discard block
 block discarded – undo
5170 5170
         &&
5171 5171
         self::$SUPPORT['iconv'] === false
5172 5172
     ) {
5173
-      trigger_error('UTF8::strlen() without mbstring / iconv cannot handle "' . $encoding . '" encoding', E_USER_WARNING);
5173
+      trigger_error('UTF8::strlen() without mbstring / iconv cannot handle "'.$encoding.'" encoding', E_USER_WARNING);
5174 5174
     }
5175 5175
 
5176 5176
     if (
@@ -5245,7 +5245,7 @@  discard block
 block discarded – undo
5245 5245
    */
5246 5246
   public static function strnatcmp($str1, $str2)
5247 5247
   {
5248
-    return $str1 . '' === $str2 . '' ? 0 : strnatcmp(self::strtonatfold($str1), self::strtonatfold($str2));
5248
+    return $str1.'' === $str2.'' ? 0 : strnatcmp(self::strtonatfold($str1), self::strtonatfold($str2));
5249 5249
   }
5250 5250
 
5251 5251
   /**
@@ -5306,7 +5306,7 @@  discard block
 block discarded – undo
5306 5306
       return false;
5307 5307
     }
5308 5308
 
5309
-    if (preg_match('/' . self::rxClass($char_list) . '/us', $haystack, $m)) {
5309
+    if (preg_match('/'.self::rxClass($char_list).'/us', $haystack, $m)) {
5310 5310
       return substr($haystack, strpos($haystack, $m[0]));
5311 5311
     } else {
5312 5312
       return false;
@@ -5383,7 +5383,7 @@  discard block
 block discarded – undo
5383 5383
         &&
5384 5384
         self::$SUPPORT['mbstring'] === false
5385 5385
     ) {
5386
-      trigger_error('UTF8::strpos() without mbstring / iconv cannot handle "' . $encoding . '" encoding', E_USER_WARNING);
5386
+      trigger_error('UTF8::strpos() without mbstring / iconv cannot handle "'.$encoding.'" encoding', E_USER_WARNING);
5387 5387
     }
5388 5388
 
5389 5389
     if (
@@ -5602,7 +5602,7 @@  discard block
 block discarded – undo
5602 5602
         &&
5603 5603
         self::$SUPPORT['mbstring'] === false
5604 5604
     ) {
5605
-      trigger_error('UTF8::strripos() without mbstring cannot handle "' . $encoding . '" encoding', E_USER_WARNING);
5605
+      trigger_error('UTF8::strripos() without mbstring cannot handle "'.$encoding.'" encoding', E_USER_WARNING);
5606 5606
     }
5607 5607
 
5608 5608
     if (self::$SUPPORT['mbstring'] === true) {
@@ -5685,7 +5685,7 @@  discard block
 block discarded – undo
5685 5685
         &&
5686 5686
         self::$SUPPORT['mbstring'] === false
5687 5687
     ) {
5688
-      trigger_error('UTF8::strrpos() without mbstring cannot handle "' . $encoding . '" encoding', E_USER_WARNING);
5688
+      trigger_error('UTF8::strrpos() without mbstring cannot handle "'.$encoding.'" encoding', E_USER_WARNING);
5689 5689
     }
5690 5690
 
5691 5691
     if (self::$SUPPORT['mbstring'] === true) {
@@ -5745,7 +5745,7 @@  discard block
 block discarded – undo
5745 5745
       return 0;
5746 5746
     }
5747 5747
 
5748
-    return preg_match('/^' . self::rxClass($mask) . '+/u', $str, $str) ? self::strlen($str[0]) : 0;
5748
+    return preg_match('/^'.self::rxClass($mask).'+/u', $str, $str) ? self::strlen($str[0]) : 0;
5749 5749
   }
5750 5750
 
5751 5751
   /**
@@ -5791,7 +5791,7 @@  discard block
 block discarded – undo
5791 5791
         &&
5792 5792
         self::$SUPPORT['mbstring'] === false
5793 5793
     ) {
5794
-      trigger_error('UTF8::strstr() without mbstring cannot handle "' . $encoding . '" encoding', E_USER_WARNING);
5794
+      trigger_error('UTF8::strstr() without mbstring cannot handle "'.$encoding.'" encoding', E_USER_WARNING);
5795 5795
     }
5796 5796
 
5797 5797
     if (self::$SUPPORT['mbstring'] === true) {
@@ -5808,7 +5808,7 @@  discard block
 block discarded – undo
5808 5808
       return \grapheme_strstr($haystack, $needle, $before_needle);
5809 5809
     }
5810 5810
 
5811
-    preg_match('/^(.*?)' . preg_quote($needle, '/') . '/us', $haystack, $match);
5811
+    preg_match('/^(.*?)'.preg_quote($needle, '/').'/us', $haystack, $match);
5812 5812
 
5813 5813
     if (!isset($match[1])) {
5814 5814
       return false;
@@ -6080,7 +6080,7 @@  discard block
 block discarded – undo
6080 6080
         &&
6081 6081
         self::$SUPPORT['mbstring'] === false
6082 6082
     ) {
6083
-      trigger_error('UTF8::substr() without mbstring cannot handle "' . $encoding . '" encoding', E_USER_WARNING);
6083
+      trigger_error('UTF8::substr() without mbstring cannot handle "'.$encoding.'" encoding', E_USER_WARNING);
6084 6084
     }
6085 6085
 
6086 6086
     if (self::$SUPPORT['mbstring'] === true) {
@@ -6199,14 +6199,14 @@  discard block
 block discarded – undo
6199 6199
         &&
6200 6200
         self::$SUPPORT['mbstring'] === false
6201 6201
     ) {
6202
-      trigger_error('UTF8::substr_count() without mbstring cannot handle "' . $encoding . '" encoding', E_USER_WARNING);
6202
+      trigger_error('UTF8::substr_count() without mbstring cannot handle "'.$encoding.'" encoding', E_USER_WARNING);
6203 6203
     }
6204 6204
 
6205 6205
     if (self::$SUPPORT['mbstring'] === true) {
6206 6206
       return \mb_substr_count($haystack, $needle, $encoding);
6207 6207
     }
6208 6208
 
6209
-    preg_match_all('/' . preg_quote($needle, '/') . '/us', $haystack, $matches, PREG_SET_ORDER);
6209
+    preg_match_all('/'.preg_quote($needle, '/').'/us', $haystack, $matches, PREG_SET_ORDER);
6210 6210
 
6211 6211
     return count($matches);
6212 6212
   }
@@ -6453,7 +6453,7 @@  discard block
 block discarded – undo
6453 6453
 
6454 6454
     $strSwappedCase = preg_replace_callback(
6455 6455
         '/[\S]/u',
6456
-        function ($match) use ($encoding) {
6456
+        function($match) use ($encoding) {
6457 6457
           $marchToUpper = UTF8::strtoupper($match[0], $encoding);
6458 6458
 
6459 6459
           if ($match[0] === $marchToUpper) {
@@ -6792,13 +6792,13 @@  discard block
 block discarded – undo
6792 6792
           $c2 = $i + 1 >= $max ? "\x00" : $str[$i + 1];
6793 6793
 
6794 6794
           if ($c2 >= "\x80" && $c2 <= "\xBF") { // yeah, almost sure it's UTF8 already
6795
-            $buf .= $c1 . $c2;
6795
+            $buf .= $c1.$c2;
6796 6796
             $i++;
6797 6797
           } else { // not valid UTF8 - convert it
6798 6798
             $cc1tmp = ord($c1) / 64;
6799 6799
             $cc1 = self::chr_and_parse_int($cc1tmp) | "\xC0";
6800 6800
             $cc2 = ($c1 & "\x3F") | "\x80";
6801
-            $buf .= $cc1 . $cc2;
6801
+            $buf .= $cc1.$cc2;
6802 6802
           }
6803 6803
 
6804 6804
         } elseif ($c1 >= "\xE0" && $c1 <= "\xEF") { // looks like 3 bytes UTF8
@@ -6807,13 +6807,13 @@  discard block
 block discarded – undo
6807 6807
           $c3 = $i + 2 >= $max ? "\x00" : $str[$i + 2];
6808 6808
 
6809 6809
           if ($c2 >= "\x80" && $c2 <= "\xBF" && $c3 >= "\x80" && $c3 <= "\xBF") { // yeah, almost sure it's UTF8 already
6810
-            $buf .= $c1 . $c2 . $c3;
6810
+            $buf .= $c1.$c2.$c3;
6811 6811
             $i += 2;
6812 6812
           } else { // not valid UTF8 - convert it
6813 6813
             $cc1tmp = ord($c1) / 64;
6814 6814
             $cc1 = self::chr_and_parse_int($cc1tmp) | "\xC0";
6815 6815
             $cc2 = ($c1 & "\x3F") | "\x80";
6816
-            $buf .= $cc1 . $cc2;
6816
+            $buf .= $cc1.$cc2;
6817 6817
           }
6818 6818
 
6819 6819
         } elseif ($c1 >= "\xF0" && $c1 <= "\xF7") { // looks like 4 bytes UTF8
@@ -6823,20 +6823,20 @@  discard block
 block discarded – undo
6823 6823
           $c4 = $i + 3 >= $max ? "\x00" : $str[$i + 3];
6824 6824
 
6825 6825
           if ($c2 >= "\x80" && $c2 <= "\xBF" && $c3 >= "\x80" && $c3 <= "\xBF" && $c4 >= "\x80" && $c4 <= "\xBF") { // yeah, almost sure it's UTF8 already
6826
-            $buf .= $c1 . $c2 . $c3 . $c4;
6826
+            $buf .= $c1.$c2.$c3.$c4;
6827 6827
             $i += 3;
6828 6828
           } else { // not valid UTF8 - convert it
6829 6829
             $cc1tmp = ord($c1) / 64;
6830 6830
             $cc1 = self::chr_and_parse_int($cc1tmp) | "\xC0";
6831 6831
             $cc2 = ($c1 & "\x3F") | "\x80";
6832
-            $buf .= $cc1 . $cc2;
6832
+            $buf .= $cc1.$cc2;
6833 6833
           }
6834 6834
 
6835 6835
         } else { // doesn't look like UTF8, but should be converted
6836 6836
           $cc1tmp = ord($c1) / 64;
6837 6837
           $cc1 = self::chr_and_parse_int($cc1tmp) | "\xC0";
6838 6838
           $cc2 = ($c1 & "\x3F") | "\x80";
6839
-          $buf .= $cc1 . $cc2;
6839
+          $buf .= $cc1.$cc2;
6840 6840
         }
6841 6841
 
6842 6842
       } elseif (($c1 & "\xC0") === "\x80") { // needs conversion
@@ -6847,7 +6847,7 @@  discard block
 block discarded – undo
6847 6847
         } else {
6848 6848
           $cc1 = self::chr_and_parse_int($ordC1 / 64) | "\xC0";
6849 6849
           $cc2 = ($c1 & "\x3F") | "\x80";
6850
-          $buf .= $cc1 . $cc2;
6850
+          $buf .= $cc1.$cc2;
6851 6851
         }
6852 6852
 
6853 6853
       } else { // it doesn't need conversion
@@ -6858,7 +6858,7 @@  discard block
 block discarded – undo
6858 6858
     // decode unicode escape sequences
6859 6859
     $buf = preg_replace_callback(
6860 6860
         '/\\\\u([0-9a-f]{4})/i',
6861
-        function ($match) {
6861
+        function($match) {
6862 6862
           return \mb_convert_encoding(pack('H*', $match[1]), 'UTF-8', 'UCS-2BE');
6863 6863
         },
6864 6864
         $buf
@@ -6912,7 +6912,7 @@  discard block
 block discarded – undo
6912 6912
    */
6913 6913
   public static function ucfirst($str, $encoding = 'UTF-8', $cleanUtf8 = false)
6914 6914
   {
6915
-    return self::strtoupper(self::substr($str, 0, 1, $encoding, $cleanUtf8), $encoding, $cleanUtf8) . self::substr($str, 1, null, $encoding, $cleanUtf8);
6915
+    return self::strtoupper(self::substr($str, 0, 1, $encoding, $cleanUtf8), $encoding, $cleanUtf8).self::substr($str, 1, null, $encoding, $cleanUtf8);
6916 6916
   }
6917 6917
 
6918 6918
   /**
@@ -7420,7 +7420,7 @@  discard block
 block discarded – undo
7420 7420
       return '';
7421 7421
     }
7422 7422
 
7423
-    preg_match('/^\s*+(?:\S++\s*+){1,' . $words . '}/u', $str, $matches);
7423
+    preg_match('/^\s*+(?:\S++\s*+){1,'.$words.'}/u', $str, $matches);
7424 7424
 
7425 7425
     if (
7426 7426
         !isset($matches[0])
@@ -7430,7 +7430,7 @@  discard block
 block discarded – undo
7430 7430
       return $str;
7431 7431
     }
7432 7432
 
7433
-    return self::rtrim($matches[0]) . $strAddOn;
7433
+    return self::rtrim($matches[0]).$strAddOn;
7434 7434
   }
7435 7435
 
7436 7436
   /**
@@ -7498,7 +7498,7 @@  discard block
 block discarded – undo
7498 7498
       $strReturn .= $break;
7499 7499
     }
7500 7500
 
7501
-    return $strReturn . implode('', $chars);
7501
+    return $strReturn.implode('', $chars);
7502 7502
   }
7503 7503
 
7504 7504
   /**
Please login to merge, or discard this patch.