File tree Expand file tree Collapse file tree 3 files changed +20
-0
lines changed
tests/PHPStan/Rules/Classes Expand file tree Collapse file tree 3 files changed +20
-0
lines changed Original file line number Diff line number Diff line change 2020 --exclude tests/PHPStan/Rules/Names/data \
2121 --exclude tests/PHPStan/Rules/Operators/data/invalid-inc-dec.php \
2222 --exclude tests/PHPStan/Rules/Arrays/data/offset-access-without-dim-for-reading.php \
23+ --exclude tests/PHPStan/Rules/Classes/data/bug-11891.php \
2324 --exclude tests/PHPStan/Rules/Classes/data/bug-13768.php \
2425 --exclude tests/PHPStan/Rules/Classes/data/duplicate-declarations.php \
2526 --exclude tests/PHPStan/Rules/Classes/data/duplicate-enum-cases.php \
Original file line number Diff line number Diff line change @@ -179,4 +179,15 @@ public function testBug13768(): void
179179 ]);
180180 }
181181
182+ #[RequiresPhp('>= 8.1 ' )]
183+ public function testBug11891 (): void
184+ {
185+ $ this ->analyse ([__DIR__ . '/data/bug-11891.php ' ], [
186+ [
187+ 'Enum Bug11891\test has duplicate value 42 for cases A, B. ' ,
188+ 5 ,
189+ ],
190+ ]);
191+ }
192+
182193}
Original file line number Diff line number Diff line change 1+ <?php // lint >= 8.1
2+
3+ namespace Bug11891 ;
4+
5+ enum test:int {
6+ case A = 42 ;
7+ case B = self ::A->value ;
8+ };
You can’t perform that action at this time.
0 commit comments