Renderer
abstract class Renderer implements Stringable
Traits
Properties
| protected string | $output | The output to be rendered. |
Methods
Truncate a value with an ellipsis if it exceeds the given width.
Apply the callback if the given "value" is truthy.
Render the output with a blank line above and below.
Details
in
Colors at line 12
string
reset(string $text)
Reset all colors and styles.
in
Colors at line 20
string
bold(string $text)
Make the text bold.
in
Colors at line 28
string
dim(string $text)
Make the text dim.
in
Colors at line 36
string
italic(string $text)
Make the text italic.
in
Colors at line 44
string
underline(string $text)
Underline the text.
in
Colors at line 52
string
inverse(string $text)
Invert the text and background colors.
in
Colors at line 60
string
hidden(string $text)
Hide the text.
in
Colors at line 68
string
strikethrough(string $text)
Strike through the text.
in
Colors at line 76
string
black(string $text)
Set the text color to black.
in
Colors at line 84
string
red(string $text)
Set the text color to red.
in
Colors at line 92
string
green(string $text)
Set the text color to green.
in
Colors at line 100
string
yellow(string $text)
Set the text color to yellow.
in
Colors at line 108
string
blue(string $text)
Set the text color to blue.
in
Colors at line 116
string
magenta(string $text)
Set the text color to magenta.
in
Colors at line 124
string
cyan(string $text)
Set the text color to cyan.
in
Colors at line 132
string
white(string $text)
Set the text color to white.
in
Colors at line 140
string
bgBlack(string $text)
Set the text background to black.
in
Colors at line 148
string
bgRed(string $text)
Set the text background to red.
in
Colors at line 156
string
bgGreen(string $text)
Set the text background to green.
in
Colors at line 164
string
bgYellow(string $text)
Set the text background to yellow.
in
Colors at line 172
string
bgBlue(string $text)
Set the text background to blue.
in
Colors at line 180
string
bgMagenta(string $text)
Set the text background to magenta.
in
Colors at line 188
string
bgCyan(string $text)
Set the text background to cyan.
in
Colors at line 196
string
bgWhite(string $text)
Set the text background to white.
in
Colors at line 204
string
gray(string $text)
Set the text color to gray.
in
Truncation at line 14
protected string
truncate(string $string, int $width)
Truncate a value with an ellipsis if it exceeds the given width.
at line 25
__construct(Prompt $prompt)
Create a new renderer instance.
at line 32
protected Renderer
line(string $message)
Render a line of output.
at line 42
protected Renderer
newLine(int $count = 1)
Render a new line.
at line 52
protected Renderer
warning(string $message)
Render a warning message.
at line 60
protected Renderer
error(string $message)
Render an error message.
at line 68
protected Renderer
hint(string $message)
Render an hint message.
at line 84
protected Renderer
when(mixed $value, callable $callback, callable|null $default = null)
Apply the callback if the given "value" is truthy.
at line 98
__toString()
Render the output with a blank line above and below.