Skip to content

Commit 0c18bb9

Browse files
committed
Simpler test
1 parent c2ae542 commit 0c18bb9

File tree

2 files changed

+54
-0
lines changed

2 files changed

+54
-0
lines changed

tests/PHPStan/Rules/Methods/ReturnTypeRuleTest.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1059,4 +1059,9 @@ public function testBug11663(): void
10591059
$this->analyse([__DIR__ . '/data/bug-11663.php'], []);
10601060
}
10611061

1062+
public function testBug11857(): void
1063+
{
1064+
$this->analyse([__DIR__ . '/data/bug-11857-builder.php'], []);
1065+
}
1066+
10621067
}
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
<?php // lint >= 8.0
2+
3+
namespace Bug11857Builder;
4+
5+
class Foo
6+
{
7+
8+
/**
9+
* @param array<string, mixed> $attributes
10+
* @return $this
11+
*/
12+
public function filter(array $attributes): static
13+
{
14+
return $this;
15+
}
16+
17+
/**
18+
* @param array<string, mixed> $attributes
19+
* @return $this
20+
*/
21+
public function filterUsingRequest(array $attributes): static
22+
{
23+
return $this->filter($attributes);
24+
}
25+
26+
}
27+
28+
final class FinalFoo
29+
{
30+
31+
/**
32+
* @param array<string, mixed> $attributes
33+
* @return $this
34+
*/
35+
public function filter(array $attributes): static
36+
{
37+
return $this;
38+
}
39+
40+
/**
41+
* @param array<string, mixed> $attributes
42+
* @return $this
43+
*/
44+
public function filterUsingRequest(array $attributes): static
45+
{
46+
return $this->filter($attributes);
47+
}
48+
49+
}

0 commit comments

Comments
 (0)