diff --git a/src/KV/KVClient.php b/src/KV/KVClient.php index 1f904b7..ba2ea2a 100644 --- a/src/KV/KVClient.php +++ b/src/KV/KVClient.php @@ -294,7 +294,9 @@ public function Tree(string $prefix = '', ?QueryOptions $opts = null): array } $treeHierarchy = []; - foreach ($valueList as $path => $kvp) { + /** @var KVPair $kvp */ + foreach ($valueList as $kvp) { + $path = $kvp->getKey(); $slashPos = strpos($path, '/'); if (false === $slashPos) { $treeHierarchy[$path] = $kvp;