REDROOM
PHP 8.3.31
Path:
Logout
Edit File
Size: 1.76 KB
Close
/home/getspomw/royalsquad.us/vendor/laravel/prompts/src/Themes/Default/Concerns/DrawsScrollbars.php
Text
Base64
<?php namespace Laravel\Prompts\Themes\Default\Concerns; use Illuminate\Support\Collection; trait DrawsScrollbars { /** * Render a scrollbar beside the visible items. * * @template T of array<int, string>|\Illuminate\Support\Collection<int, string> * * @param T $visible * @return T */ protected function scrollbar(array|Collection $visible, int $firstVisible, int $height, int $total, int $width, string $color = 'cyan'): array|Collection { if ($height >= $total) { return $visible; } $scrollPosition = $this->scrollPosition($firstVisible, $height, $total); $lines = $visible instanceof Collection ? $visible->all() : $visible; $result = array_map(fn ($line, $index) => match ($index) { $scrollPosition => preg_replace('/.$/', $this->{$color}('┃'), $this->pad($line, $width)) ?? '', default => preg_replace('/.$/', $this->gray('│'), $this->pad($line, $width)) ?? '', }, array_values($lines), range(0, count($lines) - 1)); return $visible instanceof Collection ? new Collection($result) : $result; // @phpstan-ignore return.type (https://github.com/phpstan/phpstan/issues/11663) } /** * Return the position where the scrollbar "handle" should be rendered. */ protected function scrollPosition(int $firstVisible, int $height, int $total): int { if ($firstVisible === 0) { return 0; } $maxPosition = $total - $height; if ($firstVisible === $maxPosition) { return $height - 1; } if ($height <= 2) { return -1; } $percent = $firstVisible / $maxPosition; return (int) round($percent * ($height - 3)) + 1; } }
Save
Close
Exit & Reset
Text mode: syntax highlighting auto-detects file type.
Directory Contents
Dirs: 0 × Files: 4
Delete Selected
Select All
Select None
Sort:
Name
Size
Modified
Enable drag-to-move
Name
Size
Perms
Modified
Actions
DrawsBoxes.php
1.67 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
DrawsScrollbars.php
1.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
error_log
696 B
lrw-r--r--
2026-04-26 10:18:10
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
InteractsWithStrings.php
1.27 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).