ServiceConfig
in package
Read-only wrapper for configuration data
Intended for use with as a typehintable way for services to have application configuration injected as arrays cannot be typehinted.
Table of Contents
Methods
Methods
get()
Read a configuration key
public
get(string $path[, mixed $default = null ]) : mixed
Parameters
- $path : string
-
The path to read.
- $default : mixed = null
-
The default value to use if $path does not exist.
Return values
mixed —The configuration data or $default value.
has()
Check if $path exists and has a non-null value.
public
has(string $path) : bool
Parameters
- $path : string
-
The path to check.
Return values
bool —True if the configuration data exists.