class Env (View source)

Class Env

Methods

__construct(string|null $filename = null)

Env constructor.

static void
configure(string|null $filename = null)

Load env file

static void
reset()

Reset the singleton state. Intended for test setup/teardown so a fresh configure() can load a different env file; not meant for production code.

static bool
isLoaded()

No description

static Env
getInstance()

Get the Env instance

static mixed
get(string $key, mixed $default = 'null')

No description

static bool
set(string $key, mixed $value)

No description

static array
all()

No description

static mixed
__callStatic(string $name, array $arguments)

Handle dynamic calls to the class methods.

Details

__construct(string|null $filename = null)

Env constructor.

Parameters

string|null $filename

static void configure(string|null $filename = null)

Load env file

Parameters

string|null $filename

Return Value

void

static void reset()

Reset the singleton state. Intended for test setup/teardown so a fresh configure() can load a different env file; not meant for production code.

Return Value

void

static bool isLoaded()

No description

Return Value

bool

static Env getInstance()

Get the Env instance

Return Value

Env

static mixed get(string $key, mixed $default = 'null')

No description

Parameters

string $key
mixed $default

Return Value

mixed

static bool set(string $key, mixed $value)

No description

Parameters

string $key
mixed $value

Return Value

bool

static array all()

No description

Return Value

array

static mixed __callStatic(string $name, array $arguments)

Handle dynamic calls to the class methods.

Parameters

string $name
array $arguments

Return Value

mixed