A cache item.
This class will be used by MemoryCacheItemPool and SysVCacheItemPool on PHP 8.0 and above. It is compatible with psr/cache 3.0 (PSR-6).
- see \Itemfor compatiblity with previous versions of PHP.
CloneableFinalInstantiable
- Implements
Psr\Cache\CacheItemInterface
| Methods |
public __construct(string $key)
|
| public expiresAfter( $time) : static |
| public expiresAt( $expiration) : static |
| public get() : ?mixed |
| public getKey() : string |
| public isHit() : bool |
| public set(?mixed $value) : static |
| Methods |
protected currentTime()
|
| Properties |
private ?DateTimeInterface $expiration
|
private bool $isHit = false
|
| private string $key |
private ?mixed $value
|
| Methods |
| private isValidExpiration( $expiration) Determines if an expiration is valid based on the rules defined by PSR6.
|