Documentation

ProgressIndicator
in package

Tags
author

Kevin Bond kevinbond@gmail.com

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

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

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|null

getPlaceholderFormatterDefinition()

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|null

setMessage()

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
string

getCurrentTimeInMilliseconds()

private getCurrentTimeInMilliseconds() : float
Return values
float

initPlaceholderFormatters()

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

        
On this page

Search results