From b2060d7f0363d8b255e7eb0e172f2ff591d21b5e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9F=D0=B5=D1=80=D0=BE=D0=B2=20=D0=90=D0=BB=D0=B5=D0=BA?= =?UTF-8?q?=D1=81=D0=B5=D0=B8=CC=86?= Date: Mon, 18 Dec 2023 13:33:18 +0300 Subject: [PATCH] Fixed a bug where $path was of type integer and did not contain the key value of the element. To do this, I received a key from $kvp. --- src/KV/KVClient.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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;