Completed
Push — master ( e265ee...9d1d0d )
by Lars
03:05
created
src/voku/helper/UTF8.php 2 patches
Doc Comments   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -2816,7 +2816,7 @@  discard block
 block discarded – undo
2816 2816
   /**
2817 2817
    * Check if the input is binary... (is look like a hack).
2818 2818
    *
2819
-   * @param mixed $input
2819
+   * @param string $input
2820 2820
    *
2821 2821
    * @return bool
2822 2822
    */
@@ -5806,7 +5806,7 @@  discard block
 block discarded – undo
5806 5806
    * @link http://php.net/manual/en/function.mb-strrpos.php
5807 5807
    *
5808 5808
    * @param string     $haystack  <p>The string being checked, for the last occurrence of needle</p>
5809
-   * @param string|int $needle    <p>The string to find in haystack.<br />Or a code point as int.</p>
5809
+   * @param string $needle    <p>The string to find in haystack.<br />Or a code point as int.</p>
5810 5810
    * @param int        $offset    [optional] <p>May be specified to begin searching an arbitrary number of characters
5811 5811
    *                              into the string. Negative values will stop searching at an arbitrary point prior to
5812 5812
    *                              the end of the string.
@@ -6583,8 +6583,8 @@  discard block
 block discarded – undo
6583 6583
    *
6584 6584
    * source: https://gist.github.com/stemar/8287074
6585 6585
    *
6586
-   * @param string|string[] $str              <p>The input string or an array of stings.</p>
6587
-   * @param string|string[] $replacement      <p>The replacement string or an array of stings.</p>
6586
+   * @param string $str              <p>The input string or an array of stings.</p>
6587
+   * @param string $replacement      <p>The replacement string or an array of stings.</p>
6588 6588
    * @param int|int[]       $offset           <p>
6589 6589
    *                                          If start is positive, the replacing will begin at the start'th offset
6590 6590
    *                                          into string.
@@ -6592,7 +6592,7 @@  discard block
 block discarded – undo
6592 6592
    *                                          If start is negative, the replacing will begin at the start'th character
6593 6593
    *                                          from the end of string.
6594 6594
    *                                          </p>
6595
-   * @param int|int[]|void  $length           [optional] <p>If given and is positive, it represents the length of the
6595
+   * @param integer|null  $length           [optional] <p>If given and is positive, it represents the length of the
6596 6596
    *                                          portion of string which is to be replaced. If it is negative, it
6597 6597
    *                                          represents the number of characters from the end of string at which to
6598 6598
    *                                          stop replacing. If it is not given, then it will default to strlen(
@@ -7027,7 +7027,7 @@  discard block
 block discarded – undo
7027 7027
    * case.</li>
7028 7028
    * </ul>
7029 7029
    *
7030
-   * @param string|string[] $str                    <p>Any string or array.</p>
7030
+   * @param string $str                    <p>Any string or array.</p>
7031 7031
    * @param bool            $decodeHtmlEntityToUtf8 <p>Set to true, if you need to decode html-entities.</p>
7032 7032
    *
7033 7033
    * @return string|string[] <p>The UTF-8 encoded string.</p>
Please login to merge, or discard this patch.
Spacing   +74 added lines, -74 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;
@@ -975,7 +975,7 @@  discard block
 block discarded – undo
975 975
 
976 976
     // use static cache, only if there is no support for "\IntlChar"
977 977
     static $CHAR_CACHE = array();
978
-    $cacheKey = $code_point . $encoding;
978
+    $cacheKey = $code_point.$encoding;
979 979
     if (isset($CHAR_CACHE[$cacheKey]) === true) {
980 980
       return $CHAR_CACHE[$cacheKey];
981 981
     }
@@ -983,16 +983,16 @@  discard block
 block discarded – undo
983 983
     if (0x80 > $code_point %= 0x200000) {
984 984
       $str = self::chr_and_parse_int($code_point);
985 985
     } elseif (0x800 > $code_point) {
986
-      $str = self::chr_and_parse_int(0xC0 | $code_point >> 6) .
986
+      $str = self::chr_and_parse_int(0xC0 | $code_point >> 6).
987 987
              self::chr_and_parse_int(0x80 | $code_point & 0x3F);
988 988
     } elseif (0x10000 > $code_point) {
989
-      $str = self::chr_and_parse_int(0xE0 | $code_point >> 12) .
990
-             self::chr_and_parse_int(0x80 | $code_point >> 6 & 0x3F) .
989
+      $str = self::chr_and_parse_int(0xE0 | $code_point >> 12).
990
+             self::chr_and_parse_int(0x80 | $code_point >> 6 & 0x3F).
991 991
              self::chr_and_parse_int(0x80 | $code_point & 0x3F);
992 992
     } else {
993
-      $str = self::chr_and_parse_int(0xF0 | $code_point >> 18) .
994
-             self::chr_and_parse_int(0x80 | $code_point >> 12 & 0x3F) .
995
-             self::chr_and_parse_int(0x80 | $code_point >> 6 & 0x3F) .
993
+      $str = self::chr_and_parse_int(0xF0 | $code_point >> 18).
994
+             self::chr_and_parse_int(0x80 | $code_point >> 12 & 0x3F).
995
+             self::chr_and_parse_int(0x80 | $code_point >> 6 & 0x3F).
996 996
              self::chr_and_parse_int(0x80 | $code_point & 0x3F);
997 997
     }
998 998
 
@@ -1052,7 +1052,7 @@  discard block
 block discarded – undo
1052 1052
     }
1053 1053
 
1054 1054
     return array_map(
1055
-        function ($data) {
1055
+        function($data) {
1056 1056
           return UTF8::strlen($data, '8BIT');
1057 1057
         },
1058 1058
         self::split($str)
@@ -1294,7 +1294,7 @@  discard block
 block discarded – undo
1294 1294
       $flags = ENT_QUOTES;
1295 1295
     }
1296 1296
 
1297
-    return self::html_entity_decode('&#' . $int . ';', $flags);
1297
+    return self::html_entity_decode('&#'.$int.';', $flags);
1298 1298
   }
1299 1299
 
1300 1300
   /**
@@ -1371,7 +1371,7 @@  discard block
 block discarded – undo
1371 1371
           &&
1372 1372
           self::$SUPPORT['mbstring'] === false
1373 1373
       ) {
1374
-        trigger_error('UTF8::encode() without mbstring cannot handle "' . $encoding . '" encoding', E_USER_WARNING);
1374
+        trigger_error('UTF8::encode() without mbstring cannot handle "'.$encoding.'" encoding', E_USER_WARNING);
1375 1375
       }
1376 1376
 
1377 1377
       $strEncoded = \mb_convert_encoding(
@@ -1580,7 +1580,7 @@  discard block
 block discarded – undo
1580 1580
           ) {
1581 1581
             // Prevent leading combining chars
1582 1582
             // for NFC-safe concatenations.
1583
-            $var = $leading_combining . $var;
1583
+            $var = $leading_combining.$var;
1584 1584
           }
1585 1585
         }
1586 1586
 
@@ -2004,7 +2004,7 @@  discard block
 block discarded – undo
2004 2004
    */
2005 2005
   private static function getData($file)
2006 2006
   {
2007
-    $file = __DIR__ . '/data/' . $file . '.php';
2007
+    $file = __DIR__.'/data/'.$file.'.php';
2008 2008
     if (file_exists($file)) {
2009 2009
       /** @noinspection PhpIncludeInspection */
2010 2010
       return require $file;
@@ -2149,7 +2149,7 @@  discard block
 block discarded – undo
2149 2149
     return implode(
2150 2150
         '',
2151 2151
         array_map(
2152
-            function ($data) use ($keepAsciiChars, $encoding) {
2152
+            function($data) use ($keepAsciiChars, $encoding) {
2153 2153
               return UTF8::single_chr_html_encode($data, $keepAsciiChars, $encoding);
2154 2154
             },
2155 2155
             self::split($str)
@@ -2268,7 +2268,7 @@  discard block
 block discarded – undo
2268 2268
 
2269 2269
       $str = preg_replace_callback(
2270 2270
           "/&#\d{2,6};/",
2271
-          function ($matches) use ($encoding) {
2271
+          function($matches) use ($encoding) {
2272 2272
             $returnTmp = \mb_convert_encoding($matches[0], $encoding, 'HTML-ENTITIES');
2273 2273
 
2274 2274
             if ($returnTmp !== '"' && $returnTmp !== "'") {
@@ -2592,9 +2592,9 @@  discard block
 block discarded – undo
2592 2592
     if ((int)$int === $int) {
2593 2593
       $hex = dechex($int);
2594 2594
 
2595
-      $hex = (strlen($hex) < 4 ? substr('0000' . $hex, -4) : $hex);
2595
+      $hex = (strlen($hex) < 4 ? substr('0000'.$hex, -4) : $hex);
2596 2596
 
2597
-      return $pfix . $hex;
2597
+      return $pfix.$hex;
2598 2598
     }
2599 2599
 
2600 2600
     return '';
@@ -3335,7 +3335,7 @@  discard block
 block discarded – undo
3335 3335
         $cleanUtf8
3336 3336
     );
3337 3337
 
3338
-    return $strPartOne . $strPartTwo;
3338
+    return $strPartOne.$strPartTwo;
3339 3339
   }
3340 3340
 
3341 3341
   /**
@@ -3425,7 +3425,7 @@  discard block
 block discarded – undo
3425 3425
       return preg_replace('/^[\pZ\pC]+/u', '', $str);
3426 3426
     }
3427 3427
 
3428
-    return preg_replace('/^' . self::rxClass($chars) . '+/u', '', $str);
3428
+    return preg_replace('/^'.self::rxClass($chars).'+/u', '', $str);
3429 3429
   }
3430 3430
 
3431 3431
   /**
@@ -3965,7 +3965,7 @@  discard block
 block discarded – undo
3965 3965
     if (is_array($what) === true) {
3966 3966
       /** @noinspection ForeachSourceInspection */
3967 3967
       foreach ($what as $item) {
3968
-        $str = preg_replace('/(' . preg_quote($item, '/') . ')+/', $item, $str);
3968
+        $str = preg_replace('/('.preg_quote($item, '/').')+/', $item, $str);
3969 3969
       }
3970 3970
     }
3971 3971
 
@@ -4078,7 +4078,7 @@  discard block
 block discarded – undo
4078 4078
       return preg_replace('/[\pZ\pC]+$/u', '', $str);
4079 4079
     }
4080 4080
 
4081
-    return preg_replace('/' . self::rxClass($chars) . '+$/u', '', $str);
4081
+    return preg_replace('/'.self::rxClass($chars).'+$/u', '', $str);
4082 4082
   }
4083 4083
 
4084 4084
   /**
@@ -4093,7 +4093,7 @@  discard block
 block discarded – undo
4093 4093
   {
4094 4094
     static $RX_CLASSS_CACHE = array();
4095 4095
 
4096
-    $cacheKey = $s . $class;
4096
+    $cacheKey = $s.$class;
4097 4097
 
4098 4098
     if (isset($RX_CLASSS_CACHE[$cacheKey])) {
4099 4099
       return $RX_CLASSS_CACHE[$cacheKey];
@@ -4105,7 +4105,7 @@  discard block
 block discarded – undo
4105 4105
     /** @noinspection SuspiciousLoopInspection */
4106 4106
     foreach (self::str_split($s) as $s) {
4107 4107
       if ('-' === $s) {
4108
-        $class[0] = '-' . $class[0];
4108
+        $class[0] = '-'.$class[0];
4109 4109
       } elseif (!isset($s[2])) {
4110 4110
         $class[0] .= preg_quote($s, '/');
4111 4111
       } elseif (1 === self::strlen($s)) {
@@ -4116,13 +4116,13 @@  discard block
 block discarded – undo
4116 4116
     }
4117 4117
 
4118 4118
     if ($class[0]) {
4119
-      $class[0] = '[' . $class[0] . ']';
4119
+      $class[0] = '['.$class[0].']';
4120 4120
     }
4121 4121
 
4122 4122
     if (1 === count($class)) {
4123 4123
       $return = $class[0];
4124 4124
     } else {
4125
-      $return = '(?:' . implode('|', $class) . ')';
4125
+      $return = '(?:'.implode('|', $class).')';
4126 4126
     }
4127 4127
 
4128 4128
     $RX_CLASSS_CACHE[$cacheKey] = $return;
@@ -4140,7 +4140,7 @@  discard block
 block discarded – undo
4140 4140
     }
4141 4141
 
4142 4142
     foreach (self::$SUPPORT as $utf8Support) {
4143
-      echo $utf8Support . "\n<br>";
4143
+      echo $utf8Support."\n<br>";
4144 4144
     }
4145 4145
   }
4146 4146
 
@@ -4174,7 +4174,7 @@  discard block
 block discarded – undo
4174 4174
       $encoding = self::normalize_encoding($encoding, 'UTF-8');
4175 4175
     }
4176 4176
 
4177
-    return '&#' . self::ord($char, $encoding) . ';';
4177
+    return '&#'.self::ord($char, $encoding).';';
4178 4178
   }
4179 4179
 
4180 4180
   /**
@@ -4241,7 +4241,7 @@  discard block
 block discarded – undo
4241 4241
         ) {
4242 4242
 
4243 4243
           if (($str[$i + 1] & "\xC0") === "\x80") {
4244
-            $ret[] = $str[$i] . $str[$i + 1];
4244
+            $ret[] = $str[$i].$str[$i + 1];
4245 4245
 
4246 4246
             $i++;
4247 4247
           }
@@ -4257,7 +4257,7 @@  discard block
 block discarded – undo
4257 4257
               &&
4258 4258
               ($str[$i + 2] & "\xC0") === "\x80"
4259 4259
           ) {
4260
-            $ret[] = $str[$i] . $str[$i + 1] . $str[$i + 2];
4260
+            $ret[] = $str[$i].$str[$i + 1].$str[$i + 2];
4261 4261
 
4262 4262
             $i += 2;
4263 4263
           }
@@ -4275,7 +4275,7 @@  discard block
 block discarded – undo
4275 4275
               &&
4276 4276
               ($str[$i + 3] & "\xC0") === "\x80"
4277 4277
           ) {
4278
-            $ret[] = $str[$i] . $str[$i + 1] . $str[$i + 2] . $str[$i + 3];
4278
+            $ret[] = $str[$i].$str[$i + 1].$str[$i + 2].$str[$i + 3];
4279 4279
 
4280 4280
             $i += 3;
4281 4281
           }
@@ -4288,7 +4288,7 @@  discard block
 block discarded – undo
4288 4288
       $ret = array_chunk($ret, $length);
4289 4289
 
4290 4290
       return array_map(
4291
-          function ($item) {
4291
+          function($item) {
4292 4292
             return implode('', $item);
4293 4293
           }, $ret
4294 4294
       );
@@ -4395,7 +4395,7 @@  discard block
 block discarded – undo
4395 4395
     foreach (self::$ICONV_ENCODING as $encodingTmp) {
4396 4396
       # INFO: //IGNORE and //TRANSLIT still throw notice
4397 4397
       /** @noinspection PhpUsageOfSilenceOperatorInspection */
4398
-      if (md5(@\iconv($encodingTmp, $encodingTmp . '//IGNORE', $str)) === $md5) {
4398
+      if (md5(@\iconv($encodingTmp, $encodingTmp.'//IGNORE', $str)) === $md5) {
4399 4399
         return $encodingTmp;
4400 4400
       }
4401 4401
     }
@@ -4490,7 +4490,7 @@  discard block
 block discarded – undo
4490 4490
       if ('' === $s .= '') {
4491 4491
         $s = '/^(?<=.)$/';
4492 4492
       } else {
4493
-        $s = '/' . preg_quote($s, '/') . '/ui';
4493
+        $s = '/'.preg_quote($s, '/').'/ui';
4494 4494
       }
4495 4495
     }
4496 4496
 
@@ -4548,7 +4548,7 @@  discard block
 block discarded – undo
4548 4548
     }
4549 4549
 
4550 4550
     if (self::substr($str, $length - 1, 1) === ' ') {
4551
-      return (string)self::substr($str, 0, $length - 1) . $strAddOn;
4551
+      return (string)self::substr($str, 0, $length - 1).$strAddOn;
4552 4552
     }
4553 4553
 
4554 4554
     $str = (string)self::substr($str, 0, $length);
@@ -4557,9 +4557,9 @@  discard block
 block discarded – undo
4557 4557
     $new_str = implode(' ', $array);
4558 4558
 
4559 4559
     if ($new_str === '') {
4560
-      $str = (string)self::substr($str, 0, $length - 1) . $strAddOn;
4560
+      $str = (string)self::substr($str, 0, $length - 1).$strAddOn;
4561 4561
     } else {
4562
-      $str = $new_str . $strAddOn;
4562
+      $str = $new_str.$strAddOn;
4563 4563
     }
4564 4564
 
4565 4565
     return $str;
@@ -4614,7 +4614,7 @@  discard block
 block discarded – undo
4614 4614
           $pre = '';
4615 4615
       }
4616 4616
 
4617
-      return $pre . $str . $post;
4617
+      return $pre.$str.$post;
4618 4618
     }
4619 4619
 
4620 4620
     return $str;
@@ -4764,7 +4764,7 @@  discard block
 block discarded – undo
4764 4764
     }
4765 4765
 
4766 4766
     /** @noinspection PhpInternalEntityUsedInspection */
4767
-    preg_match_all('/' . Grapheme::GRAPHEME_CLUSTER_RX . '/u', $str, $a);
4767
+    preg_match_all('/'.Grapheme::GRAPHEME_CLUSTER_RX.'/u', $str, $a);
4768 4768
     $a = $a[0];
4769 4769
 
4770 4770
     if ($len === 1) {
@@ -5001,7 +5001,7 @@  discard block
 block discarded – undo
5001 5001
   public static function strcmp($str1, $str2)
5002 5002
   {
5003 5003
     /** @noinspection PhpUndefinedClassInspection */
5004
-    return $str1 . '' === $str2 . '' ? 0 : strcmp(
5004
+    return $str1.'' === $str2.'' ? 0 : strcmp(
5005 5005
         \Normalizer::normalize($str1, \Normalizer::NFD),
5006 5006
         \Normalizer::normalize($str2, \Normalizer::NFD)
5007 5007
     );
@@ -5036,7 +5036,7 @@  discard block
 block discarded – undo
5036 5036
       return null;
5037 5037
     }
5038 5038
 
5039
-    if (preg_match('/^(.*?)' . self::rxClass($charList) . '/us', $str, $length)) {
5039
+    if (preg_match('/^(.*?)'.self::rxClass($charList).'/us', $str, $length)) {
5040 5040
       /** @noinspection OffsetOperationsInspection */
5041 5041
       return self::strlen($length[1]);
5042 5042
     }
@@ -5251,7 +5251,7 @@  discard block
 block discarded – undo
5251 5251
         &&
5252 5252
         self::$SUPPORT['mbstring'] === false
5253 5253
     ) {
5254
-      trigger_error('UTF8::stristr() without mbstring cannot handle "' . $encoding . '" encoding', E_USER_WARNING);
5254
+      trigger_error('UTF8::stristr() without mbstring cannot handle "'.$encoding.'" encoding', E_USER_WARNING);
5255 5255
     }
5256 5256
 
5257 5257
     if (self::$SUPPORT['mbstring'] === true) {
@@ -5268,7 +5268,7 @@  discard block
 block discarded – undo
5268 5268
       return \grapheme_stristr($haystack, $needle, $before_needle);
5269 5269
     }
5270 5270
 
5271
-    preg_match('/^(.*?)' . preg_quote($needle, '/') . '/usi', $haystack, $match);
5271
+    preg_match('/^(.*?)'.preg_quote($needle, '/').'/usi', $haystack, $match);
5272 5272
 
5273 5273
     if (!isset($match[1])) {
5274 5274
       return false;
@@ -5342,7 +5342,7 @@  discard block
 block discarded – undo
5342 5342
         &&
5343 5343
         self::$SUPPORT['iconv'] === false
5344 5344
     ) {
5345
-      trigger_error('UTF8::strlen() without mbstring / iconv cannot handle "' . $encoding . '" encoding', E_USER_WARNING);
5345
+      trigger_error('UTF8::strlen() without mbstring / iconv cannot handle "'.$encoding.'" encoding', E_USER_WARNING);
5346 5346
     }
5347 5347
 
5348 5348
     if (
@@ -5417,7 +5417,7 @@  discard block
 block discarded – undo
5417 5417
    */
5418 5418
   public static function strnatcmp($str1, $str2)
5419 5419
   {
5420
-    return $str1 . '' === $str2 . '' ? 0 : strnatcmp(self::strtonatfold($str1), self::strtonatfold($str2));
5420
+    return $str1.'' === $str2.'' ? 0 : strnatcmp(self::strtonatfold($str1), self::strtonatfold($str2));
5421 5421
   }
5422 5422
 
5423 5423
   /**
@@ -5478,7 +5478,7 @@  discard block
 block discarded – undo
5478 5478
       return false;
5479 5479
     }
5480 5480
 
5481
-    if (preg_match('/' . self::rxClass($char_list) . '/us', $haystack, $m)) {
5481
+    if (preg_match('/'.self::rxClass($char_list).'/us', $haystack, $m)) {
5482 5482
       return substr($haystack, strpos($haystack, $m[0]));
5483 5483
     }
5484 5484
 
@@ -5555,7 +5555,7 @@  discard block
 block discarded – undo
5555 5555
         &&
5556 5556
         self::$SUPPORT['mbstring'] === false
5557 5557
     ) {
5558
-      trigger_error('UTF8::strpos() without mbstring / iconv cannot handle "' . $encoding . '" encoding', E_USER_WARNING);
5558
+      trigger_error('UTF8::strpos() without mbstring / iconv cannot handle "'.$encoding.'" encoding', E_USER_WARNING);
5559 5559
     }
5560 5560
 
5561 5561
     if (
@@ -5778,7 +5778,7 @@  discard block
 block discarded – undo
5778 5778
         &&
5779 5779
         self::$SUPPORT['mbstring'] === false
5780 5780
     ) {
5781
-      trigger_error('UTF8::strripos() without mbstring cannot handle "' . $encoding . '" encoding', E_USER_WARNING);
5781
+      trigger_error('UTF8::strripos() without mbstring cannot handle "'.$encoding.'" encoding', E_USER_WARNING);
5782 5782
     }
5783 5783
 
5784 5784
     if (self::$SUPPORT['mbstring'] === true) {
@@ -5861,7 +5861,7 @@  discard block
 block discarded – undo
5861 5861
         &&
5862 5862
         self::$SUPPORT['mbstring'] === false
5863 5863
     ) {
5864
-      trigger_error('UTF8::strrpos() without mbstring cannot handle "' . $encoding . '" encoding', E_USER_WARNING);
5864
+      trigger_error('UTF8::strrpos() without mbstring cannot handle "'.$encoding.'" encoding', E_USER_WARNING);
5865 5865
     }
5866 5866
 
5867 5867
     if (self::$SUPPORT['mbstring'] === true) {
@@ -5929,7 +5929,7 @@  discard block
 block discarded – undo
5929 5929
       return 0;
5930 5930
     }
5931 5931
 
5932
-    return preg_match('/^' . self::rxClass($mask) . '+/u', $str, $str) ? self::strlen($str[0]) : 0;
5932
+    return preg_match('/^'.self::rxClass($mask).'+/u', $str, $str) ? self::strlen($str[0]) : 0;
5933 5933
   }
5934 5934
 
5935 5935
   /**
@@ -5975,7 +5975,7 @@  discard block
 block discarded – undo
5975 5975
         &&
5976 5976
         self::$SUPPORT['mbstring'] === false
5977 5977
     ) {
5978
-      trigger_error('UTF8::strstr() without mbstring cannot handle "' . $encoding . '" encoding', E_USER_WARNING);
5978
+      trigger_error('UTF8::strstr() without mbstring cannot handle "'.$encoding.'" encoding', E_USER_WARNING);
5979 5979
     }
5980 5980
 
5981 5981
     if (self::$SUPPORT['mbstring'] === true) {
@@ -5992,7 +5992,7 @@  discard block
 block discarded – undo
5992 5992
       return \grapheme_strstr($haystack, $needle, $before_needle);
5993 5993
     }
5994 5994
 
5995
-    preg_match('/^(.*?)' . preg_quote($needle, '/') . '/us', $haystack, $match);
5995
+    preg_match('/^(.*?)'.preg_quote($needle, '/').'/us', $haystack, $match);
5996 5996
 
5997 5997
     if (!isset($match[1])) {
5998 5998
       return false;
@@ -6099,9 +6099,9 @@  discard block
 block discarded – undo
6099 6099
           Bootup::is_php('5.4') === true
6100 6100
       ) {
6101 6101
 
6102
-        $langCode = $lang . '-Lower';
6102
+        $langCode = $lang.'-Lower';
6103 6103
         if (!in_array($langCode, self::$SUPPORT['intl__transliterator_list_ids'], true)) {
6104
-          trigger_error('UTF8::strtolower() without intl for special language: ' . $lang, E_USER_WARNING);
6104
+          trigger_error('UTF8::strtolower() without intl for special language: '.$lang, E_USER_WARNING);
6105 6105
 
6106 6106
           $langCode = 'Any-Lower';
6107 6107
         }
@@ -6109,7 +6109,7 @@  discard block
 block discarded – undo
6109 6109
         return transliterator_transliterate($langCode, $str);
6110 6110
       }
6111 6111
 
6112
-      trigger_error('UTF8::strtolower() without intl + PHP >= 5.4 cannot handle the "lang"-parameter: ' . $lang, E_USER_WARNING);
6112
+      trigger_error('UTF8::strtolower() without intl + PHP >= 5.4 cannot handle the "lang"-parameter: '.$lang, E_USER_WARNING);
6113 6113
     }
6114 6114
 
6115 6115
     return \mb_strtolower($str, $encoding);
@@ -6169,9 +6169,9 @@  discard block
 block discarded – undo
6169 6169
           Bootup::is_php('5.4') === true
6170 6170
       ) {
6171 6171
 
6172
-        $langCode = $lang . '-Upper';
6172
+        $langCode = $lang.'-Upper';
6173 6173
         if (!in_array($langCode, self::$SUPPORT['intl__transliterator_list_ids'], true)) {
6174
-          trigger_error('UTF8::strtoupper() without intl for special language: ' . $lang, E_USER_WARNING);
6174
+          trigger_error('UTF8::strtoupper() without intl for special language: '.$lang, E_USER_WARNING);
6175 6175
 
6176 6176
           $langCode = 'Any-Upper';
6177 6177
         }
@@ -6179,7 +6179,7 @@  discard block
 block discarded – undo
6179 6179
         return transliterator_transliterate($langCode, $str);
6180 6180
       }
6181 6181
 
6182
-      trigger_error('UTF8::strtolower() without intl + PHP >= 5.4 cannot handle the "lang"-parameter: ' . $lang, E_USER_WARNING);
6182
+      trigger_error('UTF8::strtolower() without intl + PHP >= 5.4 cannot handle the "lang"-parameter: '.$lang, E_USER_WARNING);
6183 6183
     }
6184 6184
 
6185 6185
     return \mb_strtoupper($str, $encoding);
@@ -6316,7 +6316,7 @@  discard block
 block discarded – undo
6316 6316
         &&
6317 6317
         self::$SUPPORT['mbstring'] === false
6318 6318
     ) {
6319
-      trigger_error('UTF8::substr() without mbstring cannot handle "' . $encoding . '" encoding', E_USER_WARNING);
6319
+      trigger_error('UTF8::substr() without mbstring cannot handle "'.$encoding.'" encoding', E_USER_WARNING);
6320 6320
     }
6321 6321
 
6322 6322
     if (self::$SUPPORT['mbstring'] === true) {
@@ -6467,14 +6467,14 @@  discard block
 block discarded – undo
6467 6467
         &&
6468 6468
         self::$SUPPORT['mbstring'] === false
6469 6469
     ) {
6470
-      trigger_error('UTF8::substr_count() without mbstring cannot handle "' . $encoding . '" encoding', E_USER_WARNING);
6470
+      trigger_error('UTF8::substr_count() without mbstring cannot handle "'.$encoding.'" encoding', E_USER_WARNING);
6471 6471
     }
6472 6472
 
6473 6473
     if (self::$SUPPORT['mbstring'] === true) {
6474 6474
       return \mb_substr_count($haystack, $needle, $encoding);
6475 6475
     }
6476 6476
 
6477
-    preg_match_all('/' . preg_quote($needle, '/') . '/us', $haystack, $matches, PREG_SET_ORDER);
6477
+    preg_match_all('/'.preg_quote($needle, '/').'/us', $haystack, $matches, PREG_SET_ORDER);
6478 6478
 
6479 6479
     return count($matches);
6480 6480
   }
@@ -6736,7 +6736,7 @@  discard block
 block discarded – undo
6736 6736
 
6737 6737
     $strSwappedCase = preg_replace_callback(
6738 6738
         '/[\S]/u',
6739
-        function ($match) use ($encoding) {
6739
+        function($match) use ($encoding) {
6740 6740
           $marchToUpper = UTF8::strtoupper($match[0], $encoding);
6741 6741
 
6742 6742
           if ($match[0] === $marchToUpper) {
@@ -7075,13 +7075,13 @@  discard block
 block discarded – undo
7075 7075
           $c2 = $i + 1 >= $max ? "\x00" : $str[$i + 1];
7076 7076
 
7077 7077
           if ($c2 >= "\x80" && $c2 <= "\xBF") { // yeah, almost sure it's UTF8 already
7078
-            $buf .= $c1 . $c2;
7078
+            $buf .= $c1.$c2;
7079 7079
             $i++;
7080 7080
           } else { // not valid UTF8 - convert it
7081 7081
             $cc1tmp = ord($c1) / 64;
7082 7082
             $cc1 = self::chr_and_parse_int($cc1tmp) | "\xC0";
7083 7083
             $cc2 = ($c1 & "\x3F") | "\x80";
7084
-            $buf .= $cc1 . $cc2;
7084
+            $buf .= $cc1.$cc2;
7085 7085
           }
7086 7086
 
7087 7087
         } elseif ($c1 >= "\xE0" && $c1 <= "\xEF") { // looks like 3 bytes UTF8
@@ -7090,13 +7090,13 @@  discard block
 block discarded – undo
7090 7090
           $c3 = $i + 2 >= $max ? "\x00" : $str[$i + 2];
7091 7091
 
7092 7092
           if ($c2 >= "\x80" && $c2 <= "\xBF" && $c3 >= "\x80" && $c3 <= "\xBF") { // yeah, almost sure it's UTF8 already
7093
-            $buf .= $c1 . $c2 . $c3;
7093
+            $buf .= $c1.$c2.$c3;
7094 7094
             $i += 2;
7095 7095
           } else { // not valid UTF8 - convert it
7096 7096
             $cc1tmp = ord($c1) / 64;
7097 7097
             $cc1 = self::chr_and_parse_int($cc1tmp) | "\xC0";
7098 7098
             $cc2 = ($c1 & "\x3F") | "\x80";
7099
-            $buf .= $cc1 . $cc2;
7099
+            $buf .= $cc1.$cc2;
7100 7100
           }
7101 7101
 
7102 7102
         } elseif ($c1 >= "\xF0" && $c1 <= "\xF7") { // looks like 4 bytes UTF8
@@ -7106,20 +7106,20 @@  discard block
 block discarded – undo
7106 7106
           $c4 = $i + 3 >= $max ? "\x00" : $str[$i + 3];
7107 7107
 
7108 7108
           if ($c2 >= "\x80" && $c2 <= "\xBF" && $c3 >= "\x80" && $c3 <= "\xBF" && $c4 >= "\x80" && $c4 <= "\xBF") { // yeah, almost sure it's UTF8 already
7109
-            $buf .= $c1 . $c2 . $c3 . $c4;
7109
+            $buf .= $c1.$c2.$c3.$c4;
7110 7110
             $i += 3;
7111 7111
           } else { // not valid UTF8 - convert it
7112 7112
             $cc1tmp = ord($c1) / 64;
7113 7113
             $cc1 = self::chr_and_parse_int($cc1tmp) | "\xC0";
7114 7114
             $cc2 = ($c1 & "\x3F") | "\x80";
7115
-            $buf .= $cc1 . $cc2;
7115
+            $buf .= $cc1.$cc2;
7116 7116
           }
7117 7117
 
7118 7118
         } else { // doesn't look like UTF8, but should be converted
7119 7119
           $cc1tmp = ord($c1) / 64;
7120 7120
           $cc1 = self::chr_and_parse_int($cc1tmp) | "\xC0";
7121 7121
           $cc2 = ($c1 & "\x3F") | "\x80";
7122
-          $buf .= $cc1 . $cc2;
7122
+          $buf .= $cc1.$cc2;
7123 7123
         }
7124 7124
 
7125 7125
       } elseif (($c1 & "\xC0") === "\x80") { // needs conversion
@@ -7130,7 +7130,7 @@  discard block
 block discarded – undo
7130 7130
         } else {
7131 7131
           $cc1 = self::chr_and_parse_int($ordC1 / 64) | "\xC0";
7132 7132
           $cc2 = ($c1 & "\x3F") | "\x80";
7133
-          $buf .= $cc1 . $cc2;
7133
+          $buf .= $cc1.$cc2;
7134 7134
         }
7135 7135
 
7136 7136
       } else { // it doesn't need conversion
@@ -7141,7 +7141,7 @@  discard block
 block discarded – undo
7141 7141
     // decode unicode escape sequences
7142 7142
     $buf = preg_replace_callback(
7143 7143
         '/\\\\u([0-9a-f]{4})/i',
7144
-        function ($match) {
7144
+        function($match) {
7145 7145
           return \mb_convert_encoding(pack('H*', $match[1]), 'UTF-8', 'UCS-2BE');
7146 7146
         },
7147 7147
         $buf
@@ -7206,7 +7206,7 @@  discard block
 block discarded – undo
7206 7206
         $cleanUtf8
7207 7207
     );
7208 7208
 
7209
-    return $strPartOne . $strPartTwo;
7209
+    return $strPartOne.$strPartTwo;
7210 7210
   }
7211 7211
 
7212 7212
   /**
@@ -7717,7 +7717,7 @@  discard block
 block discarded – undo
7717 7717
       return '';
7718 7718
     }
7719 7719
 
7720
-    preg_match('/^\s*+(?:\S++\s*+){1,' . $words . '}/u', $str, $matches);
7720
+    preg_match('/^\s*+(?:\S++\s*+){1,'.$words.'}/u', $str, $matches);
7721 7721
 
7722 7722
     if (
7723 7723
         !isset($matches[0])
@@ -7727,7 +7727,7 @@  discard block
 block discarded – undo
7727 7727
       return $str;
7728 7728
     }
7729 7729
 
7730
-    return self::rtrim($matches[0]) . $strAddOn;
7730
+    return self::rtrim($matches[0]).$strAddOn;
7731 7731
   }
7732 7732
 
7733 7733
   /**
@@ -7795,7 +7795,7 @@  discard block
 block discarded – undo
7795 7795
       $strReturn .= $break;
7796 7796
     }
7797 7797
 
7798
-    return $strReturn . implode('', $chars);
7798
+    return $strReturn.implode('', $chars);
7799 7799
   }
7800 7800
 
7801 7801
   /**
Please login to merge, or discard this patch.