<?php
namespace App\Framework\Cache;

final readonly class CacheItem
{
    private function __construct(
        public string $key,
        public mixed $value,
        public bool $isHit,
    ) {}

    public static function miss(string $key): self
    {
        return new self($key, null, false);
    }

    public static function hit(string $key, mixed $value): self
    {
        return new self($key, $value, true);
    }
}
