ConfigurationFactory
in package
uses
LogsMessagesTrait
FinalYes
Tags
Table of Contents
Properties
- $compiledFactory : CompiledConfigurationFactory
- $componentProviders : iterable<string|int, mixed>
- $envReader : EnvReader
- $rootComponent : ComponentProvider
Methods
- __construct() : mixed
- parseFile() : ComponentPlugin
- process() : ComponentPlugin<string|int, T>
- logDebug() : void
- logError() : void
- logInfo() : void
- logNotice() : void
- logWarning() : void
- compileFactory() : CompiledConfigurationFactory
- doLog() : void
- Logging is best effort: a failing log writer (for example an error handler that throws on `trigger_error`) must not break the code that is being observed.
- includeCache() : mixed
- shouldLog() : bool
- writeCache() : void
Properties
$compiledFactory read-only
private
CompiledConfigurationFactory
$compiledFactory
$componentProviders read-only
private
iterable<string|int, mixed>
$componentProviders
$envReader read-only
private
EnvReader
$envReader
$rootComponent read-only
private
ComponentProvider
$rootComponent
Methods
__construct()
public
__construct(iterable<string|int, ComponentProvider> $componentProviders, ComponentProvider<string|int, T> $rootComponent, EnvReader $envReader) : mixed
Parameters
- $componentProviders : iterable<string|int, ComponentProvider>
- $rootComponent : ComponentProvider<string|int, T>
- $envReader : EnvReader
parseFile()
public
parseFile(string $file[, string|null $cacheFile = null ][, bool $debug = true ]) : ComponentPlugin
Parameters
- $file : string
-
path to parse
- $cacheFile : string|null = null
-
path to cache parsed configuration to
- $debug : bool = true
-
will check for cache freshness if debug mode enabled
Tags
Return values
ComponentPlugin —parsed component plugin
process()
public
process(array<string|int, mixed> $configs[, ResourceCollection|null $resources = null ]) : ComponentPlugin<string|int, T>
Parameters
- $configs : array<string|int, mixed>
-
configs to process
- $resources : ResourceCollection|null = null
-
resources that can be used for cache invalidation
Tags
Return values
ComponentPlugin<string|int, T> —processed component plugin
logDebug()
protected
static logDebug(string $message[, array<string|int, mixed> $context = [] ]) : void
Parameters
- $message : string
- $context : array<string|int, mixed> = []
logError()
protected
static logError(string $message[, array<string|int, mixed> $context = [] ]) : void
Parameters
- $message : string
- $context : array<string|int, mixed> = []
logInfo()
protected
static logInfo(string $message[, array<string|int, mixed> $context = [] ]) : void
Parameters
- $message : string
- $context : array<string|int, mixed> = []
logNotice()
protected
static logNotice(string $message[, array<string|int, mixed> $context = [] ]) : void
Parameters
- $message : string
- $context : array<string|int, mixed> = []
logWarning()
protected
static logWarning(string $message[, array<string|int, mixed> $context = [] ]) : void
Parameters
- $message : string
- $context : array<string|int, mixed> = []
compileFactory()
private
compileFactory() : CompiledConfigurationFactory
Return values
CompiledConfigurationFactorydoLog()
Logging is best effort: a failing log writer (for example an error handler that throws on `trigger_error`) must not break the code that is being observed.
private
static doLog(string $level, string $message, array<string|int, mixed> $context) : void
Parameters
- $level : string
- $message : string
- $context : array<string|int, mixed>
includeCache()
private
static includeCache(string $path) : mixed
Parameters
- $path : string
shouldLog()
private
static shouldLog(string $level) : bool
Parameters
- $level : string
Return values
boolwriteCache()
private
static writeCache(ResourceCheckerConfigCache $cache, ComponentPlugin $configuration, ResourceCollection $resources) : void
Parameters
- $cache : ResourceCheckerConfigCache
- $configuration : ComponentPlugin
- $resources : ResourceCollection