ProgressHelper deprecated

class ProgressHelper extends Helper

deprecated

since version 2.5, to be removed in 3.0 Use {@link ProgressBar} instead.

The Progress class provides helpers to display progress output.

Constants

FORMAT_QUIET
FORMAT_NORMAL
FORMAT_VERBOSE
FORMAT_QUIET_NOMAX
FORMAT_NORMAL_NOMAX
FORMAT_VERBOSE_NOMAX

Methods

setHelperSet(HelperSet $helperSet = null)

Sets the helper set associated with this helper.

from Helper
HelperSet getHelperSet()

Gets the helper set associated with this helper.

from Helper
static int strlen(string $string)

Returns the length of a string, using mb_strwidth if it is available.

from Helper
static formatTime($secs) from Helper
static formatMemory($memory) from Helper
static strlenWithoutDecoration(OutputFormatterInterface $formatter, $string) from Helper
__construct($triggerDeprecationError = true)
setBarWidth(int $size)

Sets the progress bar width.

setBarCharacter(string $char)

Sets the bar character.

setEmptyBarCharacter(string $char)

Sets the empty bar character.

setProgressCharacter(string $char)

Sets the progress bar character.

setFormat(string $format)

Sets the progress bar format.

setRedrawFrequency(int $freq)

Sets the redraw frequency.

start(OutputInterface $output, int|null $max = null)

Starts the progress output.

advance(int $step = 1, bool $redraw = false)

Advances the progress output X steps.

setCurrent(int $current, bool $redraw = false)

Sets the current progress.

display(bool $finish = false)

Outputs the current progress string.

clear()

Removes the progress bar from the current line.

finish()

Finishes the progress output.

string getName()

Returns the canonical name of this helper.

Details

setHelperSet(HelperSet $helperSet = null)

Sets the helper set associated with this helper.

Parameters

HelperSet $helperSet A HelperSet instance

HelperSet getHelperSet()

Gets the helper set associated with this helper.

Return Value

HelperSet A HelperSet instance

static int strlen(string $string)

Returns the length of a string, using mb_strwidth if it is available.

Parameters

string $string The string to check its length

Return Value

int The length of the string

static formatTime($secs)

Parameters

$secs

static formatMemory($memory)

Parameters

$memory

static strlenWithoutDecoration(OutputFormatterInterface $formatter, $string)

Parameters

OutputFormatterInterface $formatter
$string

__construct($triggerDeprecationError = true)

Parameters

$triggerDeprecationError

setBarWidth(int $size)

Sets the progress bar width.

Parameters

int $size The progress bar size

setBarCharacter(string $char)

Sets the bar character.

Parameters

string $char A character

setEmptyBarCharacter(string $char)

Sets the empty bar character.

Parameters

string $char A character

setProgressCharacter(string $char)

Sets the progress bar character.

Parameters

string $char A character

setFormat(string $format)

Sets the progress bar format.

Parameters

string $format The format

setRedrawFrequency(int $freq)

Sets the redraw frequency.

Parameters

int $freq The frequency in steps

start(OutputInterface $output, int|null $max = null)

Starts the progress output.

Parameters

OutputInterface $output An Output instance
int|null $max Maximum steps

advance(int $step = 1, bool $redraw = false)

Advances the progress output X steps.

Parameters

int $step Number of steps to advance
bool $redraw Whether to redraw or not

Exceptions

LogicException

setCurrent(int $current, bool $redraw = false)

Sets the current progress.

Parameters

int $current The current progress
bool $redraw Whether to redraw or not

Exceptions

LogicException

display(bool $finish = false)

Outputs the current progress string.

Parameters

bool $finish Forces the end result

Exceptions

LogicException

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.

finish()

Finishes the progress output.

string getName()

Returns the canonical name of this helper.

Return Value

string The canonical name

© 2004–2017 Fabien Potencier
Licensed under the MIT License.
http://api.symfony.com/4.0/Symfony/Component/Console/Helper/ProgressHelper.html