The ProgressBar provides helpers to display progress output.
- author Fabien Potencier
- author Chris Jones
Constants |
public Symfony |
public Symfony |
public Symfony |
public Symfony |
Methods |
public __construct(Symfony
|
public advance(int $step = 1) : void Advances the progress output X steps.
|
public clear() : void 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. |
public display() : void Outputs the current progress string. |
public finish() : void Finishes the progress output. |
public getBarCharacter() : string |
public getBarOffset() : float |
public getBarWidth() : int |
public getEmptyBarCharacter() : string |
public getEstimated() : float |
public static getFormatDefinition(string $name) : ?string Gets the format for a given name.
|
public getMaxSteps() : int |
public getMessage(string $name = 'message') : ?string |
public getPlaceholderFormatter(string $name) : ?callable Gets the placeholder formatter for a given name.
|
public static getPlaceholderFormatterDefinition(string $name) : ?callable Gets the placeholder formatter for a given name.
|
public getProgress() : int |
public getProgressCharacter() : string |
public getProgressPercent() : float |
public getRemaining() : float |
public getStartTime() : int |
public iterate(iterable $iterable, ?int $max = NULL) : iterable Returns an iterator that will automatically update the progress bar when iterated.
|
public maxSecondsBetweenRedraws(float $seconds) : void |
public minSecondsBetweenRedraws(float $seconds) : void |
public setBarCharacter(string $char) : void |
public setBarWidth(int $size) : void |
public setEmptyBarCharacter(string $char) : void |
public setFormat(string $format) : void |
public static setFormatDefinition(string $name, string $format) : void Sets a format for a given name. This method also allow you to override an existing format.
|
public setMaxSteps(?int $max) : void |
public setMessage(string $message, string $name = 'message') : void 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 %).
|
public setOverwrite(bool $overwrite) : void Sets whether to overwrite the progressbar, false for new line. |
public setPlaceholderFormatter(string $name, callable $callable) : void Sets a placeholder formatter for a given name, for this instance only.
|
public static setPlaceholderFormatterDefinition(string $name, callable $callable) : void Sets a placeholder formatter for a given name, globally for all instances of ProgressBar. This method also allow you to override an existing placeholder.
|
public setProgress(int $step) : void |
public setProgressCharacter(string $char) : void |
public setRedrawFrequency(?int $freq) : void Sets the redraw frequency.
|
public start(?int $max = NULL, int $startAt = 0) : void Starts the progress output.
|
Constants |
private Symfony |
private Symfony |
private Symfony |
private Symfony |
Properties |
private string $barChar |
private int $barWidth = 28 |
private Symfony |
private string $emptyBarChar = '-' |
private ?string $format = NULL |
private static array $formats |
private static array $formatters |
private ?string $internalFormat = NULL |
private float $lastWriteTime = 0 |
private ?int $max = NULL |
private float $maxSecondsBetweenRedraws = 1 |
private array $messages = [] |
private float $minSecondsBetweenRedraws = 0 |
private Symfony |
private bool $overwrite = true |
private float $percent = 0 |
private array $placeholders = [] |
private ?string $previousMessage = NULL |
private string $progressChar = '>' |
private ?int $redrawFreq = 1 |
private int $startingStep = 0 |
private int $startTime |
private int $step = 0 |
private int $stepWidth |
private Symfony |
private int $writeCount = 0 |
Methods |
private buildLine() : string |
private determineBestFormat() : string |
private getStepWidth() : int |
private static initFormats() : array |
private static initPlaceholderFormatters() : array |
private overwrite(string $message) : void Overwrites a previous message to the output. |
private setRealFormat(string $format) : void |
Properties |
private static array $formats |
private static array $formatters |
Methods |
public static getFormatDefinition(string $name) : ?string Gets the format for a given name.
|
public static getPlaceholderFormatterDefinition(string $name) : ?callable Gets the placeholder formatter for a given name.
|
private static initFormats() : array |
private static initPlaceholderFormatters() : array |
public static setFormatDefinition(string $name, string $format) : void Sets a format for a given name. This method also allow you to override an existing format.
|
public static setPlaceholderFormatterDefinition(string $name, callable $callable) : void Sets a placeholder formatter for a given name, globally for all instances of ProgressBar. This method also allow you to override an existing placeholder.
|