Config
API reference › Foxy › Config › Config
Resolves Foxy configuration from package values, defaults, and environment overrides.
Methods
Section titled “Methods”| Method | Description | Defined by |
|---|---|---|
__construct() | Creates a configuration resolver. | Config |
forManager() | Returns a copy whose manager-* map entries resolve for the given manager. | Config |
get() | Get the config value. | Config |
getArray() | Get the array config value. | Config |
isEnabled() | Check whether a configuration flag is enabled. | Config |
Method details
Section titled “Method details”__construct()
Section titled “__construct() ”public function __construct(array $config, array $defaults = [])Creates a configuration resolver.
Parameters
| Parameter | Type | Description |
|---|---|---|
$config | array | Package and global configuration values. |
$defaults | array | Default values used when a key is not configured. |
forManager()
Section titled “forManager() ”public function forManager(string $manager): staticReturns a copy whose manager-* map entries resolve for the given manager.
The current instance is never modified; environment values are returned unscoped.
Parameters
| Parameter | Type | Description |
|---|---|---|
$manager | string | The manager name used as the key of manager-* maps. |
Returns
static: The manager-scoped copy.
get()
Section titled “get() ”public function get(string $key, mixed $default = null): mixedGet the config value.
Parameters
| Parameter | Type | Description |
|---|---|---|
$key | string | The config key. |
$default | mixed | The default value. |
Returns
mixed
getArray()
Section titled “getArray() ”public function getArray(string $key, array $default = []): arrayGet the array config value.
Parameters
| Parameter | Type | Description |
|---|---|---|
$key | string | The config key. |
$default | array | The default value. |
Returns
array
isEnabled()
Section titled “isEnabled() ”public function isEnabled(string $key): boolCheck whether a configuration flag is enabled.
Parameters
| Parameter | Type | Description |
|---|---|---|
$key | string | The config key. |
Returns
bool