ConsoleOutput
FinalYes
Methods
- __construct() : mixed
- blue() : string
- bold() : string
- border() : string
- cyan() : string
- dim() : string
- formatDuration() : string
- formatTimestamp() : string
- formatValue() : string
- gray() : string
- green() : string
- pad() : string
- Multi-byte safe string padding that accounts for ANSI color codes.
- red() : string
- row() : string
- stripColors() : string
- truncate() : string
- Truncate text to a maximum visible length, accounting for ANSI codes.
- write() : void
- yellow() : string
Methods
__construct()
public
__construct([bool $colors = true ][, null|resource $stream = null ]) : mixed
Parameters
- $colors : bool = true
-
Whether to use ANSI colors
- $stream : null|resource = null
-
Output stream (default: STDOUT)
blue()
public
blue(string $text) : string
Parameters
- $text : string
Return values
stringbold()
public
bold(string $text) : string
Parameters
- $text : string
Return values
stringborder()
public
border(int $width) : string
Parameters
- $width : int
Return values
stringcyan()
public
cyan(string $text) : string
Parameters
- $text : string
Return values
stringdim()
public
dim(string $text) : string
Parameters
- $text : string
Return values
stringformatDuration()
public
formatDuration(float|null $ms) : string
Parameters
- $ms : float|null
Return values
stringformatTimestamp()
public
formatTimestamp(DateTimeImmutable $dt) : string
Parameters
- $dt : DateTimeImmutable
Return values
stringformatValue()
public
formatValue(null|array<string|int, mixed>|bool|float|int|string $value) : string
Parameters
- $value : null|array<string|int, mixed>|bool|float|int|string
Return values
stringgray()
public
gray(string $text) : string
Parameters
- $text : string
Return values
stringgreen()
public
green(string $text) : string
Parameters
- $text : string
Return values
stringpad()
Multi-byte safe string padding that accounts for ANSI color codes.
public
pad(string $input, int $length[, string $padding = ' ' ][, int $padType = STR_PAD_RIGHT ]) : string
Parameters
- $input : string
- $length : int
- $padding : string = ' '
- $padType : int = STR_PAD_RIGHT
Tags
Return values
stringred()
public
red(string $text) : string
Parameters
- $text : string
Return values
stringrow()
public
row(string $content, int $width) : string
Parameters
- $content : string
- $width : int
Return values
stringstripColors()
public
stripColors(string $text) : string
Parameters
- $text : string
Return values
stringtruncate()
Truncate text to a maximum visible length, accounting for ANSI codes.
public
truncate(string $text, int $max) : string
Parameters
- $text : string
- $max : int
Return values
stringwrite()
public
write(string $text) : void
Parameters
- $text : string
yellow()
public
yellow(string $text) : string
Parameters
- $text : string