Skip to content

Commit 8f9b014

Browse files
CAFernandesCopilot
andauthored
Update src/Utils/SerializationCache.php
Co-authored-by: Copilot <[email protected]>
1 parent 49d3254 commit 8f9b014

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/Utils/SerializationCache.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,10 @@ private static function evictIfNeeded(): void
287287
if (count(self::$cache) > self::$maxCacheSize) {
288288
// Simple FIFO eviction
289289
$key = array_key_first(self::$cache);
290-
if ($key !== null && is_string($key)) {
290+
if ($key === null) {
291+
return; // No key to evict
292+
}
293+
if (is_string($key)) {
291294
self::remove($key);
292295
}
293296
}

0 commit comments

Comments
 (0)