File tree Expand file tree Collapse file tree 2 files changed +54
-0
lines changed
tests/PHPStan/Rules/Methods Expand file tree Collapse file tree 2 files changed +54
-0
lines changed Original file line number Diff line number Diff 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}
Original file line number Diff line number Diff line change 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+ }
You can’t perform that action at this time.
0 commit comments