@@ -27,7 +27,7 @@ class Benchmark
2727
2828 protected int $ iterations = 100 ;
2929
30- protected ?Closure $ prepare = null ;
30+ protected ?Closure $ beforeEach = null ;
3131
3232 protected array $ result = [
3333 'each ' => [],
@@ -51,9 +51,9 @@ public static function start(): static
5151 return new static ();
5252 }
5353
54- public function prepare (callable $ callback ): self
54+ public function beforeEach (callable $ callback ): self
5555 {
56- $ this ->prepare = $ callback ;
56+ $ this ->beforeEach = $ callback ;
5757
5858 return $ this ;
5959 }
@@ -114,7 +114,7 @@ protected function each(mixed $name, callable $callback, ProgressBarService $pro
114114 protected function run (mixed $ name , callable $ callback , ProgressBarService $ progressBar ): void
115115 {
116116 for ($ i = 1 ; $ i <= $ this ->iterations ; ++$ i ) {
117- $ result = $ this ->runPrepare ($ name , $ i );
117+ $ result = $ this ->runBeforeEach ($ name , $ i );
118118
119119 [$ time , $ ram ] = $ this ->call ($ callback , [$ i , $ result ]);
120120
@@ -124,9 +124,9 @@ protected function run(mixed $name, callable $callback, ProgressBarService $prog
124124 }
125125 }
126126
127- protected function runPrepare (mixed $ name , int $ iteration ): mixed
127+ protected function runBeforeEach (mixed $ name , int $ iteration ): mixed
128128 {
129- if ($ callback = $ this ->prepare ) {
129+ if ($ callback = $ this ->beforeEach ) {
130130 return $ callback ($ name , $ iteration );
131131 }
132132
0 commit comments