Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
5.1.2
=====

* (bug) Consistently use `string`s for IDs from Storyblok.


5.1.1
=====

Expand Down
2 changes: 1 addition & 1 deletion src/Api/Data/Asset/AssetFolder.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class AssetFolder
/**
*/
public function __construct (
public readonly int $id,
public readonly string $id,
public readonly string $name,
public readonly string $uuid,
public private(set) array $children = [],
Expand Down
4 changes: 2 additions & 2 deletions src/Api/Data/Asset/AssetFolderTree.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*/
readonly class AssetFolderTree
{
/** @var array<int, AssetFolder> */
/** @var array<string, AssetFolder> */
private array $idMap;

/** @var array<string, AssetFolder> */
Expand Down Expand Up @@ -46,7 +46,7 @@ public function __construct (
/**
*
*/
public function getFolderById (int $id) : ?AssetFolder
public function getFolderById (int|string $id) : ?AssetFolder
{
return $this->idMap[$id] ?? null;
}
Expand Down
2 changes: 1 addition & 1 deletion src/Api/ManagementApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -579,7 +579,7 @@ public function fetchAssetFolders () : AssetFolderTree
foreach ($response["asset_folders"] as $folderData)
{
$folders[$folderData["id"]] = new AssetFolder(
id: $folderData["id"],
id: (string) $folderData["id"],
name: $folderData["name"],
uuid: $folderData["uuid"],
);
Expand Down