ResourceCheckerConfigCacheFactory
in package
implements
ConfigCacheFactoryInterface
A ConfigCacheFactory implementation that validates the cache with an arbitrary set of ResourceCheckers.
Tags
Interfaces, Classes, Traits and Enums
- ConfigCacheFactoryInterface
- Interface for a ConfigCache factory. This factory creates an instance of ConfigCacheInterface and initializes the cache if necessary.
Table of Contents
- $resourceCheckers : mixed
- __construct() : mixed
- cache() : ConfigCacheInterface
- Creates a cache instance and (re-)initializes it if necessary.
Properties
$resourceCheckers
private
mixed
$resourceCheckers
= []
Methods
__construct()
public
__construct([iteratable<string|int, mixed>|array<string|int, ResourceCheckerInterface> $resourceCheckers = [] ]) : mixed
Parameters
- $resourceCheckers : iteratable<string|int, mixed>|array<string|int, ResourceCheckerInterface> = []
Return values
mixed —cache()
Creates a cache instance and (re-)initializes it if necessary.
public
cache(string $file, callable $callable) : ConfigCacheInterface
Parameters
- $file : string
-
The absolute cache file path
- $callable : callable
-
The callable to be executed when the cache needs to be filled (i. e. is not fresh). The cache will be passed as the only parameter to this callback
Return values
ConfigCacheInterface —The cache instance