Property | Type | Description | |
---|---|---|---|
$help | boolean | Similar to running li3 help COMMAND. | |
$plain | boolean | Only shows only text output without styles. | |
$request | object | A Request object. | |
$response | object | A Response object. | |
$silent | boolean | Only shows error output. |
Property | Type | Description | |
---|---|---|---|
$_autoConfig | array | Auto configuration. | |
$_classes | array | Dynamic dependencies. |
Method | Description | |
---|---|---|
__construct ( array $config = [] ) : void | Constructor. | |
__invoke ( string $action, array $args = [] ) : object | Called by the Dispatcher class to invoke an action. | |
clear ( ) : void | Clears the entire screen. | |
columns ( array $rows, array $options = [] ) : void | Writes rows of columns. | |
error ( string | array $error = null, mixed $options = ['nl' => 1] ) : integer | Writes a string to error stream. | |
header ( string $text, integer $line = null ) : void | Writes a header to the output stream. In addition to the actual text, horizontal lines before and afterwards are written. The lines will have the same length as the text. This behavior can be modified by providing the length of lines as a second paramerter. | |
hr ( integer $length = 80, integer $newlines = 1 ) : integer | Adds a horizontal line to output stream. | |
in ( string $prompt = null, array $options = [] ) : string | boolean | Handles input. Will continue to loop until $options['quit'] or result is part of $options['choices']. | |
nl ( integer $number = 1 ) : string | Add newlines ("\n") a given number of times and return them in a single string. | |
out ( string | array $output = null, mixed $options = ['nl' => 1] ) : integer | Writes a string to the output stream. | |
stop ( integer $status, string | null $message = null ) : void | Stop execution, by exiting the script. |
Method | Description | |
---|---|---|
_help ( ) : boolean | Invokes the Help command. | |
_init ( ) : void | Command Initializer. | |
_response ( string $type, string | array $string, mixed $options ) : void | Handles the response that is sent to the stream. |
public __construct ( array $config = [] ) : void | ||
$config | array | Available configuration options are: - `'request'` _object|null_ - `'response'` _array_ - `'classes'` _array_ |
return | void |
protected _response ( string $type, string | array $string, mixed $options ) : void | ||
$type | string | The stream either output or error. |
$string | string | array | The message to render. |
$options | mixed | When passed an integer or boolean it is used as the number of of new lines, when passed a string it is interpreted as style to use otherwise when an array following options are available: - `'nl'` _integer|boolean_: number of new lines to add at the end. `false` to disable adding a newline. - `'style'` _string_: the style name to wrap around the output. |
return | void |
public error ( string | array $error = null, mixed $options = ['nl' => 1] ) : integer | ||
$error | string | array | The string or an array of strings to write. |
$options | mixed | When passed an integer or boolean it is used as the number of of new lines, when passed a string it is interpreted as style to use otherwise when an array following options are available: - `'nl'` _integer|boolean_: number of new lines to add at the end. `false` to disable adding a newline. - `'style'` _string_: the style name to wrap around the output. |
return | integer |
public out ( string | array $output = null, mixed $options = ['nl' => 1] ) : integer | ||
$output | string | array | The string or an array of strings to write. |
$options | mixed | When passed an integer or boolean it is used as the number of of new lines, when passed a string it is interpreted as style to use otherwise when an array following options are available: - `'nl'` _integer|boolean_: number of new lines to add at the end. `false` to disable adding a newline. - `'style'` _string_: the style name to wrap around the output. |
return | integer |
public bool $plain | ||
return | boolean |