|
Text UI
A simple and fast way to take user input and display output in text mode using PHP.
|
Public Member Functions | |
| __construct (float|int $maxValue) | |
| update (float|int $currentValue) | |
| end () | |
| setPercentPrecision (int $precision) | |
| setUnitFormatter (?object $formatter) | |
| init () | |
| setBarChar (string $char) | |
Data Fields | |
| bool | $units = true |
| bool | $times = true |
Protected Member Functions | |
| getProgressStr (int $maxWidth) | |
| getPercentStr () | |
| getElapsedTimeStr () | |
| getRemainingTimeStr () | |
| getTimesStr () | |
| getUnitsStr () | |
| setCurrentValue (float|int $value) | |
Protected Attributes | |
| readonly float int | $maxValue |
| float int | $currentValue = 0 |
| DateTime | $startTime = null |
| object | $unitFormatter = null |
| int | $percentPrecision = 0 |
| string | $barChar = '|' |
A progress bar with percentage and optional time and count indicators.
Definition at line 17 of file Progress.php.
| __construct | ( | float|int | $maxValue | ) |
Definition at line 40 of file Progress.php.
| end | ( | ) |
Finalizes the progress bar ensuring that the total of 100% is reached.
Definition at line 85 of file Progress.php.
|
protected |
| DateException | @SuppressWarnings(PHPMD.StaticAccess) |
Definition at line 126 of file Progress.php.
|
protected |
Definition at line 114 of file Progress.php.
|
protected |
Definition at line 91 of file Progress.php.
|
protected |
| DateException | @SuppressWarnings(PHPMD.StaticAccess) |
Definition at line 154 of file Progress.php.
|
protected |
Definition at line 197 of file Progress.php.
|
protected |
Definition at line 204 of file Progress.php.
| init | ( | ) |
| setBarChar | ( | string | $char | ) |
Sets a unique character to be used in the progress bar indicator.
| string | $char |
| InvalidArgumentException |
Definition at line 263 of file Progress.php.
|
protected |
Definition at line 243 of file Progress.php.
| setPercentPrecision | ( | int | $precision | ) |
Sets the decimal precision of the percentage indicator.
| int | $precision |
| InvalidArgumentException |
Definition at line 105 of file Progress.php.
| setUnitFormatter | ( | ?object | $formatter | ) |
Function to format the values of the value indicator. It must be a function that receives a value as an argument and returns that formatted value.
| null | object | $formatter |
Definition at line 227 of file Progress.php.
| update | ( | float|int | $currentValue | ) |
| float | int | $currentValue |
Definition at line 54 of file Progress.php.
|
protected |
Definition at line 24 of file Progress.php.
|
protected |
Definition at line 20 of file Progress.php.
|
protected |
Definition at line 19 of file Progress.php.
|
protected |
Definition at line 23 of file Progress.php.
|
protected |
Definition at line 21 of file Progress.php.
| bool $times = true |
Definition at line 38 of file Progress.php.
|
protected |
Definition at line 22 of file Progress.php.
| bool $units = true |
Definition at line 31 of file Progress.php.