Passed
Branch dev (98b723)
by Sergey
02:12
created
src/Strings.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -122,9 +122,9 @@  discard block
 block discarded – undo
122 122
      */
123 123
     public static function increment(string $string, int $first = 1, string $separator = '_'): string
124 124
     {
125
-        preg_match('/(.+)' . $separator . '([0-9]+)$/', $string, $match);
125
+        preg_match('/(.+)'.$separator.'([0-9]+)$/', $string, $match);
126 126
 
127
-        return isset($match[2]) ? $match[1] . $separator . ($match[2] + 1) : $string . $separator . $first;
127
+        return isset($match[2]) ? $match[1].$separator.($match[2] + 1) : $string.$separator.$first;
128 128
     }
129 129
 
130 130
     /**
@@ -155,7 +155,7 @@  discard block
 block discarded – undo
155 155
             return $string;
156 156
         }
157 157
 
158
-        return rtrim(mb_strimwidth($string, 0, $limit, '', 'UTF-8')) . $append;
158
+        return rtrim(mb_strimwidth($string, 0, $limit, '', 'UTF-8')).$append;
159 159
     }
160 160
 
161 161
     /**
@@ -226,10 +226,10 @@  discard block
 block discarded – undo
226 226
             return static::$cache['snake'][$key][$delimiter];
227 227
         }
228 228
 
229
-        if (! ctype_lower($string)) {
229
+        if (!ctype_lower($string)) {
230 230
             $value = preg_replace('/\s+/u', '', ucwords($string));
231 231
 
232
-            $string = static::lower(preg_replace('/(.)(?=[A-Z])/u', '$1' . $delimiter, $string));
232
+            $string = static::lower(preg_replace('/(.)(?=[A-Z])/u', '$1'.$delimiter, $string));
233 233
         }
234 234
 
235 235
         return static::$cache['snake'][$key][$delimiter] = $string;
@@ -268,13 +268,13 @@  discard block
 block discarded – undo
268 268
      */
269 269
     public static function words(string $string, int $words = 100, string $append = '...'): string
270 270
     {
271
-        preg_match('/^\s*+(?:\S++\s*+){1,' . $words . '}/u', $string, $matches);
271
+        preg_match('/^\s*+(?:\S++\s*+){1,'.$words.'}/u', $string, $matches);
272 272
 
273
-        if (! isset($matches[0]) || static::length($string) === static::length($matches[0])) {
273
+        if (!isset($matches[0]) || static::length($string) === static::length($matches[0])) {
274 274
             return $string;
275 275
         }
276 276
 
277
-        return static::trimRight($matches[0]) . $append;
277
+        return static::trimRight($matches[0]).$append;
278 278
     }
279 279
 
280 280
     /**
@@ -303,7 +303,7 @@  discard block
 block discarded – undo
303 303
     public static function containsAll(string $haystack, array $needles): bool
304 304
     {
305 305
         foreach ($needles as $needle) {
306
-            if (! static::contains($haystack, $needle)) {
306
+            if (!static::contains($haystack, $needle)) {
307 307
                 return false;
308 308
             }
309 309
         }
@@ -319,7 +319,7 @@  discard block
 block discarded – undo
319 319
      */
320 320
     public static function ucfirst(string $string): string
321 321
     {
322
-        return static::upper(static::substr($string, 0, 1)) . static::substr($string, 1);
322
+        return static::upper(static::substr($string, 0, 1)).static::substr($string, 1);
323 323
     }
324 324
 
325 325
     /**
@@ -551,7 +551,7 @@  discard block
 block discarded – undo
551 551
         $result = array_shift($segments);
552 552
 
553 553
         foreach ($segments as $segment) {
554
-            $result .= (array_shift($replace) ?? $search) . $segment;
554
+            $result .= (array_shift($replace) ?? $search).$segment;
555 555
         }
556 556
 
557 557
         return $result;
@@ -607,7 +607,7 @@  discard block
 block discarded – undo
607 607
     {
608 608
         $quoted = preg_quote($prefix, '/');
609 609
 
610
-        return $prefix . preg_replace('/^(?:' . $quoted . ')+/u', '', $string);
610
+        return $prefix.preg_replace('/^(?:'.$quoted.')+/u', '', $string);
611 611
     }
612 612
 
613 613
     /**
@@ -654,6 +654,6 @@  discard block
 block discarded – undo
654 654
     {
655 655
         $quoted = preg_quote($cap, '/');
656 656
 
657
-        return preg_replace('/(?:' . $quoted . ')+$/u', '', $string) . $cap;
657
+        return preg_replace('/(?:'.$quoted.')+$/u', '', $string).$cap;
658 658
     }
659 659
 }
Please login to merge, or discard this patch.