mirror of
https://github.com/danog/psalm.git
synced 2024-11-30 04:39:00 +01:00
Test for dynamic enum fetch
This commit is contained in:
parent
a827806709
commit
4cec31eba9
@ -2485,7 +2485,7 @@ class ConstantTest extends TestCase
|
||||
$a = C::{"A"};
|
||||
',
|
||||
'error_message' => 'ParseError',
|
||||
'errors_levels' => [],
|
||||
'error_levels' => [],
|
||||
'php_version' => '8.2',
|
||||
],
|
||||
];
|
||||
|
@ -1029,6 +1029,25 @@ class UnusedVariableTest extends TestCase
|
||||
'ignored_issues' => [],
|
||||
'php_version' => '8.3',
|
||||
],
|
||||
'usedAsEnumFetch' => [
|
||||
'code' => '<?php
|
||||
enum E {
|
||||
case C;
|
||||
}
|
||||
|
||||
class A {
|
||||
public function foo() : void {
|
||||
$var = "C";
|
||||
|
||||
if (rand(0, 1)) {
|
||||
E::{$var};
|
||||
}
|
||||
}
|
||||
}',
|
||||
'assertions' => [],
|
||||
'ignored_issues' => [],
|
||||
'php_version' => '8.3',
|
||||
],
|
||||
'usedAsStaticPropertyAssign' => [
|
||||
'code' => '<?php
|
||||
class A {
|
||||
|
Loading…
Reference in New Issue
Block a user