Base class for output classes.
- Full name:
\Symfony\Component\Console\Output\BufferedOutput
- Parent class:
\Symfony\Component\Console\Output\Output
private $buffer
Empties buffer and returns its content.
public fetch(): string
Writes a message to the output.
protected doWrite(string $message, bool $newline): mixed
Parameters:
Parameter | Type | Description |
---|---|---|
$message |
string | |
$newline |
bool |
public __construct(int|null $verbosity = self::VERBOSITY_NORMAL, bool $decorated = false, \Symfony\Component\Console\Formatter\OutputFormatterInterface|null $formatter = null): mixed
Parameters:
Parameter | Type | Description |
---|---|---|
$verbosity |
int|null | The verbosity level (one of the VERBOSITY constants in OutputInterface) |
$decorated |
bool | Whether to decorate messages |
$formatter |
\Symfony\Component\Console\Formatter\OutputFormatterInterface|null | Output formatter instance (null to use default OutputFormatter) |
public setFormatter(\Symfony\Component\Console\Formatter\OutputFormatterInterface $formatter): mixed
Parameters:
Parameter | Type | Description |
---|---|---|
$formatter |
\Symfony\Component\Console\Formatter\OutputFormatterInterface |
Returns current output formatter instance.
public getFormatter(): \Symfony\Component\Console\Formatter\OutputFormatterInterface
Sets the decorated flag.
public setDecorated(bool $decorated): mixed
Parameters:
Parameter | Type | Description |
---|---|---|
$decorated |
bool |
Gets the decorated flag.
public isDecorated(): bool
Sets the verbosity of the output.
public setVerbosity(int $level): mixed
Parameters:
Parameter | Type | Description |
---|---|---|
$level |
int |
Gets the current verbosity of the output.
public getVerbosity(): int
Returns whether verbosity is quiet (-q).
public isQuiet(): bool
Returns whether verbosity is verbose (-v).
public isVerbose(): bool
Returns whether verbosity is very verbose (-vv).
public isVeryVerbose(): bool
Returns whether verbosity is debug (-vvv).
public isDebug(): bool
Writes a message to the output and adds a newline at the end.
public writeln(mixed $messages, int $options = self::OUTPUT_NORMAL): mixed
Parameters:
Parameter | Type | Description |
---|---|---|
$messages |
mixed | The message as an iterable of strings or a single string |
$options |
int | A bitmask of options (one of the OUTPUT or VERBOSITY constants), 0 is considered the same as self::OUTPUT_NORMAL | self::VERBOSITY_NORMAL |
Writes a message to the output.
public write(mixed $messages, bool $newline = false, int $options = self::OUTPUT_NORMAL): mixed
Parameters:
Parameter | Type | Description |
---|---|---|
$messages |
mixed | The message as an iterable of strings or a single string |
$newline |
bool | Whether to add a newline |
$options |
int | A bitmask of options (one of the OUTPUT or VERBOSITY constants), 0 is considered the same as self::OUTPUT_NORMAL | self::VERBOSITY_NORMAL |
Writes a message to the output.
protected doWrite(string $message, bool $newline): mixed
- This method is abstract.
Parameters:
Parameter | Type | Description |
---|---|---|
$message |
string | |
$newline |
bool |