We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6c89e2e commit 80775c2Copy full SHA for 80775c2
src/Inspection/InvalidEnumCase.php
@@ -37,15 +37,13 @@ private function checkArguments(GetAttrExpression $node): void
37
{
38
$location = new NodeLocation($node);
39
40
- $enumClass = $node->getNode('node')->getNode('arguments')->getNode('0')->getAttribute('value');
41
- $case = $node->getNode('attribute')->getAttribute('value');
42
-
43
// No need to test whether enum_exists, as Twig's EnumFunction does that already.
44
+ $case = $node->getNode('attribute')->getAttribute('value');
45
if ($case === 'cases') {
46
return;
47
}
48
+ $enumClass = $node->getNode('node')->getNode('arguments')->getNode('0')->getAttribute('value');
49
foreach ($enumClass::cases() as $enumCase) {
50
if ($enumCase->name === $case) {
51
0 commit comments