REDROOM
PHP 8.3.31
Path:
Logout
Edit File
Size: 2.84 KB
Close
/home/getspomw/royalsquad.us/vendor/laravel/prompts/src/Concerns/Truncation.php
Text
Base64
<?php namespace Laravel\Prompts\Concerns; use InvalidArgumentException; trait Truncation { /** * Truncate a value with an ellipsis if it exceeds the given width. */ protected function truncate(string $string, int $width): string { if ($width <= 0) { throw new InvalidArgumentException("Width [{$width}] must be greater than zero."); } return mb_strwidth($string) <= $width ? $string : (mb_strimwidth($string, 0, $width - 1).'…'); } /** * Multi-byte version of wordwrap. * * @param non-empty-string $break */ protected function mbWordwrap( string $string, int $width = 75, string $break = "\n", bool $cut_long_words = false ): string { $lines = explode($break, $string); $result = []; foreach ($lines as $originalLine) { if (mb_strwidth($originalLine) <= $width) { $result[] = $originalLine; continue; } $words = explode(' ', $originalLine); $line = null; $lineWidth = 0; if ($cut_long_words) { foreach ($words as $index => $word) { $characters = mb_str_split($word); $strings = []; $str = ''; foreach ($characters as $character) { $tmp = $str.$character; if (mb_strwidth($tmp) > $width) { $strings[] = $str; $str = $character; } else { $str = $tmp; } } if ($str !== '') { $strings[] = $str; } $words[$index] = implode(' ', $strings); } $words = explode(' ', implode(' ', $words)); } foreach ($words as $word) { $tmp = ($line === null) ? $word : $line.' '.$word; // Look for zero-width joiner characters (combined emojis) preg_match('/\p{Cf}/u', $word, $joinerMatches); $wordWidth = count($joinerMatches) > 0 ? 2 : mb_strwidth($word); $lineWidth += $wordWidth; if ($line !== null) { // Space between words $lineWidth += 1; } if ($lineWidth <= $width) { $line = $tmp; } else { $result[] = $line; $line = $word; $lineWidth = $wordWidth; } } if ($line !== '') { $result[] = $line; } $line = null; } return implode($break, $result); } }
Save
Close
Exit & Reset
Text mode: syntax highlighting auto-detects file type.
Directory Contents
Dirs: 0 × Files: 12
Delete Selected
Select All
Select None
Sort:
Name
Size
Modified
Enable drag-to-move
Name
Size
Perms
Modified
Actions
Colors.php
3.76 KB
lrw-rw-rw-
2025-09-17 06:52:54
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Cursor.php
1.53 KB
lrw-rw-rw-
2025-09-17 06:52:54
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Erase.php
611 B
lrw-rw-rw-
2025-09-17 06:52:54
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Events.php
753 B
lrw-rw-rw-
2025-09-17 06:52:54
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
FakesInputOutput.php
3.28 KB
lrw-rw-rw-
2025-09-17 06:52:54
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Fallback.php
1.40 KB
lrw-rw-rw-
2025-09-17 06:52:54
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Interactivity.php
761 B
lrw-rw-rw-
2025-09-17 06:52:54
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Scrolling.php
2.92 KB
lrw-rw-rw-
2025-09-17 06:52:54
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Termwind.php
525 B
lrw-rw-rw-
2025-09-17 06:52:54
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Themes.php
3.91 KB
lrw-rw-rw-
2025-09-17 06:52:54
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Truncation.php
2.84 KB
lrw-rw-rw-
2025-09-17 06:52:54
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
TypedValue.php
4.92 KB
lrw-rw-rw-
2025-09-17 06:52:54
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Zip Selected
If ZipArchive is unavailable, a
.tar
will be created (no compression).