\Hubleto\Framework\Terminal
Properties
☍ output
public mixed $output
Methods
ƒ setOutput
public setOutput(mixed $output): void
Parameters
| Parameter |
Type |
Description |
$output |
mixed |
|
ƒ isLaunchedFromTerminal
public isLaunchedFromTerminal(): bool
ƒ echo
public echo(string $string): void
Parameters
| Parameter |
Type |
Description |
$string |
string |
|
ƒ color
Print special strings setting a specified color
public color(string $fgColor, string $bgColor = 'default'): void
Parameters
| Parameter |
Type |
Description |
$fgColor |
string |
|
$bgColor |
string |
|
ƒ readRaw
Read input from terminal/console
public readRaw(): string
ƒ read
Read input from terminal/console and return $default is none is entered.
public read(string $message, string $default = ''): string
Parameters
| Parameter |
Type |
Description |
$message |
string |
|
$default |
string |
|
ƒ choose
Get user selection from pre-defined options using terminal/console.
public choose(array $options, string $message, string $default = ''): string
Parameters
| Parameter |
Type |
Description |
$options |
array |
|
$message |
string |
|
$default |
string |
|
ƒ confirm
Ask for user confirmation
public confirm(string $question, array $yesAnswers = ['yes', 'y', '1']): bool
Parameters
| Parameter |
Type |
Description |
$question |
string |
|
$yesAnswers |
array |
Possible answers representing confirmation. |
ƒ yellow
Print message in terminal in yellow color
public yellow(string $message): void
Parameters
| Parameter |
Type |
Description |
$message |
string |
|
ƒ green
Print message in terminal in green color
public green(string $message): void
Parameters
| Parameter |
Type |
Description |
$message |
string |
|
ƒ red
Print message in terminal in red color
public red(string $message): void
Parameters
| Parameter |
Type |
Description |
$message |
string |
|
ƒ error
public error(string $message): void
Parameters
| Parameter |
Type |
Description |
$message |
string |
|
ƒ blue
Print message in terminal in blue color
public blue(string $message): void
Parameters
| Parameter |
Type |
Description |
$message |
string |
|
ƒ cyan
Print message in terminal in cyan color
public cyan(string $message): void
Parameters
| Parameter |
Type |
Description |
$message |
string |
|
ƒ white
Print message in terminal in white color
public white(string $message): void
Parameters
| Parameter |
Type |
Description |
$message |
string |
|
ƒ colored
Print message in terminal in specified color
public colored(string $bgColor, string $fgColor, string $message): void
Parameters
| Parameter |
Type |
Description |
$bgColor |
string |
|
$fgColor |
string |
|
$message |
string |
|
ƒ insertCodeToFile
[Description for insertCodeToFile]
public insertCodeToFile(string $file, string $tag, array $codeLines): bool
Parameters
| Parameter |
Type |
Description |
$file |
string |
|
$tag |
string |
|
$codeLines |
array |
|