ProgressBar
class ProgressBar
The ProgressBar provides helpers to display progress output.
Methods
Sets a placeholder formatter for a given name.
Gets the placeholder formatter for a given name.
Sets a format for a given name.
Gets the format for a given name.
No description
No description
Gets the progress bar start time.
Gets the progress bar maximal steps.
Gets the current step position.
Gets the current progress bar percent.
Sets the progress bar width.
Gets the progress bar width.
Sets the bar character.
Gets the bar character.
Sets the empty bar character.
Gets the empty bar character.
Sets the progress bar character.
Gets the progress bar character.
Sets the progress bar format.
Sets the redraw frequency.
Starts the progress output.
Advances the progress output X steps.
Sets whether to overwrite the progressbar, false for new line.
Sets the current progress.
Finishes the progress output.
Outputs the current progress string.
Removes the progress bar from the current line.
Details
at line line 58
__construct(OutputInterface $output, int $max)
Constructor.
at line line 86
static
setPlaceholderFormatterDefinition(string $name, callable $callable)
Sets a placeholder formatter for a given name.
This method also allow you to override an existing placeholder.
at line line 102
static callable|null
getPlaceholderFormatterDefinition(string $name)
Gets the placeholder formatter for a given name.
at line line 119
static
setFormatDefinition(string $name, string $format)
Sets a format for a given name.
This method also allow you to override an existing format.
at line line 135
static string|null
getFormatDefinition(string $name)
Gets the format for a given name.
at line line 144
setMessage($message, $name = 'message')
at line line 149
getMessage($name = 'message')
at line line 159
int
getStartTime()
Gets the progress bar start time.
at line line 169
int
getMaxSteps()
Gets the progress bar maximal steps.
at line line 179
int
getProgress()
Gets the current step position.
at line line 199
float
getProgressPercent()
Gets the current progress bar percent.
at line line 209
setBarWidth(int $size)
Sets the progress bar width.
at line line 219
int
getBarWidth()
Gets the progress bar width.
at line line 229
setBarCharacter(string $char)
Sets the bar character.
at line line 239
string
getBarCharacter()
Gets the bar character.
at line line 253
setEmptyBarCharacter(string $char)
Sets the empty bar character.
at line line 263
string
getEmptyBarCharacter()
Gets the empty bar character.
at line line 273
setProgressCharacter(string $char)
Sets the progress bar character.
at line line 283
string
getProgressCharacter()
Gets the progress bar character.
at line line 293
setFormat(string $format)
Sets the progress bar format.
at line line 304
setRedrawFrequency(int|float $freq)
Sets the redraw frequency.
at line line 314
start(int|null $max = null)
Starts the progress output.
at line line 334
advance(int $step = 1)
Advances the progress output X steps.
at line line 344
setOverwrite(bool $overwrite)
Sets whether to overwrite the progressbar, false for new line.
at line line 356
setProgress(int $step)
Sets the current progress.
at line line 379
finish()
Finishes the progress output.
at line line 396
display()
Outputs the current progress string.
at line line 430
clear()
Removes the progress bar from the current line.
This is useful if you wish to write some output while a progress bar is running. Call display() to show the progress bar again.