File tree Expand file tree Collapse file tree 2 files changed +35
-0
lines changed
tests/PHPStan/Rules/Methods Expand file tree Collapse file tree 2 files changed +35
-0
lines changed Original file line number Diff line number Diff line change 55use PHPStan \Rules \MissingTypehintCheck ;
66use PHPStan \Rules \Rule ;
77use PHPStan \Testing \RuleTestCase ;
8+ use const PHP_VERSION_ID ;
89
910/**
1011 * @extends RuleTestCase<MissingMethodReturnTypehintRule>
@@ -111,4 +112,13 @@ public function testGenericStatic(): void
111112 ]);
112113 }
113114
115+ public function testBug9657 (): void
116+ {
117+ if (PHP_VERSION_ID < 80000 ) {
118+ $ this ->markTestSkipped ('Test requires PHP 8.0 ' );
119+ }
120+
121+ $ this ->analyse ([__DIR__ . '/data/bug-9657.php ' ], []);
122+ }
123+
114124}
Original file line number Diff line number Diff line change 1+ <?php // lint >= 8.0
2+
3+ namespace Bug9657 ;
4+
5+ /**
6+ * @template T
7+ */
8+ trait Convertable
9+ {
10+ /**
11+ * @return T
12+ */
13+ abstract public function toOther (): mixed ;
14+ }
15+
16+ final class Thing
17+ {
18+ /** @use Convertable<list<never>> */
19+ use Convertable;
20+
21+ public function toOther (): array
22+ {
23+ return [];
24+ }
25+ }
You can’t perform that action at this time.
0 commit comments