From 8f28fa682451381ece44c301d9bd1b01bd81f099 Mon Sep 17 00:00:00 2001 From: Priyadi Iman Nurcahyo <1102197+priyadi@users.noreply.github.com> Date: Thu, 10 Oct 2024 12:20:23 +0700 Subject: [PATCH] fix: terms (#217) --- CHANGELOG.md | 1 + src/ObjectCache/ObjectCache.php | 12 ++++++------ 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f16c23e6..d08f1841 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ * feat: attributes inheritance is now preserved * chore: rector run * perf: object mapper resolver cache prewarming +* fix: terms ## 1.9.4 diff --git a/src/ObjectCache/ObjectCache.php b/src/ObjectCache/ObjectCache.php index e1e8ec34..a5b7fa03 100644 --- a/src/ObjectCache/ObjectCache.php +++ b/src/ObjectCache/ObjectCache.php @@ -40,7 +40,7 @@ public function __construct( $this->preCache = new \WeakMap(); } - private function isBlacklisted(mixed $source): bool + private function isExcluded(mixed $source): bool { return $source instanceof \DateTimeInterface || $source instanceof \UnitEnum; @@ -58,7 +58,7 @@ public function preCache(mixed $source, Type $targetType): void return; } - if ($this->isBlacklisted($source)) { + if ($this->isExcluded($source)) { return; } @@ -79,7 +79,7 @@ public function undoPreCache(mixed $source, Type $targetType): void return; } - if ($this->isBlacklisted($source)) { + if ($this->isExcluded($source)) { return; } @@ -96,7 +96,7 @@ public function containsTarget(mixed $source, Type $targetType): bool return false; } - if ($this->isBlacklisted($source)) { + if ($this->isExcluded($source)) { return false; } @@ -119,7 +119,7 @@ public function getTarget(mixed $source, Type $targetType): mixed throw new CircularReferenceException(); } - if ($this->isBlacklisted($source)) { + if ($this->isExcluded($source)) { throw new CachedTargetObjectNotFoundException(); } @@ -138,7 +138,7 @@ public function saveTarget( return; } - if ($this->isBlacklisted($source)) { + if ($this->isExcluded($source)) { return; }