ProgressBar
class ProgressBar
Progress bar helper.
Properties
protected int | $width | Progressbar width. | |
protected string | $emptyTemplate | String that represents the empty part of the progess bar. | |
protected string | $filledTemplate | String that represents the filled part of the progess bar. | |
protected int | $items | Number of items. | |
protected int | $redrawRate | Redraw rate. | |
protected int | $progress | Progress status. | |
protected Output | $output | Output instance. | |
protected string | $prefix | Progress bar prefix. |
Methods
setWidth(int $width)
Sets the progress bar width.
setEmptyTemplate(string $template)
Sets the string that represents the empty part of the progess bar.
setFilledTemplate(string $template)
Sets the string that represents the filled part of the progess bar.
setPrefix(string $prefix)
Sets the progress bar prefix.
string
buildProgressBar(float $percent)
Builds the progressbar.
draw()
Draws the progressbar.
advance()
Move progress forward and redraws the progressbar.
remove()
Removes the progressbar.
Details
at line 90
__construct(Output $output, int $items, int|null $redrawRate = null)
Constructor.
at line 104
setWidth(int $width)
Sets the progress bar width.
at line 114
setEmptyTemplate(string $template)
Sets the string that represents the empty part of the progess bar.
at line 124
setFilledTemplate(string $template)
Sets the string that represents the filled part of the progess bar.
at line 134
setPrefix(string $prefix)
Sets the progress bar prefix.
at line 145
protected string
buildProgressBar(float $percent)
Builds the progressbar.
at line 159
draw()
Draws the progressbar.
at line 191
advance()
Move progress forward and redraws the progressbar.
at line 204
remove()
Removes the progressbar.