Copied!

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
Methods
public __construct(string $key)
 
  • param 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()
               
              • return \DateTime
              Properties
              private ?DateTimeInterface $expiration
               
              • var \DateTimeInterface|null
              private bool $isHit = false
               
              • var bool
              private string $key
              private ?mixed $value
               
              • var mixed
              Methods
              private isValidExpiration( $expiration)
               

              Determines if an expiration is valid based on the rules defined by PSR6.

              • param mixed $expiration
              • return bool
              © 2026 Bruce Wells
              Search Namespaces \ Classes
              Configuration