@@ -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 | $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 |
||
| 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 | } |
@@ -355,7 +355,7 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 | /** |