Skip to content

Commit b1a6983

Browse files
mowens3claude
andcommitted
Fix TypeError when iterating storage keys
PHP converts numeric-looking string keys to integers when iterating arrays. Cast keyId to string in listKeys() to handle this edge case. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 239d56d commit b1a6983

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

src/ApiKey/ApiKeyManager.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ public function listKeys(): array
6363
if (!is_array($record)) {
6464
continue;
6565
}
66+
// Cast keyId to string in case PHP converted numeric-looking keys to int
67+
$keyId = (string) $keyId;
6668
$keys[$keyId] = $this->recordToApiKey($keyId, $record);
6769
}
6870

0 commit comments

Comments
 (0)