Closed
Description
Symfony version(s) affected
7.2.0
Description
When using the Progressbar and having a custom format using the %remaining%
part, the Progressbar will error with
In ProgressBar.php line 236:
Division by zero
How to reproduce
- Create a console command using the Progressbar
- Initiate a new Progressbar Object
$pb = new ProgressBar($io, $total);
- Start the Progressbar with
$pb->start($total, $skip);
where$total > $skip > 0
Possible Solution
Change in ProgressBar.php line 232 - 234 from
if (!$this->step) {
return 0;
}
to
if (0 === $this->step || $this->step === $this->startingStep) {
return 0;
}
as in getEstimated()
Additional Context
No response