Skip to content

Commit a99992d

Browse files
authored
Check instance of ArrayItem before accessing key
1 parent 4c90917 commit a99992d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Tests/ArrayKeyVisitor.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public function enterNode(Node $node)
4242
foreach ($node->items as $item)
4343
{
4444
/** @var ArrayItem $item */
45-
if ($item->key instanceof String_)
45+
if ($item instanceof ArrayItem && $item->key instanceof String_)
4646
{
4747
$this->keys[] = $item->key->value;
4848
}

0 commit comments

Comments
 (0)