ProgressIndicator
in package
Tags
Table of Contents
Constants
- FORMATS = ['normal' => ' %indicator% %message%', 'normal_no_ansi' => ' %message%', 'verbose' => ' %indicator% %message% (%elapsed:6s%)', 'verbose_no_ansi' => ' %message% (%elapsed:6s%)', 'very_verbose' => ' %indicator% %message% (%elapsed:6s%, %memory:6s%)', 'very_verbose_no_ansi' => ' %message% (%elapsed:6s%, %memory:6s%)']
Properties
- $format : string|null
- $formatters : array<string, callable>
- $indicatorChangeInterval : int
- $indicatorCurrent : int
- $indicatorUpdateTime : float
- $indicatorValues : array<string|int, mixed>
- $message : string|null
- $output : OutputInterface
- $started : bool
- $startTime : int
Methods
- __construct() : mixed
- advance() : void
- Advances the indicator.
- finish() : void
- Finish the indicator with message.
- getFormatDefinition() : string|null
- Gets the format for a given name.
- getPlaceholderFormatterDefinition() : callable|null
- Gets the placeholder formatter for a given name (including the delimiter char like %).
- setMessage() : void
- Sets the current indicator message.
- setPlaceholderFormatterDefinition() : void
- Sets a placeholder formatter for a given name.
- start() : void
- Starts the indicator output.
- determineBestFormat() : string
- display() : void
- getCurrentTimeInMilliseconds() : float
- initPlaceholderFormatters() : array<string, Closure>
- overwrite() : void
- Overwrites a previous message to the output.
Constants
FORMATS
private
mixed
FORMATS
= ['normal' => ' %indicator% %message%', 'normal_no_ansi' => ' %message%', 'verbose' => ' %indicator% %message% (%elapsed:6s%)', 'verbose_no_ansi' => ' %message% (%elapsed:6s%)', 'very_verbose' => ' %indicator% %message% (%elapsed:6s%, %memory:6s%)', 'very_verbose_no_ansi' => ' %message% (%elapsed:6s%, %memory:6s%)']
Properties
$format
private
string|null
$format
= null
$formatters
private
static array<string, callable>
$formatters
$indicatorChangeInterval
private
int
$indicatorChangeInterval
$indicatorCurrent
private
int
$indicatorCurrent
$indicatorUpdateTime
private
float
$indicatorUpdateTime
$indicatorValues
private
array<string|int, mixed>
$indicatorValues
$message
private
string|null
$message
= null
$output
private
OutputInterface
$output
$started
private
bool
$started
= false
$startTime
private
int
$startTime
Methods
__construct()
public
__construct(OutputInterface $output[, string|null $format = null ][, int $indicatorChangeInterval = 100 ][, array<string|int, mixed>|null $indicatorValues = null ]) : mixed
Parameters
- $output : OutputInterface
- $format : string|null = null
- $indicatorChangeInterval : int = 100
-
Change interval in milliseconds
- $indicatorValues : array<string|int, mixed>|null = null
-
Animated indicator characters
advance()
Advances the indicator.
public
advance() : void
finish()
Finish the indicator with message.
public
finish(string $message) : void
Parameters
- $message : string
getFormatDefinition()
Gets the format for a given name.
public
static getFormatDefinition(string $name) : string|null
Parameters
- $name : string
Return values
string|nullgetPlaceholderFormatterDefinition()
Gets the placeholder formatter for a given name (including the delimiter char like %).
public
static getPlaceholderFormatterDefinition(string $name) : callable|null
Parameters
- $name : string
Return values
callable|nullsetMessage()
Sets the current indicator message.
public
setMessage(string|null $message) : void
Parameters
- $message : string|null
setPlaceholderFormatterDefinition()
Sets a placeholder formatter for a given name.
public
static setPlaceholderFormatterDefinition(string $name, callable $callable) : void
This method also allow you to override an existing placeholder.
Parameters
- $name : string
- $callable : callable
start()
Starts the indicator output.
public
start(string $message) : void
Parameters
- $message : string
determineBestFormat()
private
determineBestFormat() : string
Return values
stringdisplay()
private
display() : void
getCurrentTimeInMilliseconds()
private
getCurrentTimeInMilliseconds() : float
Return values
floatinitPlaceholderFormatters()
private
static initPlaceholderFormatters() : array<string, Closure>
Return values
array<string, Closure>overwrite()
Overwrites a previous message to the output.
private
overwrite(string $message) : void
Parameters
- $message : string