class EnvironmentBypass implements Bypass (View source)

Allows a bypass for a list of environment types (e.g. DEV, TEST, LIVE)

Methods

public
__construct(string[] ...$environments)

Initialize the bypass with the list of environment types

public
string[]
getEnvironments()

Returns the list of environments

public
$this
setEnvironments(string[] $environments)

Set the list of environments allowing a bypass

public
bool
checkRequestForBypass(HTTPRequest $request)

Checks whether the current environment type in the list of allowed ones

Details

__construct(string[] ...$environments)

Initialize the bypass with the list of environment types

Parameters

string[] ...$environments

string[] getEnvironments()

Returns the list of environments

Return Value

string[]

$this setEnvironments(string[] $environments)

Set the list of environments allowing a bypass

Parameters

string[] $environments

List of environment types

Return Value

$this

bool checkRequestForBypass(HTTPRequest $request)

Checks whether the current environment type in the list of allowed ones

Parameters

HTTPRequest $request

Return Value

bool

True if we can bypass, False if the confirmation is required