From a99992d0398ecba7b6289fce33636729a890ef1b Mon Sep 17 00:00:00 2001 From: Matt Friedman Date: Thu, 20 Nov 2025 10:35:26 -0800 Subject: [PATCH] Check instance of ArrayItem before accessing key --- src/Tests/ArrayKeyVisitor.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Tests/ArrayKeyVisitor.php b/src/Tests/ArrayKeyVisitor.php index 5001aed..9e8e696 100644 --- a/src/Tests/ArrayKeyVisitor.php +++ b/src/Tests/ArrayKeyVisitor.php @@ -42,7 +42,7 @@ public function enterNode(Node $node) foreach ($node->items as $item) { /** @var ArrayItem $item */ - if ($item->key instanceof String_) + if ($item instanceof ArrayItem && $item->key instanceof String_) { $this->keys[] = $item->key->value; }