diff --git a/src/Comparator.php b/src/Comparator.php index 2719397..9e3ae52 100644 --- a/src/Comparator.php +++ b/src/Comparator.php @@ -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(); } }