Skip to content

Commit

Permalink
Remove invalid throw annotations and always return an array
Browse files Browse the repository at this point in the history
  • Loading branch information
bastianallgeier committed Oct 25, 2024
1 parent 0d2b40c commit fa87fc8
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 6 deletions.
4 changes: 1 addition & 3 deletions src/Content/MemoryStorage.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,10 @@ public function modified(VersionId $versionId, Language $language): int|null
* Returns the stored content fields
*
* @return array<string, string>
*
* @throws \Kirby\Exception\NotFoundException If the version does not exist
*/
public function read(VersionId $versionId, Language $language): array
{
return $this->cache->get($this->cacheId($versionId, $language));
return $this->cache->get($this->cacheId($versionId, $language)) ?? [];
}

/**
Expand Down
1 change: 0 additions & 1 deletion src/Content/PlainTextStorage.php
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,6 @@ public function modified(VersionId $versionId, Language $language): int|null
* Returns the stored content fields
*
* @return array<string, string>
* @throws \Kirby\Exception\NotFoundException If the version is missing
*/
public function read(VersionId $versionId, Language $language): array
{
Expand Down
2 changes: 0 additions & 2 deletions src/Content/Storage.php
Original file line number Diff line number Diff line change
Expand Up @@ -197,8 +197,6 @@ public function moveLanguage(
* Returns the stored content fields
*
* @return array<string, string>
*
* @throws \Kirby\Exception\NotFoundException If the version does not exist
*/
abstract public function read(VersionId $versionId, Language $language): array;

Expand Down

0 comments on commit fa87fc8

Please sign in to comment.