\Gishiki\CoreEnvironment

Represents the current execution environment.

Summary

Methods
Properties
Constants
has()
get()
set()
remove()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A

Methods

has()

has(string  $key) : boolean

Check if the current execution environment contains the given entry.

Parameters

string $key

the key to be searched

Throws

\InvalidArgumentException

the given key is not valid

Returns

boolean —

true whether the given key is defined

get()

get(string  $key, mixed  $default = null) : array|false|string

Return the value associated with the given key in the current execution environment.

Parameters

string $key

the key to be read

mixed $default

the default value returned when the key is not found

Throws

\InvalidArgumentException

the given key is not valid

Returns

array|false|string —

the value held by the environment

set()

set(string  $key, string  $value) 

Set in the current execution environment a new value with the given value: create the key if it doesn't exists.

Parameters

string $key

the key to be added

string $value

the value to be associated with the key

Throws

\InvalidArgumentException

the given key is not valid

remove()

remove(string  $key) 

Remove in the current execution environment the given entry.

Parameters

string $key

the key to be removed

Throws

\InvalidArgumentException

the given key is not valid