Methods |
public
|
__construct(OutputInterface $output, int $max = 0, float $minSecondsBetweenRedraws = 1 / 25)
Parameters
$max |
Maximum steps (0 if unknown)
|
|
#
|
public
static
|
setPlaceholderFormatterDefinition(string $name, callable $callable): void
Sets a placeholder formatter for a given name.
Sets a placeholder formatter for a given name.
This method also allow you to override an existing placeholder.
Parameters
$name |
The placeholder name (including the delimiter char like %)
|
$callable |
A PHP callable
|
|
#
|
public
static
|
getPlaceholderFormatterDefinition(string $name): ?callable
Gets the placeholder formatter for a given name.
Gets the placeholder formatter for a given name.
Parameters
$name |
The placeholder name (including the delimiter char like %)
|
|
#
|
public
static
|
setFormatDefinition(string $name, string $format): void
Sets a format for a given name.
Sets a format for a given name.
This method also allow you to override an existing format.
Parameters
$name |
The format name
|
$format |
A format string
|
|
#
|
public
static
|
getFormatDefinition(string $name): ?string
Gets the format for a given name.
Gets the format for a given name.
Parameters
|
#
|
public
|
setMessage(string $message, string $name = 'message')
Associates a text with a named placeholder.
Associates a text with a named placeholder.
The text is displayed when the progress bar is rendered but only
when the corresponding placeholder is part of the custom format line
(by wrapping the name with %).
Parameters
$message |
The text to associate with the placeholder
|
$name |
The name of the placeholder
|
|
#
|
public
|
getMessage(string $name = 'message')
|
#
|
public
|
getStartTime(): int
|
#
|
public
|
getMaxSteps(): int
|
#
|
public
|
getProgress(): int
|
#
|
public
|
getProgressPercent(): float
|
#
|
public
|
getBarOffset(): float
|
#
|
public
|
getEstimated(): float
|
#
|
public
|
getRemaining(): float
|
#
|
public
|
setBarWidth(int $size)
|
#
|
public
|
getBarWidth(): int
|
#
|
public
|
setBarCharacter(string $char)
|
#
|
public
|
getBarCharacter(): string
|
#
|
public
|
setEmptyBarCharacter(string $char)
|
#
|
public
|
getEmptyBarCharacter(): string
|
#
|
public
|
setProgressCharacter(string $char)
|
#
|
public
|
getProgressCharacter(): string
|
#
|
public
|
setFormat(string $format)
|
#
|
public
|
setRedrawFrequency(int|null $freq)
Sets the redraw frequency.
Sets the redraw frequency.
Parameters
$freq |
The frequency in steps
|
|
#
|
public
|
minSecondsBetweenRedraws(float $seconds): void
|
#
|
public
|
maxSecondsBetweenRedraws(float $seconds): void
|
#
|
public
|
iterate(iterable $iterable, int|null $max = null): iterable
Returns an iterator that will automatically update the progress bar when iterated.
Returns an iterator that will automatically update the progress bar when iterated.
Parameters
$max |
Number of steps to complete the bar (0 if indeterminate), if null it will be inferred from $iterable
|
|
#
|
public
|
start(int|null $max = null)
Starts the progress output.
Starts the progress output.
Parameters
$max |
Number of steps to complete the bar (0 if indeterminate), null to leave unchanged
|
|
#
|
public
|
advance(int $step = 1)
Advances the progress output X steps.
Advances the progress output X steps.
Parameters
$step |
Number of steps to advance
|
|
#
|
public
|
setOverwrite(bool $overwrite)
Sets whether to overwrite the progressbar, false for new line.
Sets whether to overwrite the progressbar, false for new line.
|
#
|
public
|
setProgress(int $step)
|
#
|
public
|
setMaxSteps(int $max)
|
#
|
public
|
finish(): void
Finishes the progress output.
Finishes the progress output.
|
#
|
public
|
display(): void
Outputs the current progress string.
Outputs the current progress string.
|
#
|
public
|
clear(): void
Removes the progress bar from the current line.
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.
|
#
|