Helper\ProgressIndicator (Component\Console)

Symfony\Component\Console\Helper\ProgressIndicator

class ProgressIndicator

Methods

__construct(OutputInterface $output, string|null $format = null, int $indicatorChangeInterval = 100, array|null $indicatorValues = null)
setMessage(string|null $message)

Sets the current indicator message.

string|null getMessage()

Gets the current indicator message.

int getStartTime()

Gets the progress bar start time.

string getCurrentValue()

Gets the current animated indicator character.

start($message $message)

Starts the indicator output.

advance()

Advances the indicator.

finish($message $message)

Finish the indicator with message.

static string|null getFormatDefinition(string $name)

Gets the format for a given name.

static setPlaceholderFormatterDefinition(string $name, callable $callable)

Sets a placeholder formatter for a given name.

static callable|null getPlaceholderFormatterDefinition(string $name)

Gets the placeholder formatter for a given name.

Details

public __construct(OutputInterface $output, string|null $format = null, int $indicatorChangeInterval = 100, array|null $indicatorValues = null)

Parameters

OutputInterface $output
string|null $format Indicator format
int $indicatorChangeInterval Change interval in milliseconds
array|null $indicatorValues Animated indicator characters

public setMessage(string|null $message)

Sets the current indicator message.

Parameters

string|null $message

public string|null getMessage()

Gets the current indicator message.

Return Value

string|null

public int getStartTime()

Gets the progress bar start time.

Return Value

int The progress bar start time

public string getCurrentValue()

Gets the current animated indicator character.

Return Value

string

public start($message $message)

Starts the indicator output.

Parameters

$message $message

public advance()

Advances the indicator.

public finish($message $message)

Finish the indicator with message.

Parameters

$message $message

static public string|null getFormatDefinition(string $name)

Gets the format for a given name.

Parameters

string $name The format name

Return Value

string|null A format string

static public setPlaceholderFormatterDefinition(string $name, callable $callable)

Sets a placeholder formatter for a given name.

This method also allow you to override an existing placeholder.

Parameters

string $name The placeholder name (including the delimiter char like %)
callable $callable A PHP callable

static public callable|null getPlaceholderFormatterDefinition(string $name)

Gets the placeholder formatter for a given name.

Parameters

string $name The placeholder name (including the delimiter char like %)

Return Value

callable|null A PHP callable

© 2004–2016 Fabien Potencier
Licensed under the MIT License.
http://api.symfony.com/3.0/Symfony/Component/Console/Helper/ProgressIndicator.html

在线笔记
App下载
App下载

扫描二维码

下载编程狮App

公众号
微信公众号

编程狮公众号

意见反馈
返回顶部