From b75502f7e69fab758805d5987424610949a1868c Mon Sep 17 00:00:00 2001 From: Kaelan Smith Date: Tue, 9 Jul 2024 02:07:22 -0700 Subject: [PATCH] Fix Key::resolveParentKey traversal process (#151) --- src/Key.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Key.php b/src/Key.php index 95c6310d..1ab64e12 100644 --- a/src/Key.php +++ b/src/Key.php @@ -58,14 +58,14 @@ public static function resolveParentKey(string|null $parentKey, string $key): st $parentKeyPieces = explode('_', $parentKey); while (count($parentKeyPieces) > 1) { - array_pop($parentKeyPieces); - $potentialParentKey = implode('_', $parentKeyPieces); $potentialKey = $potentialParentKey . '_' . $key; if (array_key_exists($potentialKey, self::$keys)) { return $potentialParentKey; } + + array_pop($parentKeyPieces); } return $parentKey;