class SymfonyStyle extends OutputStyle
Output decorator helpers for the Symfony Style Guide.
MAX_LINE_LENGTH |
__construct(InputInterface $input, OutputInterface $output) | ||
newLine(int $count = 1) Add newline(s). | ||
ProgressBar | createProgressBar(int $max = 0) | |
write(string|iterable $messages, bool $newline = false, $type = self::OUTPUT_NORMAL) Writes a message to the output. | ||
writeln(string|iterable $messages, $type = self::OUTPUT_NORMAL) Writes a message to the output and adds a newline at the end. | ||
setVerbosity(int $level) Sets the verbosity of the output. | from OutputStyle | |
int | getVerbosity() Gets the current verbosity of the output. | from OutputStyle |
setDecorated(bool $decorated) Sets the decorated flag. | from OutputStyle | |
bool | isDecorated() Gets the decorated flag. | from OutputStyle |
setFormatter(OutputFormatterInterface $formatter) | from OutputStyle | |
OutputFormatterInterface | getFormatter() Returns current output formatter instance. | from OutputStyle |
bool | isQuiet() Returns whether verbosity is quiet (-q). | from OutputStyle |
bool | isVerbose() Returns whether verbosity is verbose (-v). | from OutputStyle |
bool | isVeryVerbose() Returns whether verbosity is very verbose (-vv). | from OutputStyle |
bool | isDebug() Returns whether verbosity is debug (-vvv). | from OutputStyle |
getErrorOutput() | from OutputStyle | |
block(string|array $messages, string|null $type = null, string|null $style = null, string $prefix = ' ', bool $padding = false, bool $escape = true) Formats a message as a block of text. | ||
title(string $message) Formats a command title. | ||
section(string $message) Formats a section title. | ||
listing(array $elements) Formats a list. | ||
text(string|array $message) Formats informational text. | ||
comment(string|array $message) Formats a command comment. | ||
success(string|array $message) Formats a success result bar. | ||
error(string|array $message) Formats an error result bar. | ||
warning(string|array $message) Formats an warning result bar. | ||
note(string|array $message) Formats a note admonition. | ||
caution(string|array $message) Formats a caution admonition. | ||
table(array $headers, array $rows) Formats a table. | ||
mixed | ask(string $question, string|null $default = null, callable|null $validator = null) Asks a question. | |
mixed | askHidden(string $question, callable|null $validator = null) Asks a question with the user input hidden. | |
bool | confirm(string $question, bool $default = true) Asks for confirmation. | |
mixed | choice(string $question, array $choices, string|int|null $default = null) Asks a choice question. | |
progressStart(int $max = 0) Starts the progress output. | ||
progressAdvance(int $step = 1) Advances the progress output X steps. | ||
progressFinish() Finishes the progress output. | ||
mixed | askQuestion(Question $question) | |
SymfonyStyle | getErrorStyle() Returns a new instance which makes use of stderr if available. |
InputInterface | $input | |
OutputInterface | $output |
Add newline(s).
int | $count | The number of newlines |
int | $max |
ProgressBar |
Writes a message to the output.
string|iterable | $messages | The message as an iterable of strings or a single string |
bool | $newline | Whether to add a newline |
$type |
Writes a message to the output and adds a newline at the end.
string|iterable | $messages | The message as an iterable of strings or a single string |
$type |
Sets the verbosity of the output.
int | $level | The level of verbosity (one of the VERBOSITY constants) |
Gets the current verbosity of the output.
int | The current level of verbosity (one of the VERBOSITY constants) |
Sets the decorated flag.
bool | $decorated | Whether to decorate the messages |
Gets the decorated flag.
bool | true if the output will decorate messages, false otherwise |
OutputFormatterInterface | $formatter |
Returns current output formatter instance.
OutputFormatterInterface |
Returns whether verbosity is quiet (-q).
bool | true if verbosity is set to VERBOSITY_QUIET, false otherwise |
Returns whether verbosity is verbose (-v).
bool | true if verbosity is set to VERBOSITY_VERBOSE, false otherwise |
Returns whether verbosity is very verbose (-vv).
bool | true if verbosity is set to VERBOSITY_VERY_VERBOSE, false otherwise |
Returns whether verbosity is debug (-vvv).
bool | true if verbosity is set to VERBOSITY_DEBUG, false otherwise |
Formats a message as a block of text.
string|array | $messages | The message to write in the block |
string|null | $type | The block type (added in [] on first line) |
string|null | $style | The style to apply to the whole block |
string | $prefix | The prefix for the block |
bool | $padding | Whether to add vertical padding |
bool | $escape | Whether to escape the message |
Formats a command title.
string | $message |
Formats a section title.
string | $message |
Formats a list.
array | $elements |
Formats informational text.
string|array | $message |
Formats a command comment.
string|array | $message |
Formats a success result bar.
string|array | $message |
Formats an error result bar.
string|array | $message |
Formats an warning result bar.
string|array | $message |
Formats a note admonition.
string|array | $message |
Formats a caution admonition.
string|array | $message |
Formats a table.
array | $headers | |
array | $rows |
Asks a question.
string | $question | |
string|null | $default | |
callable|null | $validator |
mixed |
Asks a question with the user input hidden.
string | $question | |
callable|null | $validator |
mixed |
Asks for confirmation.
string | $question | |
bool | $default |
bool |
Asks a choice question.
string | $question | |
array | $choices | |
string|int|null | $default |
mixed |
Starts the progress output.
int | $max | Maximum steps (0 if unknown) |
Advances the progress output X steps.
int | $step | Number of steps to advance |
Finishes the progress output.
Question | $question |
mixed |
Returns a new instance which makes use of stderr if available.
SymfonyStyle |
© 2004–2017 Fabien Potencier
Licensed under the MIT License.
https://api.symfony.com/4.1/Symfony/Component/Console/Style/SymfonyStyle.html