Skip to content

Commit 978b894

Browse files
[4.x] Update fluent methods to return static instead of self for better extensibility
1 parent bb898a0 commit 978b894

2 files changed

Lines changed: 7 additions & 7 deletions

File tree

src/Benchmark.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,42 +41,42 @@ public static function make(): static
4141
return new static;
4242
}
4343

44-
public function before(Closure $callback): self
44+
public function before(Closure $callback): static
4545
{
4646
$this->callbacks->before = $callback;
4747

4848
return $this;
4949
}
5050

51-
public function beforeEach(Closure $callback): self
51+
public function beforeEach(Closure $callback): static
5252
{
5353
$this->callbacks->beforeEach = $callback;
5454

5555
return $this;
5656
}
5757

58-
public function after(Closure $callback): self
58+
public function after(Closure $callback): static
5959
{
6060
$this->callbacks->after = $callback;
6161

6262
return $this;
6363
}
6464

65-
public function afterEach(Closure $callback): self
65+
public function afterEach(Closure $callback): static
6666
{
6767
$this->callbacks->afterEach = $callback;
6868

6969
return $this;
7070
}
7171

72-
public function iterations(int $count): self
72+
public function iterations(int $count): static
7373
{
7474
$this->iterations = max(1, abs($count));
7575

7676
return $this;
7777
}
7878

79-
public function round(?int $precision): self
79+
public function round(?int $precision): static
8080
{
8181
$this->transformer->round($precision);
8282

src/Services/CollectorService.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ class CollectorService
88
{
99
protected array $data = [];
1010

11-
public function push(string|int $name, array $values): self
11+
public function push(string|int $name, array $values): static
1212
{
1313
$this->data[$name][] = $values;
1414

0 commit comments

Comments
 (0)