class ExpressionRequestMatcher extends RequestMatcher

ExpressionRequestMatcher uses an expression to match a Request.

Methods

__construct(string $path = null, string $host = null, $methods = null, $ips = null, array $attributes = [], $schemes = null, int $port = null)

No description

matchScheme(string|string[]|null $scheme)

Adds a check for the HTTP scheme.

matchHost(string|null $regexp)

Adds a check for the URL host name.

matchPort(int $port = null)

Adds a check for the the URL port.

matchPath(string|null $regexp)

Adds a check for the URL path info.

matchIp(string $ip)

Adds a check for the client IP.

matchIps(string|string[]|null $ips)

Adds a check for the client IP.

matchMethod(string|string[]|null $method)

Adds a check for the HTTP method.

matchAttribute(string $key, string $regexp)

Adds a check for request attribute.

bool
matches(Request $request)

Decides whether the rule(s) implemented by the strategy matches the supplied request.

setExpression(ExpressionLanguage $language, $expression)

No description

Details

in RequestMatcher at line 64
__construct(string $path = null, string $host = null, $methods = null, $ips = null, array $attributes = [], $schemes = null, int $port = null)

Parameters

string $path
string $host
$methods
$ips
array $attributes
$schemes
int $port

in RequestMatcher at line 83
matchScheme(string|string[]|null $scheme)

Adds a check for the HTTP scheme.

Parameters

string|string[]|null $scheme An HTTP scheme or an array of HTTP schemes

in RequestMatcher at line 93
matchHost(string|null $regexp)

Adds a check for the URL host name.

Parameters

string|null $regexp A Regexp

in RequestMatcher at line 103
matchPort(int $port = null)

Adds a check for the the URL port.

Parameters

int $port The port number to connect to

in RequestMatcher at line 113
matchPath(string|null $regexp)

Adds a check for the URL path info.

Parameters

string|null $regexp A Regexp

in RequestMatcher at line 123
matchIp(string $ip)

Adds a check for the client IP.

Parameters

string $ip A specific IP address or a range specified using IP/netmask like 192.168.1.0/24

in RequestMatcher at line 133
matchIps(string|string[]|null $ips)

Adds a check for the client IP.

Parameters

string|string[]|null $ips A specific IP address or a range specified using IP/netmask like 192.168.1.0/24

in RequestMatcher at line 143
matchMethod(string|string[]|null $method)

Adds a check for the HTTP method.

Parameters

string|string[]|null $method An HTTP method or an array of HTTP methods

in RequestMatcher at line 154
matchAttribute(string $key, string $regexp)

Adds a check for request attribute.

Parameters

string $key The request attribute name
string $regexp A Regexp

at line 32
bool matches(Request $request)

Decides whether the rule(s) implemented by the strategy matches the supplied request.

Parameters

Request $request

Return Value

bool true if the request matches, false otherwise

at line 26
setExpression(ExpressionLanguage $language, $expression)

Parameters

ExpressionLanguage $language
$expression