class EnvFile extends AbstractObject implements IdAble

A collection of environment variables.

Properties

$lastQuery from  AbstractObject

Methods

__construct(AbstractClient $client, QueryBuilderChain $queryBuilderChain)

No description

null|array|string|int|float|bool
queryLeaf(QueryBuilder $leafQueryBuilder, string $leafKey)

No description

asFile()

Return as a file

bool
exists(string $name)

Check if a variable exists

string
get(string $name, bool|null $raw = null)

Lookup a variable (last occurrence wins) and return its value, or an empty string

id()

A unique identifier for this EnvFile.

namespace(string $prefix)

Filters variables by prefix and removes the pref from keys. Variables without the prefix are excluded. For example, with the prefix "MYAPP" and variables: MY_APP_TOKEN=topsecret MY_APP_NAME=hello FOO=bar the resulting environment will contain: TOKEN=topsecret NAME=hello

array
variables(bool|null $raw = null)

Return all variables

withVariable(string $name, string $value)

Add a variable

withoutVariable(string $name)

Remove all occurrences of the named variable

Details

in AbstractObject at line 13
__construct(AbstractClient $client, QueryBuilderChain $queryBuilderChain)

No description

Parameters

AbstractClient $client
QueryBuilderChain $queryBuilderChain

in AbstractObject at line 19
protected null|array|string|int|float|bool queryLeaf(QueryBuilder $leafQueryBuilder, string $leafKey)

No description

Parameters

QueryBuilder $leafQueryBuilder
string $leafKey

Return Value

null|array|string|int|float|bool

at line 19
File asFile()

Return as a file

Return Value

File

at line 28
bool exists(string $name)

Check if a variable exists

Parameters

string $name

Return Value

bool

at line 38
string get(string $name, bool|null $raw = null)

Lookup a variable (last occurrence wins) and return its value, or an empty string

Parameters

string $name
bool|null $raw

Return Value

string

at line 51
AbstractId id()

A unique identifier for this EnvFile.

Return Value

AbstractId

at line 60
EnvFile namespace(string $prefix)

Filters variables by prefix and removes the pref from keys. Variables without the prefix are excluded. For example, with the prefix "MYAPP" and variables: MY_APP_TOKEN=topsecret MY_APP_NAME=hello FOO=bar the resulting environment will contain: TOKEN=topsecret NAME=hello

Parameters

string $prefix

Return Value

EnvFile

at line 70
array variables(bool|null $raw = null)

Return all variables

Parameters

bool|null $raw

Return Value

array

at line 82
EnvFile withVariable(string $name, string $value)

Add a variable

Parameters

string $name
string $value

Return Value

EnvFile

at line 93
EnvFile withoutVariable(string $name)

Remove all occurrences of the named variable

Parameters

string $name

Return Value

EnvFile