File tree Expand file tree Collapse file tree
tests/PHPStan/Rules/Methods Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1286,4 +1286,9 @@ public function testBug8438(): void
12861286 $ this ->analyse ([__DIR__ . '/data/bug-8438.php ' ], []);
12871287 }
12881288
1289+ public function testBug10771 (): void
1290+ {
1291+ $ this ->analyse ([__DIR__ . '/data/bug-10771.php ' ], []);
1292+ }
1293+
12891294}
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ namespace Bug10771 ;
4+
5+ /**
6+ * @template T of Template
7+ *
8+ * @extends B<T>
9+ */
10+ class A extends B
11+ {
12+ /**
13+ * @return class-string<T>
14+ */
15+ public function getClassString (): string
16+ {
17+ return static ::ENTITY ;
18+ }
19+ }
20+
21+ /**
22+ * @template T of Template
23+ */
24+ class B
25+ {
26+ /** @var class-string<T> */
27+ public const ENTITY = Template::class;
28+ }
29+
30+ class Template
31+ {
32+
33+ }
34+
35+ /**
36+ * @template TA of Template
37+ *
38+ * @extends Bb<TA>
39+ */
40+ class Aa extends Bb
41+ {
42+ /**
43+ * @return class-string<TA>
44+ */
45+ public function getClassString (): string
46+ {
47+ return static ::ENTITY ;
48+ }
49+ }
50+
51+ /**
52+ * @template TB of Template
53+ */
54+ class Bb
55+ {
56+ /** @var class-string<TB> */
57+ public const ENTITY = Template::class;
58+ }
You can’t perform that action at this time.
0 commit comments