File tree 2 files changed +35
-0
lines changed
tests/PHPStan/Rules/Methods
2 files changed +35
-0
lines changed Original file line number Diff line number Diff line change 5
5
use PHPStan \Rules \MissingTypehintCheck ;
6
6
use PHPStan \Rules \Rule ;
7
7
use PHPStan \Testing \RuleTestCase ;
8
+ use const PHP_VERSION_ID ;
8
9
9
10
/**
10
11
* @extends RuleTestCase<MissingMethodReturnTypehintRule>
@@ -111,4 +112,13 @@ public function testGenericStatic(): void
111
112
]);
112
113
}
113
114
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
+
114
124
}
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