Completed
Push — master ( d7d49c...5343dd )
by Lars
06:41
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, -76 removed lines patch added patch discarded remove patch
@@ -855,7 +855,7 @@  discard block
 block discarded – undo
855 855
   public static function add_bom_to_string($str)
856 856
   {
857 857
     if (self::string_has_bom($str) === false) {
858
-      $str = self::bom() . $str;
858
+      $str = self::bom().$str;
859 859
     }
860 860
 
861 861
     return $str;
@@ -980,7 +980,7 @@  discard block
 block discarded – undo
980 980
 
981 981
     // use static cache, only if there is no support for "\IntlChar"
982 982
     static $CHAR_CACHE = array();
983
-    $cacheKey = $code_point . $encoding;
983
+    $cacheKey = $code_point.$encoding;
984 984
     if (isset($CHAR_CACHE[$cacheKey]) === true) {
985 985
       return $CHAR_CACHE[$cacheKey];
986 986
     }
@@ -988,16 +988,16 @@  discard block
 block discarded – undo
988 988
     if ($code_point <= 0x7F) {
989 989
       $str = self::chr_and_parse_int($code_point);
990 990
     } elseif ($code_point <= 0x7FF) {
991
-      $str = self::chr_and_parse_int(($code_point >> 6) + 0xC0) .
991
+      $str = self::chr_and_parse_int(($code_point >> 6) + 0xC0).
992 992
              self::chr_and_parse_int(($code_point & 0x3F) + 0x80);
993 993
     } elseif ($code_point <= 0xFFFF) {
994
-      $str = self::chr_and_parse_int(($code_point >> 12) + 0xE0) .
995
-             self::chr_and_parse_int((($code_point >> 6) & 0x3F) + 0x80) .
994
+      $str = self::chr_and_parse_int(($code_point >> 12) + 0xE0).
995
+             self::chr_and_parse_int((($code_point >> 6) & 0x3F) + 0x80).
996 996
              self::chr_and_parse_int(($code_point & 0x3F) + 0x80);
997 997
     } else {
998
-      $str = self::chr_and_parse_int(($code_point >> 18) + 0xF0) .
999
-             self::chr_and_parse_int((($code_point >> 12) & 0x3F) + 0x80) .
1000
-             self::chr_and_parse_int((($code_point >> 6) & 0x3F) + 0x80) .
998
+      $str = self::chr_and_parse_int(($code_point >> 18) + 0xF0).
999
+             self::chr_and_parse_int((($code_point >> 12) & 0x3F) + 0x80).
1000
+             self::chr_and_parse_int((($code_point >> 6) & 0x3F) + 0x80).
1001 1001
              self::chr_and_parse_int(($code_point & 0x3F) + 0x80);
1002 1002
     }
1003 1003
 
@@ -1057,7 +1057,7 @@  discard block
 block discarded – undo
1057 1057
     }
1058 1058
 
1059 1059
     return array_map(
1060
-        function ($data) {
1060
+        function($data) {
1061 1061
           return UTF8::strlen($data, '8BIT');
1062 1062
         },
1063 1063
         self::split($str)
@@ -1299,7 +1299,7 @@  discard block
 block discarded – undo
1299 1299
       $flags = ENT_QUOTES;
1300 1300
     }
1301 1301
 
1302
-    return self::html_entity_decode('&#' . $int . ';', $flags);
1302
+    return self::html_entity_decode('&#'.$int.';', $flags);
1303 1303
   }
1304 1304
 
1305 1305
   /**
@@ -1376,7 +1376,7 @@  discard block
 block discarded – undo
1376 1376
           &&
1377 1377
           self::$SUPPORT['mbstring'] === false
1378 1378
       ) {
1379
-        trigger_error('UTF8::encode() without mbstring cannot handle "' . $encoding . '" encoding', E_USER_WARNING);
1379
+        trigger_error('UTF8::encode() without mbstring cannot handle "'.$encoding.'" encoding', E_USER_WARNING);
1380 1380
       }
1381 1381
 
1382 1382
       $strEncoded = \mb_convert_encoding(
@@ -1585,7 +1585,7 @@  discard block
 block discarded – undo
1585 1585
           ) {
1586 1586
             // Prevent leading combining chars
1587 1587
             // for NFC-safe concatenations.
1588
-            $var = $leading_combining . $var;
1588
+            $var = $leading_combining.$var;
1589 1589
           }
1590 1590
         }
1591 1591
 
@@ -2009,7 +2009,7 @@  discard block
 block discarded – undo
2009 2009
    */
2010 2010
   private static function getData($file)
2011 2011
   {
2012
-    $file = __DIR__ . '/data/' . $file . '.php';
2012
+    $file = __DIR__.'/data/'.$file.'.php';
2013 2013
     if (file_exists($file)) {
2014 2014
       /** @noinspection PhpIncludeInspection */
2015 2015
       return require $file;
@@ -2154,7 +2154,7 @@  discard block
 block discarded – undo
2154 2154
     return implode(
2155 2155
         '',
2156 2156
         array_map(
2157
-            function ($data) use ($keepAsciiChars, $encoding) {
2157
+            function($data) use ($keepAsciiChars, $encoding) {
2158 2158
               return UTF8::single_chr_html_encode($data, $keepAsciiChars, $encoding);
2159 2159
             },
2160 2160
             self::split($str)
@@ -2273,7 +2273,7 @@  discard block
 block discarded – undo
2273 2273
 
2274 2274
       $str = preg_replace_callback(
2275 2275
           "/&#\d{2,6};/",
2276
-          function ($matches) use ($encoding) {
2276
+          function($matches) use ($encoding) {
2277 2277
             $returnTmp = \mb_convert_encoding($matches[0], $encoding, 'HTML-ENTITIES');
2278 2278
 
2279 2279
             if ($returnTmp !== '"' && $returnTmp !== "'") {
@@ -2607,9 +2607,9 @@  discard block
 block discarded – undo
2607 2607
     if ((int)$int === $int) {
2608 2608
       $hex = dechex($int);
2609 2609
 
2610
-      $hex = (strlen($hex) < 4 ? substr('0000' . $hex, -4) : $hex);
2610
+      $hex = (strlen($hex) < 4 ? substr('0000'.$hex, -4) : $hex);
2611 2611
 
2612
-      return $pfix . $hex;
2612
+      return $pfix.$hex;
2613 2613
     }
2614 2614
 
2615 2615
     return '';
@@ -3350,7 +3350,7 @@  discard block
 block discarded – undo
3350 3350
         $cleanUtf8
3351 3351
     );
3352 3352
 
3353
-    return $strPartOne . $strPartTwo;
3353
+    return $strPartOne.$strPartTwo;
3354 3354
   }
3355 3355
 
3356 3356
   /**
@@ -3440,7 +3440,7 @@  discard block
 block discarded – undo
3440 3440
       return preg_replace('/^[\pZ\pC]+/u', '', $str);
3441 3441
     }
3442 3442
 
3443
-    return preg_replace('/^' . self::rxClass($chars) . '+/u', '', $str);
3443
+    return preg_replace('/^'.self::rxClass($chars).'+/u', '', $str);
3444 3444
   }
3445 3445
 
3446 3446
   /**
@@ -3978,7 +3978,7 @@  discard block
 block discarded – undo
3978 3978
     if (is_array($what) === true) {
3979 3979
       /** @noinspection ForeachSourceInspection */
3980 3980
       foreach ($what as $item) {
3981
-        $str = preg_replace('/(' . preg_quote($item, '/') . ')+/', $item, $str);
3981
+        $str = preg_replace('/('.preg_quote($item, '/').')+/', $item, $str);
3982 3982
       }
3983 3983
     }
3984 3984
 
@@ -4087,7 +4087,7 @@  discard block
 block discarded – undo
4087 4087
       return preg_replace('/[\pZ\pC]+$/u', '', $str);
4088 4088
     }
4089 4089
 
4090
-    return preg_replace('/' . self::rxClass($chars) . '+$/u', '', $str);
4090
+    return preg_replace('/'.self::rxClass($chars).'+$/u', '', $str);
4091 4091
   }
4092 4092
 
4093 4093
   /**
@@ -4102,7 +4102,7 @@  discard block
 block discarded – undo
4102 4102
   {
4103 4103
     static $RX_CLASSS_CACHE = array();
4104 4104
 
4105
-    $cacheKey = $s . $class;
4105
+    $cacheKey = $s.$class;
4106 4106
 
4107 4107
     if (isset($RX_CLASSS_CACHE[$cacheKey])) {
4108 4108
       return $RX_CLASSS_CACHE[$cacheKey];
@@ -4114,7 +4114,7 @@  discard block
 block discarded – undo
4114 4114
     /** @noinspection SuspiciousLoopInspection */
4115 4115
     foreach (self::str_split($s) as $s) {
4116 4116
       if ('-' === $s) {
4117
-        $class[0] = '-' . $class[0];
4117
+        $class[0] = '-'.$class[0];
4118 4118
       } elseif (!isset($s[2])) {
4119 4119
         $class[0] .= preg_quote($s, '/');
4120 4120
       } elseif (1 === self::strlen($s)) {
@@ -4125,13 +4125,13 @@  discard block
 block discarded – undo
4125 4125
     }
4126 4126
 
4127 4127
     if ($class[0]) {
4128
-      $class[0] = '[' . $class[0] . ']';
4128
+      $class[0] = '['.$class[0].']';
4129 4129
     }
4130 4130
 
4131 4131
     if (1 === count($class)) {
4132 4132
       $return = $class[0];
4133 4133
     } else {
4134
-      $return = '(?:' . implode('|', $class) . ')';
4134
+      $return = '(?:'.implode('|', $class).')';
4135 4135
     }
4136 4136
 
4137 4137
     $RX_CLASSS_CACHE[$cacheKey] = $return;
@@ -4149,7 +4149,7 @@  discard block
 block discarded – undo
4149 4149
     }
4150 4150
 
4151 4151
     foreach (self::$SUPPORT as $utf8Support) {
4152
-      echo $utf8Support . "\n<br>";
4152
+      echo $utf8Support."\n<br>";
4153 4153
     }
4154 4154
   }
4155 4155
 
@@ -4182,7 +4182,7 @@  discard block
 block discarded – undo
4182 4182
       $encoding = self::normalize_encoding($encoding, 'UTF-8');
4183 4183
     }
4184 4184
 
4185
-    return '&#' . self::ord($char, $encoding) . ';';
4185
+    return '&#'.self::ord($char, $encoding).';';
4186 4186
   }
4187 4187
 
4188 4188
   /**
@@ -4249,7 +4249,7 @@  discard block
 block discarded – undo
4249 4249
         ) {
4250 4250
 
4251 4251
           if (($str[$i + 1] & "\xC0") === "\x80") {
4252
-            $ret[] = $str[$i] . $str[$i + 1];
4252
+            $ret[] = $str[$i].$str[$i + 1];
4253 4253
 
4254 4254
             $i++;
4255 4255
           }
@@ -4265,7 +4265,7 @@  discard block
 block discarded – undo
4265 4265
               &&
4266 4266
               ($str[$i + 2] & "\xC0") === "\x80"
4267 4267
           ) {
4268
-            $ret[] = $str[$i] . $str[$i + 1] . $str[$i + 2];
4268
+            $ret[] = $str[$i].$str[$i + 1].$str[$i + 2];
4269 4269
 
4270 4270
             $i += 2;
4271 4271
           }
@@ -4283,7 +4283,7 @@  discard block
 block discarded – undo
4283 4283
               &&
4284 4284
               ($str[$i + 3] & "\xC0") === "\x80"
4285 4285
           ) {
4286
-            $ret[] = $str[$i] . $str[$i + 1] . $str[$i + 2] . $str[$i + 3];
4286
+            $ret[] = $str[$i].$str[$i + 1].$str[$i + 2].$str[$i + 3];
4287 4287
 
4288 4288
             $i += 3;
4289 4289
           }
@@ -4296,7 +4296,7 @@  discard block
 block discarded – undo
4296 4296
       $ret = array_chunk($ret, $length);
4297 4297
 
4298 4298
       return array_map(
4299
-          function ($item) {
4299
+          function($item) {
4300 4300
             return implode('', $item);
4301 4301
           }, $ret
4302 4302
       );
@@ -4403,7 +4403,7 @@  discard block
 block discarded – undo
4403 4403
     foreach (self::$ICONV_ENCODING as $encodingTmp) {
4404 4404
       # INFO: //IGNORE and //TRANSLIT still throw notice
4405 4405
       /** @noinspection PhpUsageOfSilenceOperatorInspection */
4406
-      if (md5(@\iconv($encodingTmp, $encodingTmp . '//IGNORE', $str)) === $md5) {
4406
+      if (md5(@\iconv($encodingTmp, $encodingTmp.'//IGNORE', $str)) === $md5) {
4407 4407
         return $encodingTmp;
4408 4408
       }
4409 4409
     }
@@ -4498,7 +4498,7 @@  discard block
 block discarded – undo
4498 4498
       if ('' === $s .= '') {
4499 4499
         $s = '/^(?<=.)$/';
4500 4500
       } else {
4501
-        $s = '/' . preg_quote($s, '/') . '/ui';
4501
+        $s = '/'.preg_quote($s, '/').'/ui';
4502 4502
       }
4503 4503
     }
4504 4504
 
@@ -4556,7 +4556,7 @@  discard block
 block discarded – undo
4556 4556
     }
4557 4557
 
4558 4558
     if (self::substr($str, $length - 1, 1) === ' ') {
4559
-      return (string)self::substr($str, 0, $length - 1) . $strAddOn;
4559
+      return (string)self::substr($str, 0, $length - 1).$strAddOn;
4560 4560
     }
4561 4561
 
4562 4562
     $str = (string)self::substr($str, 0, $length);
@@ -4565,9 +4565,9 @@  discard block
 block discarded – undo
4565 4565
     $new_str = implode(' ', $array);
4566 4566
 
4567 4567
     if ($new_str === '') {
4568
-      $str = (string)self::substr($str, 0, $length - 1) . $strAddOn;
4568
+      $str = (string)self::substr($str, 0, $length - 1).$strAddOn;
4569 4569
     } else {
4570
-      $str = $new_str . $strAddOn;
4570
+      $str = $new_str.$strAddOn;
4571 4571
     }
4572 4572
 
4573 4573
     return $str;
@@ -4622,7 +4622,7 @@  discard block
 block discarded – undo
4622 4622
           $pre = '';
4623 4623
       }
4624 4624
 
4625
-      return $pre . $str . $post;
4625
+      return $pre.$str.$post;
4626 4626
     }
4627 4627
 
4628 4628
     return $str;
@@ -4772,7 +4772,7 @@  discard block
 block discarded – undo
4772 4772
     }
4773 4773
 
4774 4774
     /** @noinspection PhpInternalEntityUsedInspection */
4775
-    preg_match_all('/' . self::GRAPHEME_CLUSTER_RX . '/u', $str, $a);
4775
+    preg_match_all('/'.self::GRAPHEME_CLUSTER_RX.'/u', $str, $a);
4776 4776
     $a = $a[0];
4777 4777
 
4778 4778
     if ($len === 1) {
@@ -5008,7 +5008,7 @@  discard block
 block discarded – undo
5008 5008
   public static function strcmp($str1, $str2)
5009 5009
   {
5010 5010
     /** @noinspection PhpUndefinedClassInspection */
5011
-    return $str1 . '' === $str2 . '' ? 0 : strcmp(
5011
+    return $str1.'' === $str2.'' ? 0 : strcmp(
5012 5012
         \Normalizer::normalize($str1, \Normalizer::NFD),
5013 5013
         \Normalizer::normalize($str2, \Normalizer::NFD)
5014 5014
     );
@@ -5043,7 +5043,7 @@  discard block
 block discarded – undo
5043 5043
       return null;
5044 5044
     }
5045 5045
 
5046
-    if (preg_match('/^(.*?)' . self::rxClass($charList) . '/us', $str, $length)) {
5046
+    if (preg_match('/^(.*?)'.self::rxClass($charList).'/us', $str, $length)) {
5047 5047
       /** @noinspection OffsetOperationsInspection */
5048 5048
       return self::strlen($length[1]);
5049 5049
     }
@@ -5254,7 +5254,7 @@  discard block
 block discarded – undo
5254 5254
         &&
5255 5255
         self::$SUPPORT['mbstring'] === false
5256 5256
     ) {
5257
-      trigger_error('UTF8::stristr() without mbstring cannot handle "' . $encoding . '" encoding', E_USER_WARNING);
5257
+      trigger_error('UTF8::stristr() without mbstring cannot handle "'.$encoding.'" encoding', E_USER_WARNING);
5258 5258
     }
5259 5259
 
5260 5260
     if (self::$SUPPORT['mbstring'] === true) {
@@ -5275,7 +5275,7 @@  discard block
 block discarded – undo
5275 5275
       return stristr($str, $search);
5276 5276
     }
5277 5277
 
5278
-    preg_match('/^(.*?)' . preg_quote($needle, '/') . '/usi', $haystack, $match);
5278
+    preg_match('/^(.*?)'.preg_quote($needle, '/').'/usi', $haystack, $match);
5279 5279
 
5280 5280
     if (!isset($match[1])) {
5281 5281
       return false;
@@ -5349,7 +5349,7 @@  discard block
 block discarded – undo
5349 5349
         &&
5350 5350
         self::$SUPPORT['iconv'] === false
5351 5351
     ) {
5352
-      trigger_error('UTF8::strlen() without mbstring / iconv cannot handle "' . $encoding . '" encoding', E_USER_WARNING);
5352
+      trigger_error('UTF8::strlen() without mbstring / iconv cannot handle "'.$encoding.'" encoding', E_USER_WARNING);
5353 5353
     }
5354 5354
 
5355 5355
     if (
@@ -5428,7 +5428,7 @@  discard block
 block discarded – undo
5428 5428
    */
5429 5429
   public static function strnatcmp($str1, $str2)
5430 5430
   {
5431
-    return $str1 . '' === $str2 . '' ? 0 : strnatcmp(self::strtonatfold($str1), self::strtonatfold($str2));
5431
+    return $str1.'' === $str2.'' ? 0 : strnatcmp(self::strtonatfold($str1), self::strtonatfold($str2));
5432 5432
   }
5433 5433
 
5434 5434
   /**
@@ -5489,7 +5489,7 @@  discard block
 block discarded – undo
5489 5489
       return false;
5490 5490
     }
5491 5491
 
5492
-    if (preg_match('/' . self::rxClass($char_list) . '/us', $haystack, $m)) {
5492
+    if (preg_match('/'.self::rxClass($char_list).'/us', $haystack, $m)) {
5493 5493
       return substr($haystack, strpos($haystack, $m[0]));
5494 5494
     }
5495 5495
 
@@ -5566,7 +5566,7 @@  discard block
 block discarded – undo
5566 5566
         &&
5567 5567
         self::$SUPPORT['mbstring'] === false
5568 5568
     ) {
5569
-      trigger_error('UTF8::strpos() without mbstring / iconv cannot handle "' . $encoding . '" encoding', E_USER_WARNING);
5569
+      trigger_error('UTF8::strpos() without mbstring / iconv cannot handle "'.$encoding.'" encoding', E_USER_WARNING);
5570 5570
     }
5571 5571
 
5572 5572
     if (
@@ -5798,7 +5798,7 @@  discard block
 block discarded – undo
5798 5798
         &&
5799 5799
         self::$SUPPORT['mbstring'] === false
5800 5800
     ) {
5801
-      trigger_error('UTF8::strripos() without mbstring cannot handle "' . $encoding . '" encoding', E_USER_WARNING);
5801
+      trigger_error('UTF8::strripos() without mbstring cannot handle "'.$encoding.'" encoding', E_USER_WARNING);
5802 5802
     }
5803 5803
 
5804 5804
     if (self::$SUPPORT['mbstring'] === true) {
@@ -5881,7 +5881,7 @@  discard block
 block discarded – undo
5881 5881
         &&
5882 5882
         self::$SUPPORT['mbstring'] === false
5883 5883
     ) {
5884
-      trigger_error('UTF8::strrpos() without mbstring cannot handle "' . $encoding . '" encoding', E_USER_WARNING);
5884
+      trigger_error('UTF8::strrpos() without mbstring cannot handle "'.$encoding.'" encoding', E_USER_WARNING);
5885 5885
     }
5886 5886
 
5887 5887
     if (self::$SUPPORT['mbstring'] === true) {
@@ -5949,7 +5949,7 @@  discard block
 block discarded – undo
5949 5949
       return 0;
5950 5950
     }
5951 5951
 
5952
-    return preg_match('/^' . self::rxClass($mask) . '+/u', $str, $str) ? self::strlen($str[0]) : 0;
5952
+    return preg_match('/^'.self::rxClass($mask).'+/u', $str, $str) ? self::strlen($str[0]) : 0;
5953 5953
   }
5954 5954
 
5955 5955
   /**
@@ -5995,7 +5995,7 @@  discard block
 block discarded – undo
5995 5995
         &&
5996 5996
         self::$SUPPORT['mbstring'] === false
5997 5997
     ) {
5998
-      trigger_error('UTF8::strstr() without mbstring cannot handle "' . $encoding . '" encoding', E_USER_WARNING);
5998
+      trigger_error('UTF8::strstr() without mbstring cannot handle "'.$encoding.'" encoding', E_USER_WARNING);
5999 5999
     }
6000 6000
 
6001 6001
     if (self::$SUPPORT['mbstring'] === true) {
@@ -6012,7 +6012,7 @@  discard block
 block discarded – undo
6012 6012
       return \grapheme_strstr($haystack, $needle, $before_needle);
6013 6013
     }
6014 6014
 
6015
-    preg_match('/^(.*?)' . preg_quote($needle, '/') . '/us', $haystack, $match);
6015
+    preg_match('/^(.*?)'.preg_quote($needle, '/').'/us', $haystack, $match);
6016 6016
 
6017 6017
     if (!isset($match[1])) {
6018 6018
       return false;
@@ -6119,9 +6119,9 @@  discard block
 block discarded – undo
6119 6119
           Bootup::is_php('5.4') === true
6120 6120
       ) {
6121 6121
 
6122
-        $langCode = $lang . '-Lower';
6122
+        $langCode = $lang.'-Lower';
6123 6123
         if (!in_array($langCode, self::$SUPPORT['intl__transliterator_list_ids'], true)) {
6124
-          trigger_error('UTF8::strtolower() without intl for special language: ' . $lang, E_USER_WARNING);
6124
+          trigger_error('UTF8::strtolower() without intl for special language: '.$lang, E_USER_WARNING);
6125 6125
 
6126 6126
           $langCode = 'Any-Lower';
6127 6127
         }
@@ -6129,7 +6129,7 @@  discard block
 block discarded – undo
6129 6129
         return transliterator_transliterate($langCode, $str);
6130 6130
       }
6131 6131
 
6132
-      trigger_error('UTF8::strtolower() without intl + PHP >= 5.4 cannot handle the "lang"-parameter: ' . $lang, E_USER_WARNING);
6132
+      trigger_error('UTF8::strtolower() without intl + PHP >= 5.4 cannot handle the "lang"-parameter: '.$lang, E_USER_WARNING);
6133 6133
     }
6134 6134
 
6135 6135
     return \mb_strtolower($str, $encoding);
@@ -6189,9 +6189,9 @@  discard block
 block discarded – undo
6189 6189
           Bootup::is_php('5.4') === true
6190 6190
       ) {
6191 6191
 
6192
-        $langCode = $lang . '-Upper';
6192
+        $langCode = $lang.'-Upper';
6193 6193
         if (!in_array($langCode, self::$SUPPORT['intl__transliterator_list_ids'], true)) {
6194
-          trigger_error('UTF8::strtoupper() without intl for special language: ' . $lang, E_USER_WARNING);
6194
+          trigger_error('UTF8::strtoupper() without intl for special language: '.$lang, E_USER_WARNING);
6195 6195
 
6196 6196
           $langCode = 'Any-Upper';
6197 6197
         }
@@ -6199,7 +6199,7 @@  discard block
 block discarded – undo
6199 6199
         return transliterator_transliterate($langCode, $str);
6200 6200
       }
6201 6201
 
6202
-      trigger_error('UTF8::strtolower() without intl + PHP >= 5.4 cannot handle the "lang"-parameter: ' . $lang, E_USER_WARNING);
6202
+      trigger_error('UTF8::strtolower() without intl + PHP >= 5.4 cannot handle the "lang"-parameter: '.$lang, E_USER_WARNING);
6203 6203
     }
6204 6204
 
6205 6205
     return \mb_strtoupper($str, $encoding);
@@ -6304,7 +6304,7 @@  discard block
 block discarded – undo
6304 6304
 
6305 6305
     $return = array();
6306 6306
     foreach ($array as $key => $value) {
6307
-      if ($case  === CASE_LOWER) {
6307
+      if ($case === CASE_LOWER) {
6308 6308
         $key = self::strtolower($key);
6309 6309
       } else {
6310 6310
         $key = self::strtoupper($key);
@@ -6399,7 +6399,7 @@  discard block
 block discarded – undo
6399 6399
         &&
6400 6400
         self::$SUPPORT['mbstring'] === false
6401 6401
     ) {
6402
-      trigger_error('UTF8::substr() without mbstring cannot handle "' . $encoding . '" encoding', E_USER_WARNING);
6402
+      trigger_error('UTF8::substr() without mbstring cannot handle "'.$encoding.'" encoding', E_USER_WARNING);
6403 6403
     }
6404 6404
 
6405 6405
     if (self::$SUPPORT['mbstring'] === true) {
@@ -6426,8 +6426,7 @@  discard block
 block discarded – undo
6426 6426
 
6427 6427
     if (self::is_ascii($str)) {
6428 6428
       return ($length === null) ?
6429
-          substr($str, $offset) :
6430
-          substr($str, $offset, $length);
6429
+          substr($str, $offset) : substr($str, $offset, $length);
6431 6430
     }
6432 6431
 
6433 6432
     // fallback via vanilla php
@@ -6562,14 +6561,14 @@  discard block
 block discarded – undo
6562 6561
         &&
6563 6562
         self::$SUPPORT['mbstring'] === false
6564 6563
     ) {
6565
-      trigger_error('UTF8::substr_count() without mbstring cannot handle "' . $encoding . '" encoding', E_USER_WARNING);
6564
+      trigger_error('UTF8::substr_count() without mbstring cannot handle "'.$encoding.'" encoding', E_USER_WARNING);
6566 6565
     }
6567 6566
 
6568 6567
     if (self::$SUPPORT['mbstring'] === true) {
6569 6568
       return \mb_substr_count($haystack, $needle, $encoding);
6570 6569
     }
6571 6570
 
6572
-    preg_match_all('/' . preg_quote($needle, '/') . '/us', $haystack, $matches, PREG_SET_ORDER);
6571
+    preg_match_all('/'.preg_quote($needle, '/').'/us', $haystack, $matches, PREG_SET_ORDER);
6573 6572
 
6574 6573
     return count($matches);
6575 6574
   }
@@ -6759,8 +6758,7 @@  discard block
 block discarded – undo
6759 6758
 
6760 6759
     if (self::is_ascii($str)) {
6761 6760
       return ($length === null) ?
6762
-          substr_replace($str, $replacement, $offset) :
6763
-          substr_replace($str, $replacement, $offset, $length);
6761
+          substr_replace($str, $replacement, $offset) : substr_replace($str, $replacement, $offset, $length);
6764 6762
     }
6765 6763
 
6766 6764
     preg_match_all('/./us', $str, $smatches);
@@ -6836,7 +6834,7 @@  discard block
 block discarded – undo
6836 6834
 
6837 6835
     $strSwappedCase = preg_replace_callback(
6838 6836
         '/[\S]/u',
6839
-        function ($match) use ($encoding) {
6837
+        function($match) use ($encoding) {
6840 6838
           $marchToUpper = UTF8::strtoupper($match[0], $encoding);
6841 6839
 
6842 6840
           if ($match[0] === $marchToUpper) {
@@ -7179,7 +7177,7 @@  discard block
 block discarded – undo
7179 7177
           $c2 = $i + 1 >= $max ? "\x00" : $str[$i + 1];
7180 7178
 
7181 7179
           if ($c2 >= "\x80" && $c2 <= "\xBF") { // yeah, almost sure it's UTF8 already
7182
-            $buf .= $c1 . $c2;
7180
+            $buf .= $c1.$c2;
7183 7181
             $i++;
7184 7182
           } else { // not valid UTF8 - convert it
7185 7183
             $buf .= self::to_utf8_convert($c1);
@@ -7191,7 +7189,7 @@  discard block
 block discarded – undo
7191 7189
           $c3 = $i + 2 >= $max ? "\x00" : $str[$i + 2];
7192 7190
 
7193 7191
           if ($c2 >= "\x80" && $c2 <= "\xBF" && $c3 >= "\x80" && $c3 <= "\xBF") { // yeah, almost sure it's UTF8 already
7194
-            $buf .= $c1 . $c2 . $c3;
7192
+            $buf .= $c1.$c2.$c3;
7195 7193
             $i += 2;
7196 7194
           } else { // not valid UTF8 - convert it
7197 7195
             $buf .= self::to_utf8_convert($c1);
@@ -7204,7 +7202,7 @@  discard block
 block discarded – undo
7204 7202
           $c4 = $i + 3 >= $max ? "\x00" : $str[$i + 3];
7205 7203
 
7206 7204
           if ($c2 >= "\x80" && $c2 <= "\xBF" && $c3 >= "\x80" && $c3 <= "\xBF" && $c4 >= "\x80" && $c4 <= "\xBF") { // yeah, almost sure it's UTF8 already
7207
-            $buf .= $c1 . $c2 . $c3 . $c4;
7205
+            $buf .= $c1.$c2.$c3.$c4;
7208 7206
             $i += 3;
7209 7207
           } else { // not valid UTF8 - convert it
7210 7208
             $buf .= self::to_utf8_convert($c1);
@@ -7226,7 +7224,7 @@  discard block
 block discarded – undo
7226 7224
     // decode unicode escape sequences
7227 7225
     $buf = preg_replace_callback(
7228 7226
         '/\\\\u([0-9a-f]{4})/i',
7229
-        function ($match) {
7227
+        function($match) {
7230 7228
           return \mb_convert_encoding(pack('H*', $match[1]), 'UTF-8', 'UCS-2BE');
7231 7229
         },
7232 7230
         $buf
@@ -7255,7 +7253,7 @@  discard block
 block discarded – undo
7255 7253
     } else {
7256 7254
       $cc1 = self::chr_and_parse_int($ordC1 / 64) | "\xC0";
7257 7255
       $cc2 = ($int & "\x3F") | "\x80";
7258
-      $buf .= $cc1 . $cc2;
7256
+      $buf .= $cc1.$cc2;
7259 7257
     }
7260 7258
 
7261 7259
     return $buf;
@@ -7318,7 +7316,7 @@  discard block
 block discarded – undo
7318 7316
         $cleanUtf8
7319 7317
     );
7320 7318
 
7321
-    return $strPartOne . $strPartTwo;
7319
+    return $strPartOne.$strPartTwo;
7322 7320
   }
7323 7321
 
7324 7322
   /**
@@ -7363,7 +7361,7 @@  discard block
 block discarded – undo
7363 7361
       $str = self::clean($str);
7364 7362
     }
7365 7363
 
7366
-    $usePhpDefaultFunctions = !(bool)($charlist . implode('', $exceptions));
7364
+    $usePhpDefaultFunctions = !(bool)($charlist.implode('', $exceptions));
7367 7365
 
7368 7366
     if (
7369 7367
         $usePhpDefaultFunctions === true
@@ -7850,7 +7848,7 @@  discard block
 block discarded – undo
7850 7848
       return '';
7851 7849
     }
7852 7850
 
7853
-    preg_match('/^\s*+(?:\S++\s*+){1,' . $limit . '}/u', $str, $matches);
7851
+    preg_match('/^\s*+(?:\S++\s*+){1,'.$limit.'}/u', $str, $matches);
7854 7852
 
7855 7853
     if (
7856 7854
         !isset($matches[0])
@@ -7860,7 +7858,7 @@  discard block
 block discarded – undo
7860 7858
       return $str;
7861 7859
     }
7862 7860
 
7863
-    return self::rtrim($matches[0]) . $strAddOn;
7861
+    return self::rtrim($matches[0]).$strAddOn;
7864 7862
   }
7865 7863
 
7866 7864
   /**
@@ -7928,7 +7926,7 @@  discard block
 block discarded – undo
7928 7926
       $strReturn .= $break;
7929 7927
     }
7930 7928
 
7931
-    return $strReturn . implode('', $chars);
7929
+    return $strReturn.implode('', $chars);
7932 7930
   }
7933 7931
 
7934 7932
   /**
Please login to merge, or discard this patch.