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 @@ -1353,4 +1353,10 @@ public function testBug12110(): void
13531353 $ this ->analyse ([__DIR__ . '/data/bug-12110.php ' ], []);
13541354 }
13551355
1356+ #[RequiresPhp('>= 8.2.0 ' )]
1357+ public function testBug11776 (): void
1358+ {
1359+ $ this ->analyse ([__DIR__ . '/data/bug-11776.php ' ], []);
1360+ }
1361+
13561362}
Original file line number Diff line number Diff line change 1+ <?php // lint >= 8.2
2+
3+ declare (strict_types=1 );
4+
5+ namespace Bug11776 ;
6+
7+ /**
8+ * @template TOperation of int|string
9+ */
10+ interface EnumAsFilterInterface {}
11+
12+ /**
13+ * @template TOperation of scalar
14+ */
15+ final readonly class ScalarableChoice
16+ {
17+ /**
18+ * @param class-string<EnumAsFilterInterface<(int|string)&TOperation>> $choiceClassName
19+ */
20+ public function __construct (private string $ choiceClassName ) {}
21+
22+ /**
23+ * @return class-string<EnumAsFilterInterface<(int|string)&TOperation>>
24+ */
25+ public function getChoiceClassName (): string
26+ {
27+ return $ this ->choiceClassName ;
28+ }
29+ }
You can’t perform that action at this time.
0 commit comments