Skip to content

Commit 7681929

Browse files
authored
Merge pull request #131 from iMattPro/iMattPro-patch-1
Check instance of ArrayItem before accessing key
2 parents 5f47187 + a99992d commit 7681929

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)