incr() публичный Метод

Increments the value and calls {@see write()}
public incr ( integer $increment = 1 ) : ProgressBar
$increment integer
Результат ProgressBar
Пример #1
0
/**
 * Displays a progress bar
 *
 * @opt total Number of iterations
 * @opt usleep Waiting time in microsecond between each iteration
 */
function progress($args, $options, $console)
{
    $total = isset($options['total']) ? $options['total'] : 100;
    $usleep = isset($options['usleep']) ? $options['usleep'] : 10000;
    $progress = new ProgressBar($console, $total);
    for ($i = 0; $i < $total; $i++) {
        $progress->incr();
        usleep($usleep);
    }
    $progress->stop();
}