class GetParameter implements Rule, Bypass (View source)

A rule to match a GET parameter within HTTPRequest

Methods

public
__construct(string $name)

Initialize the rule with a parameter name

public
string
getName()

Return the parameter name

public
$this
setName(string $name)

Set the parameter name

protected
buildConfirmationItem(string $token, string $value)

Generates the confirmation item

protected
string
generateToken(string $path, string $value)

Generates the unique token depending on the path and the parameter

protected
bool
checkRequestHasParameter(HTTPRequest $request)

Check request contains the GET parameter

public
bool
checkRequestForBypass(HTTPRequest $request)

Check the request for whether we can bypass the confirmation

public
null|Item
getRequestConfirmationItem(HTTPRequest $request)

Check the request by the rule and return a confirmation item

Details

__construct(string $name)

Initialize the rule with a parameter name

Parameters

string $name

string getName()

Return the parameter name

Return Value

string

$this setName(string $name)

Set the parameter name

Parameters

string $name

Return Value

$this

protected Item buildConfirmationItem(string $token, string $value)

Generates the confirmation item

Parameters

string $token
string $value

Return Value

Item

protected string generateToken(string $path, string $value)

Generates the unique token depending on the path and the parameter

Parameters

string $path

URL path

string $value

The parameter value

Return Value

string

protected bool checkRequestHasParameter(HTTPRequest $request)

Check request contains the GET parameter

Parameters

HTTPRequest $request

Return Value

bool

bool checkRequestForBypass(HTTPRequest $request)

Check the request for whether we can bypass the confirmation

Parameters

HTTPRequest $request

Return Value

bool

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

null|Item getRequestConfirmationItem(HTTPRequest $request)

Check the request by the rule and return a confirmation item

Parameters

HTTPRequest $request

Return Value

null|Item

Confirmation item if necessary to protect the request or null otherwise