Configuration
in package
implements
ConfigurationBuilderInterface, ConfigurationInterface
FinalYes
Table of Contents
Interfaces
- ConfigurationBuilderInterface
- An interface that provides the ability to set both the schema and configuration values
- ConfigurationInterface
- Interface for reading configuration values
Properties
- $cache : array<string, mixed>
- $configSchemas : array<string, Schema>
- $finalConfig : Data
- $reader : ConfigurationInterface
- $userConfig : Data
Methods
- __construct() : mixed
- addSchema() : void
- Registers a new configuration schema at the given top-level key
- exists() : bool
- get() : mixed
- merge() : void
- reader() : ConfigurationInterface
- set() : void
- build() : void
- Applies the schema against the configuration to return the final configuration
- convertStdClassesToArrays() : mixed
- Recursively converts stdClass instances to arrays
- getTopLevelKey() : string
- invalidate() : void
- raiseAnyDeprecationNotices() : void
Properties
$cache
private
array<string, mixed>
$cache
= []
Tags
$configSchemas
private
array<string, Schema>
$configSchemas
= []
Tags
$finalConfig
private
Data
$finalConfig
Tags
$reader
private
ConfigurationInterface
$reader
Tags
$userConfig
private
Data
$userConfig
Tags
Methods
__construct()
public
__construct([array<string, Schema> $baseSchemas = [] ]) : mixed
Parameters
- $baseSchemas : array<string, Schema> = []
addSchema()
Registers a new configuration schema at the given top-level key
public
addSchema(string $key, Schema $schema) : void
Parameters
- $key : string
- $schema : Schema
Tags
exists()
public
exists(string $key) : bool
Parameters
- $key : string
-
Configuration option path/key
Tags
Return values
bool —Whether the given option exists
get()
public
get(string $key) : mixed
Parameters
- $key : string
-
Configuration option path/key
Tags
merge()
public
merge([array<string|int, mixed> $config = [] ]) : void
Parameters
- $config : array<string|int, mixed> = []
Tags
reader()
public
reader() : ConfigurationInterface
Tags
Return values
ConfigurationInterfaceset()
public
set(string $key, mixed $value) : void
Parameters
- $key : string
- $value : mixed
Tags
build()
Applies the schema against the configuration to return the final configuration
private
build(string $topLevelKey) : void
Parameters
- $topLevelKey : string
Tags
convertStdClassesToArrays()
Recursively converts stdClass instances to arrays
private
static convertStdClassesToArrays(T $data) : mixed
Parameters
- $data : T
Tags
getTopLevelKey()
private
static getTopLevelKey(string $path) : string
Parameters
- $path : string
Tags
Return values
stringinvalidate()
private
invalidate() : void
Tags
raiseAnyDeprecationNotices()
private
raiseAnyDeprecationNotices(array<string|int, string> $warnings) : void
Parameters
- $warnings : array<string|int, string>