Url
class Url implements Rule, Bypass (View source)
A rule to match a particular URL
Traits
Path aware trait for rules and bypasses
Methods
Initialize the rule with the parameters
Add HTTP methods to check against
Returns HTTP methods to be checked
Set the GET parameters null to skip parameter check
Check the request for whether we can bypass the confirmation
Check the request by the rule and return a confirmation item
Details
string
getPath()
Returns the path
$this
setPath(string $path)
Update the path
__construct(string $path, string[]|string|null $httpMethods = null, string[]|null $params = null)
Initialize the rule with the parameters
$this
addHttpMethods(string[] ...$methods)
Add HTTP methods to check against
string[]
getHttpMethods()
Returns HTTP methods to be checked
$this
setParams($params = null)
Set the GET parameters null to skip parameter check
If an array of parameters provided, then URL should contain ALL of them and ONLY them to match. If the values in the list contain strings, those will be checked against parameter values accordingly. Null as a value in the array matches any parameter values.
bool
checkRequestForBypass(HTTPRequest $request)
Check the request for whether we can bypass the confirmation
null|Item
getRequestConfirmationItem(HTTPRequest $request)
Check the request by the rule and return a confirmation item
bool
checkRequest(HTTPRequest $request)
Match the request against the rules