Output
Output
Console output helper with formatter integration.
class OutputApplies style markup formatting to outgoing messages and writes the final rendered text to standard output.
Properties
formatter
Message formatter used to render console style tags.
private OutputFormatter $formatterMethods
__construct
Creates an output writer with the default formatter implementation.
public __construct(): voidwrite
Writes a formatted message to standard output.
public write(string $message): voidParameters
| Parameter | Type | Description |
|---|---|---|
$message | string | message containing optional formatter markup |
writeln
Writes a formatted message to standard output followed by a newline.
public writeln(string $message): voidParameters
| Parameter | Type | Description |
|---|---|---|
$message | string | message containing optional formatter markup |
prompt
Prompts the user for input, optionally hiding typed characters for secrets.
public prompt(string $label, ?string $default, bool $secret): stringWrites the label (and optional default in brackets) to standard output, then reads a single line from STDIN. When $secret is true, terminal echo is suppressed while the user types and a * is rendered for each character.
Parameters
| Parameter | Type | Description |
|---|---|---|
$label | string | prompt text shown to the user |
$default | string | default value shown in brackets; returned when the user submits empty input |
$secret | bool | when true the terminal echo is suppressed while the user types |
readSecretInput
Reads hidden input from STDIN and masks typed characters with asterisks.
private readSecretInput(): stringBackspace is supported in interactive terminals.
close
Closes the output stream and resets any applied text formatting styles.
public close(): voidThis method outputs a reset sequence to clear any foreground and background color formatting that may have been applied during console output.
Generated by Hazaar API Doc Generator on Wed, 22 Jul 2026 14:10:06 +0000