Skip to content

Commit

Permalink
Fixed progress bar steps
Browse files Browse the repository at this point in the history
  • Loading branch information
andrey-helldar committed Feb 3, 2023
1 parent c76a37d commit 8b1b96a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/Comparator.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,18 +75,18 @@ protected function each(array $callbacks, ProgressBarService $progressBar): void
foreach ($callbacks as $name => $callback) {
$this->validate($callback);

$this->run($name, $callback);

$progressBar->advance();
$this->run($name, $callback, $progressBar);
}
}

protected function run(mixed $name, callable $callback): void
protected function run(mixed $name, callable $callback, ProgressBarService $progressBar): void
{
for ($i = 1; $i <= $this->iterations; ++$i) {
$time = $this->call($callback);

$this->push($name, $i, $time);

$progressBar->advance();
}
}

Expand Down

0 comments on commit 8b1b96a

Please sign in to comment.