RequestMatcher
class RequestMatcher implements RequestMatcherInterface
RequestMatcher compares a pre-defined set of checks against a Request instance.
Methods
__construct(string|null $path = null, string|null $host = null, string|string[]|null $methods = null, string|string[]|null $ips = null, array $attributes = [], string|string[]|null $schemes = 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.
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.
Details
at line 59
__construct(string|null $path = null, string|null $host = null, string|string[]|null $methods = null, string|string[]|null $ips = null, array $attributes = [], string|string[]|null $schemes = null)
at line 77
matchScheme(string|string[]|null $scheme)
Adds a check for the HTTP scheme.
at line 87
matchHost(string|null $regexp)
Adds a check for the URL host name.
at line 97
matchPath(string|null $regexp)
Adds a check for the URL path info.
at line 107
matchIp(string $ip)
Adds a check for the client IP.
at line 117
matchIps(string|string[]|null $ips)
Adds a check for the client IP.
at line 127
matchMethod(string|string[]|null $method)
Adds a check for the HTTP method.
at line 138
matchAttribute(string $key, string $regexp)
Adds a check for request attribute.
at line 146
bool
matches(Request $request)
Decides whether the rule(s) implemented by the strategy matches the supplied request.