DrawsBoxes
trait DrawsBoxes
Traits
Properties
| protected int | $minWidth |
Methods
int
longest(array $lines, int $padding = 0)
Get the length of the longest line.
from
InteractsWithStrings
string
pad(string $text, int $length, string $char = ' ')
Pad text ignoring ANSI escape sequences.
from
InteractsWithStrings
string
stripEscapeSequences(string $text)
Strip ANSI escape sequences from the given text.
from
InteractsWithStrings
string
mbWordwrap(string $string, int $width = 75, string $break = "\n", bool $cut_long_words = false)
Multi-byte version of wordwrap.
from
InteractsWithStrings
array
ansiWordwrap(string $text, int $width)
Word wrap text while preserving ANSI escape sequences.
from
InteractsWithStrings
array
parseAnsiText(string $text)
Parse text into segments with their associated ANSI codes.
from
InteractsWithStrings
box(string $title, string $body, string $footer = '', string $color = 'gray', string $info = '')
Draw a box.
Details
in
InteractsWithStrings at line 14
protected int
longest(array $lines, int $padding = 0)
Get the length of the longest line.
in
InteractsWithStrings at line 25
protected string
pad(string $text, int $length, string $char = ' ')
Pad text ignoring ANSI escape sequences.
in
InteractsWithStrings at line 35
protected string
stripEscapeSequences(string $text)
Strip ANSI escape sequences from the given text.
in
InteractsWithStrings at line 52
protected string
mbWordwrap(string $string, int $width = 75, string $break = "\n", bool $cut_long_words = false)
Multi-byte version of wordwrap.
in
InteractsWithStrings at line 138
protected array
ansiWordwrap(string $text, int $width)
Word wrap text while preserving ANSI escape sequences.
in
InteractsWithStrings at line 215
protected array
parseAnsiText(string $text)
Parse text into segments with their associated ANSI codes.
at line 20
protected DrawsBoxes
box(string $title, string $body, string $footer = '', string $color = 'gray', string $info = '')
Draw a box.