Skip to content

Latest commit

 

History

History
416 lines (148 loc) · 4.26 KB

BufferedOutput.md

File metadata and controls

416 lines (148 loc) · 4.26 KB

BufferedOutput

Base class for output classes.

Properties

buffer

private $buffer

Methods

fetch

Empties buffer and returns its content.

public fetch(): string

doWrite

Writes a message to the output.

protected doWrite(string $message, bool $newline): mixed

Parameters:

Parameter Type Description
$message string
$newline bool

Inherited methods

__construct

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)

setFormatter

public setFormatter(\Symfony\Component\Console\Formatter\OutputFormatterInterface $formatter): mixed

Parameters:

Parameter Type Description
$formatter \Symfony\Component\Console\Formatter\OutputFormatterInterface

getFormatter

Returns current output formatter instance.

public getFormatter(): \Symfony\Component\Console\Formatter\OutputFormatterInterface

setDecorated

Sets the decorated flag.

public setDecorated(bool $decorated): mixed

Parameters:

Parameter Type Description
$decorated bool

isDecorated

Gets the decorated flag.

public isDecorated(): bool

setVerbosity

Sets the verbosity of the output.

public setVerbosity(int $level): mixed

Parameters:

Parameter Type Description
$level int

getVerbosity

Gets the current verbosity of the output.

public getVerbosity(): int

isQuiet

Returns whether verbosity is quiet (-q).

public isQuiet(): bool

isVerbose

Returns whether verbosity is verbose (-v).

public isVerbose(): bool

isVeryVerbose

Returns whether verbosity is very verbose (-vv).

public isVeryVerbose(): bool

isDebug

Returns whether verbosity is debug (-vvv).

public isDebug(): bool

writeln

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

write

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

doWrite

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