Passed
Branch dev (126955)
by Sergey
01:41
created
src/Strings.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -126,9 +126,9 @@  discard block
 block discarded – undo
126 126
      */
127 127
     public static function increment(string $string, int $first = 1, string $separator = '_'): string
128 128
     {
129
-        preg_match('/(.+)' . $separator . '([0-9]+)$/', $string, $match);
129
+        preg_match('/(.+)'.$separator.'([0-9]+)$/', $string, $match);
130 130
 
131
-        return isset($match[2]) ? $match[1] . $separator . ($match[2] + 1) : $string . $separator . $first;
131
+        return isset($match[2]) ? $match[1].$separator.($match[2] + 1) : $string.$separator.$first;
132 132
     }
133 133
 
134 134
     /**
@@ -159,7 +159,7 @@  discard block
 block discarded – undo
159 159
             return $string;
160 160
         }
161 161
 
162
-        return rtrim(mb_strimwidth($string, 0, $limit, '', 'UTF-8')) . $append;
162
+        return rtrim(mb_strimwidth($string, 0, $limit, '', 'UTF-8')).$append;
163 163
     }
164 164
 
165 165
     /**
@@ -230,10 +230,10 @@  discard block
 block discarded – undo
230 230
             return static::$cache['snake'][$key][$delimiter];
231 231
         }
232 232
 
233
-        if (! ctype_lower($string)) {
233
+        if (!ctype_lower($string)) {
234 234
             $string = preg_replace('/\s+/u', '', ucwords($string));
235 235
 
236
-            $string = static::lower(preg_replace('/(.)(?=[A-Z])/u', '$1' . $delimiter, $string));
236
+            $string = static::lower(preg_replace('/(.)(?=[A-Z])/u', '$1'.$delimiter, $string));
237 237
         }
238 238
 
239 239
         return static::$cache['snake'][$key][$delimiter] = $string;
@@ -272,13 +272,13 @@  discard block
 block discarded – undo
272 272
      */
273 273
     public static function words(string $string, int $words = 100, string $append = '...'): string
274 274
     {
275
-        preg_match('/^\s*+(?:\S++\s*+){1,' . $words . '}/u', $string, $matches);
275
+        preg_match('/^\s*+(?:\S++\s*+){1,'.$words.'}/u', $string, $matches);
276 276
 
277
-        if (! isset($matches[0]) || static::length($string) === static::length($matches[0])) {
277
+        if (!isset($matches[0]) || static::length($string) === static::length($matches[0])) {
278 278
             return $string;
279 279
         }
280 280
 
281
-        return static::trimRight($matches[0]) . $append;
281
+        return static::trimRight($matches[0]).$append;
282 282
     }
283 283
 
284 284
     /**
@@ -322,7 +322,7 @@  discard block
 block discarded – undo
322 322
     public static function containsAll(string $haystack, array $needles): bool
323 323
     {
324 324
         foreach ($needles as $needle) {
325
-            if (! static::contains($haystack, $needle)) {
325
+            if (!static::contains($haystack, $needle)) {
326 326
                 return false;
327 327
             }
328 328
         }
@@ -355,7 +355,7 @@  discard block
 block discarded – undo
355 355
      */
356 356
     public static function ucfirst(string $string): string
357 357
     {
358
-        return static::upper(static::substr($string, 0, 1)) . static::substr($string, 1);
358
+        return static::upper(static::substr($string, 0, 1)).static::substr($string, 1);
359 359
     }
360 360
 
361 361
     /**
@@ -598,7 +598,7 @@  discard block
 block discarded – undo
598 598
         $result = array_shift($segments);
599 599
 
600 600
         foreach ($segments as $segment) {
601
-            $result .= (array_shift($replace) ?? $search) . $segment;
601
+            $result .= (array_shift($replace) ?? $search).$segment;
602 602
         }
603 603
 
604 604
         return $result;
@@ -654,7 +654,7 @@  discard block
 block discarded – undo
654 654
     {
655 655
         $quoted = preg_quote($prefix, '/');
656 656
 
657
-        return $prefix . preg_replace('/^(?:' . $quoted . ')+/u', '', $string);
657
+        return $prefix.preg_replace('/^(?:'.$quoted.')+/u', '', $string);
658 658
     }
659 659
 
660 660
     /**
@@ -701,7 +701,7 @@  discard block
 block discarded – undo
701 701
     {
702 702
         $quoted = preg_quote($cap, '/');
703 703
 
704
-        return preg_replace('/(?:' . $quoted . ')+$/u', '', $string) . $cap;
704
+        return preg_replace('/(?:'.$quoted.')+$/u', '', $string).$cap;
705 705
     }
706 706
 
707 707
     /**
Please login to merge, or discard this patch.