Completed
Push — master ( 30a158...ae6d42 )
by Lars
17:35
created
src/voku/helper/data/caseFolding_full.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -217,6 +217,6 @@
 block discarded – undo
217 217
         ),
218 218
 );
219 219
 
220
-$result =& $data;
220
+$result = & $data;
221 221
 unset($data);
222 222
 return $result;
Please login to merge, or discard this patch.
src/voku/helper/UTF8.php 3 patches
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -933,16 +933,16 @@
 block discarded – undo
933 933
       $str = chr($code_point);
934 934
     } elseif (0x800 > $code_point) {
935 935
       $str = chr(0xC0 | $code_point >> 6) .
936
-             chr(0x80 | $code_point & 0x3F);
936
+              chr(0x80 | $code_point & 0x3F);
937 937
     } elseif (0x10000 > $code_point) {
938 938
       $str = chr(0xE0 | $code_point >> 12) .
939
-             chr(0x80 | $code_point >> 6 & 0x3F) .
940
-             chr(0x80 | $code_point & 0x3F);
939
+              chr(0x80 | $code_point >> 6 & 0x3F) .
940
+              chr(0x80 | $code_point & 0x3F);
941 941
     } else {
942 942
       $str = chr(0xF0 | $code_point >> 18) .
943
-             chr(0x80 | $code_point >> 12 & 0x3F) .
944
-             chr(0x80 | $code_point >> 6 & 0x3F) .
945
-             chr(0x80 | $code_point & 0x3F);
943
+              chr(0x80 | $code_point >> 12 & 0x3F) .
944
+              chr(0x80 | $code_point >> 6 & 0x3F) .
945
+              chr(0x80 | $code_point & 0x3F);
946 946
     }
947 947
 
948 948
     if ($encoding !== 'UTF-8') {
Please login to merge, or discard this patch.
Doc Comments   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -2668,7 +2668,7 @@  discard block
 block discarded – undo
2668 2668
   /**
2669 2669
    * Check if the input is binary... (is look like a hack).
2670 2670
    *
2671
-   * @param mixed $input
2671
+   * @param string $input
2672 2672
    *
2673 2673
    * @return bool
2674 2674
    */
@@ -5027,7 +5027,7 @@  discard block
 block discarded – undo
5027 5027
    * @param string  $encoding  [optional] <p>Set the charset for e.g. "\mb_" function.</p>
5028 5028
    * @param boolean $cleanUtf8 [optional] <p>Clean non UTF-8 chars from the string.</p>
5029 5029
    *
5030
-   * @return int|false <p>
5030
+   * @return string <p>
5031 5031
    *                   The numeric position of the first occurrence of needle in the haystack string.<br />
5032 5032
    *                   If needle is not found it returns false.
5033 5033
    *                   </p>
@@ -5303,7 +5303,7 @@  discard block
 block discarded – undo
5303 5303
    * @link http://php.net/manual/en/function.mb-strrpos.php
5304 5304
    *
5305 5305
    * @param string     $haystack  <p>The string being checked, for the last occurrence of needle</p>
5306
-   * @param string|int $needle    <p>The string to find in haystack.<br />Or a code point as int.</p>
5306
+   * @param string $needle    <p>The string to find in haystack.<br />Or a code point as int.</p>
5307 5307
    * @param int        $offset    [optional] <p>May be specified to begin searching an arbitrary number of characters
5308 5308
    *                              into the string. Negative values will stop searching at an arbitrary point prior to
5309 5309
    *                              the end of the string.
@@ -6388,7 +6388,7 @@  discard block
 block discarded – undo
6388 6388
    * 2) when any of these: àáâãäåæçèéêëìíîï  are followed by TWO chars from group B,
6389 6389
    * 3) when any of these: ðñòó  are followed by THREE chars from group B.
6390 6390
    *
6391
-   * @param string|string[] $str                    <p>Any string or array.</p>
6391
+   * @param string $str                    <p>Any string or array.</p>
6392 6392
    * @param bool            $decodeHtmlEntityToUtf8 <p>Set to true, if you need to decode html-entities.</p>
6393 6393
    *
6394 6394
    * @return string|string[] <p>The UTF-8 encoded string.</p>
Please login to merge, or discard this 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;
@@ -956,7 +956,7 @@  discard block
 block discarded – undo
956 956
 
957 957
     // use static cache, if there is no support for "IntlChar"
958 958
     static $cache = array();
959
-    $cacheKey = $code_point . $encoding;
959
+    $cacheKey = $code_point.$encoding;
960 960
     if (isset($cache[$cacheKey]) === true) {
961 961
       return $cache[$cacheKey];
962 962
     }
@@ -964,16 +964,16 @@  discard block
 block discarded – undo
964 964
     if (0x80 > $code_point %= 0x200000) {
965 965
       $str = chr($code_point);
966 966
     } elseif (0x800 > $code_point) {
967
-      $str = chr(0xC0 | $code_point >> 6) .
967
+      $str = chr(0xC0 | $code_point >> 6).
968 968
              chr(0x80 | $code_point & 0x3F);
969 969
     } elseif (0x10000 > $code_point) {
970
-      $str = chr(0xE0 | $code_point >> 12) .
971
-             chr(0x80 | $code_point >> 6 & 0x3F) .
970
+      $str = chr(0xE0 | $code_point >> 12).
971
+             chr(0x80 | $code_point >> 6 & 0x3F).
972 972
              chr(0x80 | $code_point & 0x3F);
973 973
     } else {
974
-      $str = chr(0xF0 | $code_point >> 18) .
975
-             chr(0x80 | $code_point >> 12 & 0x3F) .
976
-             chr(0x80 | $code_point >> 6 & 0x3F) .
974
+      $str = chr(0xF0 | $code_point >> 18).
975
+             chr(0x80 | $code_point >> 12 & 0x3F).
976
+             chr(0x80 | $code_point >> 6 & 0x3F).
977 977
              chr(0x80 | $code_point & 0x3F);
978 978
     }
979 979
 
@@ -1254,7 +1254,7 @@  discard block
 block discarded – undo
1254 1254
       $flags = ENT_QUOTES;
1255 1255
     }
1256 1256
 
1257
-    return self::html_entity_decode('&#' . $int . ';', $flags);
1257
+    return self::html_entity_decode('&#'.$int.';', $flags);
1258 1258
   }
1259 1259
 
1260 1260
   /**
@@ -1331,7 +1331,7 @@  discard block
 block discarded – undo
1331 1331
           &&
1332 1332
           self::$support['mbstring'] === false
1333 1333
       ) {
1334
-        trigger_error('UTF8::encode() without mbstring cannot handle "' . $encoding . '" encoding', E_USER_WARNING);
1334
+        trigger_error('UTF8::encode() without mbstring cannot handle "'.$encoding.'" encoding', E_USER_WARNING);
1335 1335
       }
1336 1336
 
1337 1337
       $strEncoded = \mb_convert_encoding(
@@ -1530,7 +1530,7 @@  discard block
 block discarded – undo
1530 1530
           ) {
1531 1531
             // Prevent leading combining chars
1532 1532
             // for NFC-safe concatenations.
1533
-            $var = $leading_combining . $var;
1533
+            $var = $leading_combining.$var;
1534 1534
           }
1535 1535
         }
1536 1536
 
@@ -1951,7 +1951,7 @@  discard block
 block discarded – undo
1951 1951
    */
1952 1952
   private static function getData($file)
1953 1953
   {
1954
-    $file = __DIR__ . '/data/' . $file . '.php';
1954
+    $file = __DIR__.'/data/'.$file.'.php';
1955 1955
     if (file_exists($file)) {
1956 1956
       /** @noinspection PhpIncludeInspection */
1957 1957
       return require $file;
@@ -2068,7 +2068,7 @@  discard block
 block discarded – undo
2068 2068
     return implode(
2069 2069
         '',
2070 2070
         array_map(
2071
-            function ($data) use ($keepAsciiChars, $encoding) {
2071
+            function($data) use ($keepAsciiChars, $encoding) {
2072 2072
               return UTF8::single_chr_html_encode($data, $keepAsciiChars, $encoding);
2073 2073
             },
2074 2074
             self::split($str)
@@ -2187,7 +2187,7 @@  discard block
 block discarded – undo
2187 2187
 
2188 2188
       $str = preg_replace_callback(
2189 2189
           "/&#\d{2,6};/",
2190
-          function ($matches) use ($encoding) {
2190
+          function($matches) use ($encoding) {
2191 2191
             $returnTmp = \mb_convert_encoding($matches[0], $encoding, 'HTML-ENTITIES');
2192 2192
 
2193 2193
             if ($returnTmp !== '"' && $returnTmp !== "'") {
@@ -2511,9 +2511,9 @@  discard block
 block discarded – undo
2511 2511
     if (ctype_digit((string)$int)) {
2512 2512
       $hex = dechex((int)$int);
2513 2513
 
2514
-      $hex = (strlen($hex) < 4 ? substr('0000' . $hex, -4) : $hex);
2514
+      $hex = (strlen($hex) < 4 ? substr('0000'.$hex, -4) : $hex);
2515 2515
 
2516
-      return $pfix . $hex;
2516
+      return $pfix.$hex;
2517 2517
     }
2518 2518
 
2519 2519
     return '';
@@ -3217,7 +3217,7 @@  discard block
 block discarded – undo
3217 3217
    */
3218 3218
   public static function lcfirst($str)
3219 3219
   {
3220
-    return self::strtolower(self::substr($str, 0, 1)) . self::substr($str, 1);
3220
+    return self::strtolower(self::substr($str, 0, 1)).self::substr($str, 1);
3221 3221
   }
3222 3222
 
3223 3223
   /**
@@ -3241,7 +3241,7 @@  discard block
 block discarded – undo
3241 3241
       return preg_replace('/^[\pZ\pC]+/u', '', $str);
3242 3242
     }
3243 3243
 
3244
-    return preg_replace('/^' . self::rxClass($chars) . '+/u', '', $str);
3244
+    return preg_replace('/^'.self::rxClass($chars).'+/u', '', $str);
3245 3245
   }
3246 3246
 
3247 3247
   /**
@@ -3744,7 +3744,7 @@  discard block
 block discarded – undo
3744 3744
     if (is_array($what)) {
3745 3745
       /** @noinspection ForeachSourceInspection */
3746 3746
       foreach ($what as $item) {
3747
-        $str = preg_replace('/(' . preg_quote($item, '/') . ')+/', $item, $str);
3747
+        $str = preg_replace('/('.preg_quote($item, '/').')+/', $item, $str);
3748 3748
       }
3749 3749
     }
3750 3750
 
@@ -3850,7 +3850,7 @@  discard block
 block discarded – undo
3850 3850
       return preg_replace('/[\pZ\pC]+$/u', '', $str);
3851 3851
     }
3852 3852
 
3853
-    return preg_replace('/' . self::rxClass($chars) . '+$/u', '', $str);
3853
+    return preg_replace('/'.self::rxClass($chars).'+$/u', '', $str);
3854 3854
   }
3855 3855
 
3856 3856
   /**
@@ -3865,7 +3865,7 @@  discard block
 block discarded – undo
3865 3865
   {
3866 3866
     static $rxClassCache = array();
3867 3867
 
3868
-    $cacheKey = $s . $class;
3868
+    $cacheKey = $s.$class;
3869 3869
 
3870 3870
     if (isset($rxClassCache[$cacheKey])) {
3871 3871
       return $rxClassCache[$cacheKey];
@@ -3877,7 +3877,7 @@  discard block
 block discarded – undo
3877 3877
     /** @noinspection SuspiciousLoopInspection */
3878 3878
     foreach (self::str_split($s) as $s) {
3879 3879
       if ('-' === $s) {
3880
-        $class[0] = '-' . $class[0];
3880
+        $class[0] = '-'.$class[0];
3881 3881
       } elseif (!isset($s[2])) {
3882 3882
         $class[0] .= preg_quote($s, '/');
3883 3883
       } elseif (1 === self::strlen($s)) {
@@ -3888,13 +3888,13 @@  discard block
 block discarded – undo
3888 3888
     }
3889 3889
 
3890 3890
     if ($class[0]) {
3891
-      $class[0] = '[' . $class[0] . ']';
3891
+      $class[0] = '['.$class[0].']';
3892 3892
     }
3893 3893
 
3894 3894
     if (1 === count($class)) {
3895 3895
       $return = $class[0];
3896 3896
     } else {
3897
-      $return = '(?:' . implode('|', $class) . ')';
3897
+      $return = '(?:'.implode('|', $class).')';
3898 3898
     }
3899 3899
 
3900 3900
     $rxClassCache[$cacheKey] = $return;
@@ -3912,7 +3912,7 @@  discard block
 block discarded – undo
3912 3912
     }
3913 3913
 
3914 3914
     foreach (self::$support as $utf8Support) {
3915
-      echo $utf8Support . "\n<br>";
3915
+      echo $utf8Support."\n<br>";
3916 3916
     }
3917 3917
   }
3918 3918
 
@@ -3946,7 +3946,7 @@  discard block
 block discarded – undo
3946 3946
       $encoding = self::normalize_encoding($encoding);
3947 3947
     }
3948 3948
 
3949
-    return '&#' . self::ord($char, $encoding) . ';';
3949
+    return '&#'.self::ord($char, $encoding).';';
3950 3950
   }
3951 3951
 
3952 3952
   /**
@@ -3998,19 +3998,19 @@  discard block
 block discarded – undo
3998 3998
           $ret[] = $str[$i];
3999 3999
         } elseif ((($str[$i] & "\xE0") === "\xC0") && isset($str[$i + 1])) {
4000 4000
           if (($str[$i + 1] & "\xC0") === "\x80") {
4001
-            $ret[] = $str[$i] . $str[$i + 1];
4001
+            $ret[] = $str[$i].$str[$i + 1];
4002 4002
 
4003 4003
             $i++;
4004 4004
           }
4005 4005
         } elseif ((($str[$i] & "\xF0") === "\xE0") && isset($str[$i + 2])) {
4006 4006
           if ((($str[$i + 1] & "\xC0") === "\x80") && (($str[$i + 2] & "\xC0") === "\x80")) {
4007
-            $ret[] = $str[$i] . $str[$i + 1] . $str[$i + 2];
4007
+            $ret[] = $str[$i].$str[$i + 1].$str[$i + 2];
4008 4008
 
4009 4009
             $i += 2;
4010 4010
           }
4011 4011
         } elseif ((($str[$i] & "\xF8") === "\xF0") && isset($str[$i + 3])) {
4012 4012
           if ((($str[$i + 1] & "\xC0") === "\x80") && (($str[$i + 2] & "\xC0") === "\x80") && (($str[$i + 3] & "\xC0") === "\x80")) {
4013
-            $ret[] = $str[$i] . $str[$i + 1] . $str[$i + 2] . $str[$i + 3];
4013
+            $ret[] = $str[$i].$str[$i + 1].$str[$i + 2].$str[$i + 3];
4014 4014
 
4015 4015
             $i += 3;
4016 4016
           }
@@ -4022,7 +4022,7 @@  discard block
 block discarded – undo
4022 4022
       $ret = array_chunk($ret, $length);
4023 4023
 
4024 4024
       return array_map(
4025
-          function ($item) {
4025
+          function($item) {
4026 4026
             return implode('', $item);
4027 4027
           }, $ret
4028 4028
       );
@@ -4121,7 +4121,7 @@  discard block
 block discarded – undo
4121 4121
     foreach (self::$iconvEncoding as $encodingTmp) {
4122 4122
       # INFO: //IGNORE and //TRANSLIT still throw notice
4123 4123
       /** @noinspection PhpUsageOfSilenceOperatorInspection */
4124
-      if (md5(@\iconv($encodingTmp, $encodingTmp . '//IGNORE', $str)) === $md5) {
4124
+      if (md5(@\iconv($encodingTmp, $encodingTmp.'//IGNORE', $str)) === $md5) {
4125 4125
         return $encodingTmp;
4126 4126
       }
4127 4127
     }
@@ -4211,7 +4211,7 @@  discard block
 block discarded – undo
4211 4211
       if ('' === $s .= '') {
4212 4212
         $s = '/^(?<=.)$/';
4213 4213
       } else {
4214
-        $s = '/' . preg_quote($s, '/') . '/ui';
4214
+        $s = '/'.preg_quote($s, '/').'/ui';
4215 4215
       }
4216 4216
     }
4217 4217
 
@@ -4269,7 +4269,7 @@  discard block
 block discarded – undo
4269 4269
     }
4270 4270
 
4271 4271
     if (self::substr($str, $length - 1, 1) === ' ') {
4272
-      return self::substr($str, 0, $length - 1) . $strAddOn;
4272
+      return self::substr($str, 0, $length - 1).$strAddOn;
4273 4273
     }
4274 4274
 
4275 4275
     $str = self::substr($str, 0, $length);
@@ -4278,9 +4278,9 @@  discard block
 block discarded – undo
4278 4278
     $new_str = implode(' ', $array);
4279 4279
 
4280 4280
     if ($new_str === '') {
4281
-      $str = self::substr($str, 0, $length - 1) . $strAddOn;
4281
+      $str = self::substr($str, 0, $length - 1).$strAddOn;
4282 4282
     } else {
4283
-      $str = $new_str . $strAddOn;
4283
+      $str = $new_str.$strAddOn;
4284 4284
     }
4285 4285
 
4286 4286
     return $str;
@@ -4335,7 +4335,7 @@  discard block
 block discarded – undo
4335 4335
           $pre = '';
4336 4336
       }
4337 4337
 
4338
-      return $pre . $str . $post;
4338
+      return $pre.$str.$post;
4339 4339
     }
4340 4340
 
4341 4341
     return $str;
@@ -4465,7 +4465,7 @@  discard block
 block discarded – undo
4465 4465
     }
4466 4466
 
4467 4467
     /** @noinspection PhpInternalEntityUsedInspection */
4468
-    preg_match_all('/' . Grapheme::GRAPHEME_CLUSTER_RX . '/u', $str, $a);
4468
+    preg_match_all('/'.Grapheme::GRAPHEME_CLUSTER_RX.'/u', $str, $a);
4469 4469
     $a = $a[0];
4470 4470
 
4471 4471
     if ($len === 1) {
@@ -4660,7 +4660,7 @@  discard block
 block discarded – undo
4660 4660
   public static function strcmp($str1, $str2)
4661 4661
   {
4662 4662
     /** @noinspection PhpUndefinedClassInspection */
4663
-    return $str1 . '' === $str2 . '' ? 0 : strcmp(
4663
+    return $str1.'' === $str2.'' ? 0 : strcmp(
4664 4664
         \Normalizer::normalize($str1, \Normalizer::NFD),
4665 4665
         \Normalizer::normalize($str2, \Normalizer::NFD)
4666 4666
     );
@@ -4691,7 +4691,7 @@  discard block
 block discarded – undo
4691 4691
       return null;
4692 4692
     }
4693 4693
 
4694
-    if (preg_match('/^(.*?)' . self::rxClass($charList) . '/us', $str, $length)) {
4694
+    if (preg_match('/^(.*?)'.self::rxClass($charList).'/us', $str, $length)) {
4695 4695
       /** @noinspection OffsetOperationsInspection */
4696 4696
       return self::strlen($length[1]);
4697 4697
     }
@@ -4898,7 +4898,7 @@  discard block
 block discarded – undo
4898 4898
         &&
4899 4899
         self::$support['mbstring'] === false
4900 4900
     ) {
4901
-      trigger_error('UTF8::stristr() without mbstring cannot handle "' . $encoding . '" encoding', E_USER_WARNING);
4901
+      trigger_error('UTF8::stristr() without mbstring cannot handle "'.$encoding.'" encoding', E_USER_WARNING);
4902 4902
     }
4903 4903
 
4904 4904
     if (self::$support['mbstring'] === true) {
@@ -4909,7 +4909,7 @@  discard block
 block discarded – undo
4909 4909
       return \grapheme_stristr($haystack, $needle, $before_needle);
4910 4910
     }
4911 4911
 
4912
-    preg_match('/^(.*?)' . preg_quote($needle, '/') . '/usi', $haystack, $match);
4912
+    preg_match('/^(.*?)'.preg_quote($needle, '/').'/usi', $haystack, $match);
4913 4913
 
4914 4914
     if (!isset($match[1])) {
4915 4915
       return false;
@@ -4973,7 +4973,7 @@  discard block
 block discarded – undo
4973 4973
         &&
4974 4974
         self::$support['iconv'] === false
4975 4975
     ) {
4976
-      trigger_error('UTF8::strlen() without mbstring / iconv cannot handle "' . $encoding . '" encoding', E_USER_WARNING);
4976
+      trigger_error('UTF8::strlen() without mbstring / iconv cannot handle "'.$encoding.'" encoding', E_USER_WARNING);
4977 4977
     }
4978 4978
 
4979 4979
     if (
@@ -5052,7 +5052,7 @@  discard block
 block discarded – undo
5052 5052
    */
5053 5053
   public static function strnatcmp($str1, $str2)
5054 5054
   {
5055
-    return $str1 . '' === $str2 . '' ? 0 : strnatcmp(self::strtonatfold($str1), self::strtonatfold($str2));
5055
+    return $str1.'' === $str2.'' ? 0 : strnatcmp(self::strtonatfold($str1), self::strtonatfold($str2));
5056 5056
   }
5057 5057
 
5058 5058
   /**
@@ -5113,7 +5113,7 @@  discard block
 block discarded – undo
5113 5113
       return false;
5114 5114
     }
5115 5115
 
5116
-    if (preg_match('/' . self::rxClass($char_list) . '/us', $haystack, $m)) {
5116
+    if (preg_match('/'.self::rxClass($char_list).'/us', $haystack, $m)) {
5117 5117
       return substr($haystack, strpos($haystack, $m[0]));
5118 5118
     } else {
5119 5119
       return false;
@@ -5182,7 +5182,7 @@  discard block
 block discarded – undo
5182 5182
         &&
5183 5183
         self::$support['mbstring'] === false
5184 5184
     ) {
5185
-      trigger_error('UTF8::strpos() without mbstring / iconv cannot handle "' . $encoding . '" encoding', E_USER_WARNING);
5185
+      trigger_error('UTF8::strpos() without mbstring / iconv cannot handle "'.$encoding.'" encoding', E_USER_WARNING);
5186 5186
     }
5187 5187
 
5188 5188
     if (
@@ -5398,7 +5398,7 @@  discard block
 block discarded – undo
5398 5398
         &&
5399 5399
         self::$support['mbstring'] === false
5400 5400
     ) {
5401
-      trigger_error('UTF8::strripos() without mbstring cannot handle "' . $encoding . '" encoding', E_USER_WARNING);
5401
+      trigger_error('UTF8::strripos() without mbstring cannot handle "'.$encoding.'" encoding', E_USER_WARNING);
5402 5402
     }
5403 5403
 
5404 5404
     if (self::$support['mbstring'] === true) {
@@ -5478,7 +5478,7 @@  discard block
 block discarded – undo
5478 5478
         &&
5479 5479
         self::$support['mbstring'] === false
5480 5480
     ) {
5481
-      trigger_error('UTF8::strrpos() without mbstring cannot handle "' . $encoding . '" encoding', E_USER_WARNING);
5481
+      trigger_error('UTF8::strrpos() without mbstring cannot handle "'.$encoding.'" encoding', E_USER_WARNING);
5482 5482
     }
5483 5483
 
5484 5484
     if (self::$support['mbstring'] === true) {
@@ -5538,7 +5538,7 @@  discard block
 block discarded – undo
5538 5538
       return 0;
5539 5539
     }
5540 5540
 
5541
-    return preg_match('/^' . self::rxClass($mask) . '+/u', $str, $str) ? self::strlen($str[0]) : 0;
5541
+    return preg_match('/^'.self::rxClass($mask).'+/u', $str, $str) ? self::strlen($str[0]) : 0;
5542 5542
   }
5543 5543
 
5544 5544
   /**
@@ -5584,7 +5584,7 @@  discard block
 block discarded – undo
5584 5584
         &&
5585 5585
         self::$support['mbstring'] === false
5586 5586
     ) {
5587
-      trigger_error('UTF8::strstr() without mbstring cannot handle "' . $encoding . '" encoding', E_USER_WARNING);
5587
+      trigger_error('UTF8::strstr() without mbstring cannot handle "'.$encoding.'" encoding', E_USER_WARNING);
5588 5588
     }
5589 5589
 
5590 5590
     if (self::$support['mbstring'] === true) {
@@ -5601,7 +5601,7 @@  discard block
 block discarded – undo
5601 5601
       }
5602 5602
     }
5603 5603
 
5604
-    preg_match('/^(.*?)' . preg_quote($needle, '/') . '/us', $haystack, $match);
5604
+    preg_match('/^(.*?)'.preg_quote($needle, '/').'/us', $haystack, $match);
5605 5605
 
5606 5606
     if (!isset($match[1])) {
5607 5607
       return false;
@@ -5865,7 +5865,7 @@  discard block
 block discarded – undo
5865 5865
         &&
5866 5866
         self::$support['mbstring'] === false
5867 5867
     ) {
5868
-      trigger_error('UTF8::substr() without mbstring cannot handle "' . $encoding . '" encoding', E_USER_WARNING);
5868
+      trigger_error('UTF8::substr() without mbstring cannot handle "'.$encoding.'" encoding', E_USER_WARNING);
5869 5869
     }
5870 5870
 
5871 5871
     if (self::$support['mbstring'] === true) {
@@ -5978,14 +5978,14 @@  discard block
 block discarded – undo
5978 5978
         &&
5979 5979
         self::$support['mbstring'] === false
5980 5980
     ) {
5981
-      trigger_error('UTF8::substr_count() without mbstring cannot handle "' . $encoding . '" encoding', E_USER_WARNING);
5981
+      trigger_error('UTF8::substr_count() without mbstring cannot handle "'.$encoding.'" encoding', E_USER_WARNING);
5982 5982
     }
5983 5983
 
5984 5984
     if (self::$support['mbstring'] === true) {
5985 5985
       return \mb_substr_count($haystack, $needle, $encoding);
5986 5986
     }
5987 5987
 
5988
-    preg_match_all('/' . preg_quote($needle, '/') . '/us', $haystack, $matches, PREG_SET_ORDER);
5988
+    preg_match_all('/'.preg_quote($needle, '/').'/us', $haystack, $matches, PREG_SET_ORDER);
5989 5989
 
5990 5990
     return count($matches);
5991 5991
   }
@@ -6232,7 +6232,7 @@  discard block
 block discarded – undo
6232 6232
 
6233 6233
     $strSwappedCase = preg_replace_callback(
6234 6234
         '/[\S]/u',
6235
-        function ($match) use ($encoding) {
6235
+        function($match) use ($encoding) {
6236 6236
           $marchToUpper = UTF8::strtoupper($match[0], $encoding);
6237 6237
 
6238 6238
           if ($match[0] === $marchToUpper) {
@@ -6422,7 +6422,7 @@  discard block
 block discarded – undo
6422 6422
 
6423 6423
       $bank = $ord >> 8;
6424 6424
       if (!array_key_exists($bank, (array)$UTF8_TO_ASCII)) {
6425
-        $bankfile = __DIR__ . '/data/' . sprintf('x%02x', $bank) . '.php';
6425
+        $bankfile = __DIR__.'/data/'.sprintf('x%02x', $bank).'.php';
6426 6426
         if (file_exists($bankfile)) {
6427 6427
           /** @noinspection PhpIncludeInspection */
6428 6428
           require $bankfile;
@@ -6544,40 +6544,40 @@  discard block
 block discarded – undo
6544 6544
         if ($c1 >= "\xc0" & $c1 <= "\xdf") { // looks like 2 bytes UTF8
6545 6545
 
6546 6546
           if ($c2 >= "\x80" && $c2 <= "\xbf") { // yeah, almost sure it's UTF8 already
6547
-            $buf .= $c1 . $c2;
6547
+            $buf .= $c1.$c2;
6548 6548
             $i++;
6549 6549
           } else { // not valid UTF8 - convert it
6550 6550
             $cc1 = (chr(ord($c1) / 64) | "\xc0");
6551 6551
             $cc2 = ($c1 & "\x3f") | "\x80";
6552
-            $buf .= $cc1 . $cc2;
6552
+            $buf .= $cc1.$cc2;
6553 6553
           }
6554 6554
 
6555 6555
         } elseif ($c1 >= "\xe0" & $c1 <= "\xef") { // looks like 3 bytes UTF8
6556 6556
 
6557 6557
           if ($c2 >= "\x80" && $c2 <= "\xbf" && $c3 >= "\x80" && $c3 <= "\xbf") { // yeah, almost sure it's UTF8 already
6558
-            $buf .= $c1 . $c2 . $c3;
6558
+            $buf .= $c1.$c2.$c3;
6559 6559
             $i += 2;
6560 6560
           } else { // not valid UTF8 - convert it
6561 6561
             $cc1 = (chr(ord($c1) / 64) | "\xc0");
6562 6562
             $cc2 = ($c1 & "\x3f") | "\x80";
6563
-            $buf .= $cc1 . $cc2;
6563
+            $buf .= $cc1.$cc2;
6564 6564
           }
6565 6565
 
6566 6566
         } elseif ($c1 >= "\xf0" & $c1 <= "\xf7") { // looks like 4 bytes UTF8
6567 6567
 
6568 6568
           if ($c2 >= "\x80" && $c2 <= "\xbf" && $c3 >= "\x80" && $c3 <= "\xbf" && $c4 >= "\x80" && $c4 <= "\xbf") { // yeah, almost sure it's UTF8 already
6569
-            $buf .= $c1 . $c2 . $c3 . $c4;
6569
+            $buf .= $c1.$c2.$c3.$c4;
6570 6570
             $i += 3;
6571 6571
           } else { // not valid UTF8 - convert it
6572 6572
             $cc1 = (chr(ord($c1) / 64) | "\xc0");
6573 6573
             $cc2 = ($c1 & "\x3f") | "\x80";
6574
-            $buf .= $cc1 . $cc2;
6574
+            $buf .= $cc1.$cc2;
6575 6575
           }
6576 6576
 
6577 6577
         } else { // doesn't look like UTF8, but should be converted
6578 6578
           $cc1 = (chr(ord($c1) / 64) | "\xc0");
6579 6579
           $cc2 = (($c1 & "\x3f") | "\x80");
6580
-          $buf .= $cc1 . $cc2;
6580
+          $buf .= $cc1.$cc2;
6581 6581
         }
6582 6582
 
6583 6583
       } elseif (($c1 & "\xc0") === "\x80") { // needs conversion
@@ -6588,7 +6588,7 @@  discard block
 block discarded – undo
6588 6588
         } else {
6589 6589
           $cc1 = (chr($ordC1 / 64) | "\xc0");
6590 6590
           $cc2 = (($c1 & "\x3f") | "\x80");
6591
-          $buf .= $cc1 . $cc2;
6591
+          $buf .= $cc1.$cc2;
6592 6592
         }
6593 6593
 
6594 6594
       } else { // it doesn't need conversion
@@ -6599,7 +6599,7 @@  discard block
 block discarded – undo
6599 6599
     // decode unicode escape sequences
6600 6600
     $buf = preg_replace_callback(
6601 6601
         '/\\\\u([0-9a-f]{4})/i',
6602
-        function ($match) {
6602
+        function($match) {
6603 6603
           return \mb_convert_encoding(pack('H*', $match[1]), 'UTF-8', 'UCS-2BE');
6604 6604
         },
6605 6605
         $buf
@@ -6653,7 +6653,7 @@  discard block
 block discarded – undo
6653 6653
    */
6654 6654
   public static function ucfirst($str, $encoding = 'UTF-8', $cleanUtf8 = false)
6655 6655
   {
6656
-    return self::strtoupper(self::substr($str, 0, 1, $encoding, $cleanUtf8), $encoding, $cleanUtf8) . self::substr($str, 1, null, $encoding, $cleanUtf8);
6656
+    return self::strtoupper(self::substr($str, 0, 1, $encoding, $cleanUtf8), $encoding, $cleanUtf8).self::substr($str, 1, null, $encoding, $cleanUtf8);
6657 6657
   }
6658 6658
 
6659 6659
   /**
@@ -7130,7 +7130,7 @@  discard block
 block discarded – undo
7130 7130
       return '';
7131 7131
     }
7132 7132
 
7133
-    preg_match('/^\s*+(?:\S++\s*+){1,' . $words . '}/u', $str, $matches);
7133
+    preg_match('/^\s*+(?:\S++\s*+){1,'.$words.'}/u', $str, $matches);
7134 7134
 
7135 7135
     if (
7136 7136
         !isset($matches[0])
@@ -7140,7 +7140,7 @@  discard block
 block discarded – undo
7140 7140
       return $str;
7141 7141
     }
7142 7142
 
7143
-    return self::rtrim($matches[0]) . $strAddOn;
7143
+    return self::rtrim($matches[0]).$strAddOn;
7144 7144
   }
7145 7145
 
7146 7146
   /**
@@ -7208,7 +7208,7 @@  discard block
 block discarded – undo
7208 7208
       $strReturn .= $break;
7209 7209
     }
7210 7210
 
7211
-    return $strReturn . implode('', $chars);
7211
+    return $strReturn.implode('', $chars);
7212 7212
   }
7213 7213
 
7214 7214
   /**
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
@@ -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.