Env
final class Env (View source)
Reads typed environment values from framework-supported process sources in precedence order.
Methods
Returns a non-empty scalar environment value as text or the supplied fallback.
Returns an integer-compatible environment value or the supplied fallback.
Returns a floating-point-compatible environment value or the supplied fallback.
Returns a supported boolean environment value or the supplied fallback.
Splits a comma-separated environment value into unique non-empty items.
Details
string
static string|null
string(string $key, string|null $default = null)
Returns a non-empty scalar environment value as text or the supplied fallback.
int
static int
int(string $key, int $default)
Returns an integer-compatible environment value or the supplied fallback.
float
static float
float(string $key, float $default)
Returns a floating-point-compatible environment value or the supplied fallback.
bool
static bool
bool(string $key, bool $default = false)
Returns a supported boolean environment value or the supplied fallback.
list
static array
list(string $key, array $default = [])
Splits a comma-separated environment value into unique non-empty items.