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
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## 2.0.2

- allow null values in cache

## 2.0.0

### Changed
Expand All @@ -15,7 +19,9 @@ Go see the [migration guide](MIGRATION-2.0.md) to see how to migrate from v0 to
(wrongly pushed version, removed from packagist)

## 0.36.1

- Collection.php compatibility with PHP 8.1

### Changed

- [Breaking] Added compatibility for PHP 8.1
Expand All @@ -24,7 +30,7 @@ Go see the [migration guide](MIGRATION-2.0.md) to see how to migrate from v0 to

### Changed

Replace abandonned misd/phone-number-bundle
Replace abandonned misd/phone-number-bundle

## 0.34.0

Expand Down
6 changes: 3 additions & 3 deletions src/EntityRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ public function persist(
return $out;
}

protected function fetchFromCache(string $key): object|false
protected function fetchFromCache(string $key): object|null|false
{
$key = $this->normalizeCacheKey($key);
$cacheItemPool = $this->sdk->getCacheItemPool();
Expand All @@ -382,9 +382,9 @@ protected function fetchFromCache(string $key): object|false
$cacheItem = $cacheItemPool->getItem($cacheKey);
$cacheData = $cacheItem->get();

if (!is_object($cacheData)) {
if (!is_object($cacheData) && null !== $cacheData) {
throw new \RuntimeException(
'Cache data should be an object. This should not happen.',
'Cache data should either be null or an object. This should not happen.',
);
}

Expand Down