CachedFormulaLoader
in package
implements
FormulaLoaderInterface
Adds a caching layer to a loader.
A cached formula loader is a composition of a formula loader and a cache.
Tags
Interfaces, Classes and Traits
- FormulaLoaderInterface
- Loads formulae.
Table of Contents
- $configCache : mixed
- $debug : mixed
- $loader : mixed
- __construct() : mixed
- Constructor.
- load() : array<string|int, mixed>
- Loads formulae from a resource.
Properties
$configCache
private
mixed
$configCache
$debug
private
mixed
$debug
$loader
private
mixed
$loader
Methods
__construct()
Constructor.
public
__construct(FormulaLoaderInterface $loader, ConfigCache $configCache[, bool $debug = false ]) : mixed
When the loader is in debug mode it will ensure the cached formulae are fresh before returning them.
Parameters
- $loader : FormulaLoaderInterface
-
A formula loader
- $configCache : ConfigCache
-
A config cache
- $debug : bool = false
-
The debug mode
Return values
mixed —load()
Loads formulae from a resource.
public
load(ResourceInterface $resources) : array<string|int, mixed>
Formulae should be loaded the same regardless of the current debug mode. Debug considerations should happen downstream.
Parameters
- $resources : ResourceInterface
Return values
array<string|int, mixed> —An array of formulae