RequestMatcher (Component\HttpFoundation)
Symfony\Component\HttpFoundation\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 = array(), string|string[]|null $schemes = null) | ||
matchScheme(string|string[]|null $scheme) Adds a check for the HTTP scheme. | ||
matchHost(string $regexp) Adds a check for the URL host name. | ||
matchPath(string $regexp) Adds a check for the URL path info. | ||
matchIp(string $ip) Adds a check for the client IP. | ||
matchIps(string|string[] $ips) Adds a check for the client IP. | ||
matchMethod(string|string[] $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. |
Details
public __construct(string|null $path = null, string|null $host = null, string|string[]|null $methods = null, string|string[]|null $ips = null, array $attributes = array(), string|string[]|null $schemes = null)
public matchScheme(string|string[]|null $scheme)
Adds a check for the HTTP scheme.
public matchHost(string $regexp)
Adds a check for the URL host name.
public matchPath(string $regexp)
Adds a check for the URL path info.
public matchIp(string $ip)
Adds a check for the client IP.
public matchIps(string|string[] $ips)
Adds a check for the client IP.
public matchMethod(string|string[] $method)
Adds a check for the HTTP method.
public matchAttribute(string $key, string $regexp)
Adds a check for request attribute.
public bool matches(Request $request)
Decides whether the rule(s) implemented by the strategy matches the supplied request.
© 2004–2016 Fabien Potencier
Licensed under the MIT License.
http://api.symfony.com/3.0/Symfony/Component/HttpFoundation/RequestMatcher.html