Skip to content

Commit b11b658

Browse files
committed
Test for dynamic enum fetch
1 parent a827806 commit b11b658

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

tests/UnusedVariableTest.php

+19
Original file line numberDiff line numberDiff line change
@@ -1029,6 +1029,25 @@ public function foo() : void {
10291029
'ignored_issues' => [],
10301030
'php_version' => '8.3',
10311031
],
1032+
'usedAsEnumFetch' => [
1033+
'code' => '<?php
1034+
enum E {
1035+
case C;
1036+
}
1037+
1038+
class A {
1039+
public function foo() : void {
1040+
$var = "C";
1041+
1042+
if (rand(0, 1)) {
1043+
E::{$var};
1044+
}
1045+
}
1046+
}',
1047+
'assertions' => [],
1048+
'ignored_issues' => [],
1049+
'php_version' => '8.3',
1050+
],
10321051
'usedAsStaticPropertyAssign' => [
10331052
'code' => '<?php
10341053
class A {

0 commit comments

Comments
 (0)