HasOutput Trait
Aurora\Console Namespace
Methods
blank
Output a blank line
Return Value
$this
Signature
public function blank()
format
Format a variable for output
Parameters
-
mixed
$var
— The message to show or an array of items to format -
string
$format
— Format string to apply to the items
Return Value
string
Signature
protected function format(mixed $var, string $format = ''): string
line
Show an info message
Parameters
-
mixed
$var
— The message to show or an array of items to format -
string
$format
— Format string to apply to the items
Return Value
$this
Signature
public function line(mixed $var, string $format = '')
info
Show an info message
Parameters
-
mixed
$var
— The message to show or an array of items to format -
string
$format
— Format string to apply to the items
Return Value
$this
Signature
public function info(mixed $var, string $format = '')
success
Show a success message
Parameters
-
mixed
$var
— The message to show or an array of items to format -
string
$format
— Format string to apply to the items
Return Value
$this
Signature
public function success(mixed $var, string $format = '')
error
Show an error message
Parameters
-
mixed
$var
— The message to show or an array of items to format -
string
$format
— Format string to apply to the items
Return Value
$this
Signature
public function error(mixed $var, string $format = '')
warning
Show a warning message
Parameters
-
mixed
$var
— The message to show or an array of items to format -
string
$format
— Format string to apply to the items
Return Value
$this
Signature
public function warning(mixed $var, string $format = '')
progressBar
Show a progress bar
Parameters
-
int
$done
— Percent done (0...100) -
int
$width
— Width of the progress bar in characters -
string
$progress
— Character for the progress indicator -
string
$filled
— Character for a filled step -
string
$empty
— Character for an empty step
Return Value
$this
Signature
public function progressBar(int $done, int $width = 28, string $progress = '>', string $filled = '=', string $empty = '-')
colorize
Generates a colorized string
Parameters
-
string
$str
— String to colorize -
string
$color
— Color to use
Return Value
string
Signature
public function colorize(string $str, string $color): string
escape
Generate an escape sequence
Parameters
-
string
$code
— ANSI code for the escape sequence
Return Value
string
Signature
protected function escape(string $code): string