reason) { 'not_found' => 'miss', 'expired' => 'expiration', 'evicted' => 'eviction', 'corrupted' => 'corruption', default => 'unknown' }; } /** * Check if this miss could have been prevented */ public function isPreventable(): bool { return in_array($this->reason, ['expired', 'evicted']); } /** * Convert to array for serialization * @return array */ public function toArray(): array { return [ 'cache_key' => $this->cacheKey->toString(), 'reason' => $this->reason, 'reason_category' => $this->getReasonCategory(), 'cache_level' => $this->cacheLevel->value, 'is_preventable' => $this->isPreventable(), 'timestamp' => $this->timestamp->toFloat(), ]; } }