Skip to content
PHP Ecosystem
Explore

SymfonyOutputWriter

API reference › Scaffold › Console › SymfonyOutputWriter

final readonly classPHPForge\Scaffold\Console\SymfonyOutputWriter
ImplementsOutputWriter
Sourcesrc/Console/SymfonyOutputWriter.php

Writes service messages to a Symfony Console output in raw mode, so stub content such as <?php ?> is never parsed as style tags.

MethodDescriptionDefined by
__construct()Creates a writer for a Symfony Console output.SymfonyOutputWriter
isDecorated()Returns whether the console output supports ANSI decoration.SymfonyOutputWriter
writeStderr()Writes $message and a newline to the error output, or to the main output when no error output is available.SymfonyOutputWriter
writeStdout()Writes $message and a newline to the main output.SymfonyOutputWriter
public function __construct(Symfony\Component\Console\Output\OutputInterface $output)

Creates a writer for a Symfony Console output.

Parameters

ParameterTypeDescription
$outputSymfony\Component\Console\Output\OutputInterfaceConsole output that receives the messages and, through its error output when it is a ConsoleOutputInterface, the standard error messages.
public function isDecorated(): bool

Returns whether the console output supports ANSI decoration.

Returns

bool: true when the main output is decorated, false otherwise.

public function writeStderr(string $message): void

Writes $message and a newline to the error output, or to the main output when no error output is available.

Parameters

ParameterTypeDescription
$messagestringMessage without a trailing newline; the writer appends one.
public function writeStdout(string $message): void

Writes $message and a newline to the main output.

Parameters

ParameterTypeDescription
$messagestringMessage without a trailing newline; the writer appends one.