Cml\Console\Component\Progress::increment PHP Метод

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

进入+ x
public increment ( integer $value = 1 )
$value integer
    public function increment($value = 1)
    {
        $this->percent += $value;
        $percentage = (double) ($this->percent / 100);
        $progress = floor($percentage * 50);
        $output = "\r[" . str_repeat('>', $progress);
        if ($progress < 50) {
            $output .= ">" . str_repeat(' ', 50 - $progress);
        } else {
            $output .= '>';
        }
        $output .= sprintf('] %s%% ', round($percentage * 100, 0));
        $speed = (time() - $this->startTime) / $this->percent;
        $remaining = number_format(round($speed * (100 - $this->percent), 2), 2);
        $percentage == 100 || ($output .= " {$remaining} seconds remaining");
        Output::write($output);
        return $this;
    }