Documentation

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
psalm-allow-private-mutation

$configSchemas

private array<string, Schema> $configSchemas = []
Tags
psalm-allow-private-mutation

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
psalm-allow-private-mutation

exists()

public exists(string $key) : bool
Parameters
$key : string

Configuration option path/key

Tags
psalm-external-mutation-free
Return values
bool

Whether the given option exists

get()

public get(string $key) : mixed
Parameters
$key : string

Configuration option path/key

Tags
psalm-external-mutation-free

merge()

public merge([array<string|int, mixed> $config = [] ]) : void
Parameters
$config : array<string|int, mixed> = []
Tags
psalm-allow-private-mutation

set()

public set(string $key, mixed $value) : void
Parameters
$key : string
$value : mixed
Tags
psalm-allow-private-mutation

convertStdClassesToArrays()

Recursively converts stdClass instances to arrays

private static convertStdClassesToArrays(T $data) : mixed
Parameters
$data : T
Tags
phpstan-template

T

phpstan-return

($data is \stdClass ? array<string, mixed> : T)

psalm-pure

invalidate()

private invalidate() : void
Tags
psalm-external-mutation-free

raiseAnyDeprecationNotices()

private raiseAnyDeprecationNotices(array<string|int, string> $warnings) : void
Parameters
$warnings : array<string|int, string>

        
On this page

Search results