final class Config
Configuration object
| Namespace | BeastBytes\CodPhp |
|---|---|
| Inheritance | BeastBytes\CodPhp\Config |
Methods
__construct()
Create a configuration object, optionally initialising it from a configuration file.
| public function __construct(string|null $config = null) | ||
| $config | string|null | Path to a file that returns a configuaration array |
Declared in BeastBytes\CodPhp\Config
get()
Get the value of a configuration key.
| public function get(string $key, mixed|null $default = null): mixed|null | ||
| $key | string | Key to get. |
| $default | mixed|null | A return value if the key does not exist. |
| return | mixed|null | |
Declared in BeastBytes\CodPhp\Config
has()
Check if a configuration key exists.
| public function has(string $key): bool | ||
| $key | string | Key to check |
| return | bool | `true` if the key exists, `false` if not |
Declared in BeastBytes\CodPhp\Config
merge()
Merge this configuration with another; the other configuration takes precedence.
| public function merge(BeastBytes\CodPhp\Config $config): BeastBytes\CodPhp\Config | ||
| $config | BeastBytes\CodPhp\Config | The configuration to merge. |
| return | BeastBytes\CodPhp\Config | |
Declared in BeastBytes\CodPhp\Config
set()
Set the value of a configuration key.
| public function set(string $key, mixed|null $value): BeastBytes\CodPhp\Config | ||
| $key | string | Key to set. |
| $value | mixed|null | Value. |
| return | BeastBytes\CodPhp\Config | |
Declared in BeastBytes\CodPhp\Config
Generated by CodPhp