@@ -126,9 +126,9 @@ discard block |
||
| 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 |
||
| 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 |
||
| 230 | 230 | return static::$cache['snake'][$key][$delimiter]; |
| 231 | 231 | } |
| 232 | 232 | |
| 233 | - if (! ctype_lower($string)) { |
|
| 233 | + if (!ctype_lower($string)) { |
|
| 234 | 234 | $value = 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 |
||
| 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 |
||
| 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 | } |
@@ -338,7 +338,7 @@ discard block |
||
| 338 | 338 | */ |
| 339 | 339 | public static function ucfirst(string $string): string |
| 340 | 340 | { |
| 341 | - return static::upper(static::substr($string, 0, 1)) . static::substr($string, 1); |
|
| 341 | + return static::upper(static::substr($string, 0, 1)).static::substr($string, 1); |
|
| 342 | 342 | } |
| 343 | 343 | |
| 344 | 344 | /** |
@@ -581,7 +581,7 @@ discard block |
||
| 581 | 581 | $result = array_shift($segments); |
| 582 | 582 | |
| 583 | 583 | foreach ($segments as $segment) { |
| 584 | - $result .= (array_shift($replace) ?? $search) . $segment; |
|
| 584 | + $result .= (array_shift($replace) ?? $search).$segment; |
|
| 585 | 585 | } |
| 586 | 586 | |
| 587 | 587 | return $result; |
@@ -637,7 +637,7 @@ discard block |
||
| 637 | 637 | { |
| 638 | 638 | $quoted = preg_quote($prefix, '/'); |
| 639 | 639 | |
| 640 | - return $prefix . preg_replace('/^(?:' . $quoted . ')+/u', '', $string); |
|
| 640 | + return $prefix.preg_replace('/^(?:'.$quoted.')+/u', '', $string); |
|
| 641 | 641 | } |
| 642 | 642 | |
| 643 | 643 | /** |
@@ -684,7 +684,7 @@ discard block |
||
| 684 | 684 | { |
| 685 | 685 | $quoted = preg_quote($cap, '/'); |
| 686 | 686 | |
| 687 | - return preg_replace('/(?:' . $quoted . ')+$/u', '', $string) . $cap; |
|
| 687 | + return preg_replace('/(?:'.$quoted.')+$/u', '', $string).$cap; |
|
| 688 | 688 | } |
| 689 | 689 | |
| 690 | 690 | /** |