Copied!

Simple in-memory cache implementation.

CloneableFinalInstantiable
Methods
public clear() : bool
 
  • return bool True if the pool was successfully cleared. False if there was an error.
public commit() : bool
 
  • return bool True if all not-yet-saved items were successfully saved or there were none. False otherwise.
public deleteItem( $key) : bool
 
  • return bool True if the item was successfully removed. False if there was an error.
public deleteItems(array $keys) : bool
 
  • return bool True if the items were successfully removed. False if there was an error.
public getItem( $key) : Psr\Cache\CacheItemInterface
 
  • return \CacheItemInterface The corresponding Cache Item.
public getItems(array $keys = []) : iterable
 
  • return iterable<\CacheItemInterface> A traversable collection of Cache Items keyed by the cache keys of each item. A Cache item will be returned for each key, even if that key is not found. However, if no keys are specified then an empty traversable MUST be returned instead.
public hasItem( $key) : bool
 
  • return bool True if item exists in the cache, false otherwise.
public save(Psr\Cache\CacheItemInterface $item) : bool
 
  • return bool True if the item was successfully persisted. False if there was an error.
public saveDeferred(Psr\Cache\CacheItemInterface $item) : bool
 
  • return bool False if the item could not be queued or if a commit was attempted and failed. True otherwise.
Properties
private $deferredItems = NULL
 
  • var \CacheItemInterface[]
private $items = NULL
 
  • var \CacheItemInterface[]
Methods
private isValidKey( $key)
 

Determines if the provided key is valid.

  • param string $key
  • return bool
  • throws \InvalidArgumentException
© 2025 Bruce Wells