\Symfony\Component\HttpFoundationRequestMatcher

RequestMatcher compares a pre-defined set of checks against a Request instance.

Summary

Methods
Properties
Constants
__construct()
matchScheme()
matchHost()
matchPort()
matchPath()
matchIp()
matchIps()
matchMethod()
matchAttribute()
matches()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
$path
$host
$port
$methods
$ips
$attributes
$schemes
N/A

Properties

$port

$port : int|null

Type

int|null

$methods

$methods : string[]

Type

string[]

$ips

$ips : string[]

Type

string[]

$attributes

$attributes : array

Type

array

$schemes

$schemes : string[]

Type

string[]

Methods

__construct()

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

Parameters

string $path
string $host
string|string[]|null $methods
string|string[]|null $ips
array $attributes
string|string[]|null $schemes
int $port

Returns

mixed —

matchScheme()

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

Adds a check for the HTTP scheme.

Parameters

string|string[]|null $scheme

An HTTP scheme or an array of HTTP schemes

Returns

mixed —

matchHost()

matchHost(?string  $regexp) : mixed

Adds a check for the URL host name.

Parameters

?string $regexp

Returns

mixed —

matchPort()

matchPort(int|null  $port) : mixed

Adds a check for the the URL port.

Parameters

int|null $port

The port number to connect to

Returns

mixed —

matchPath()

matchPath(?string  $regexp) : mixed

Adds a check for the URL path info.

Parameters

?string $regexp

Returns

mixed —

matchIp()

matchIp(string  $ip) : mixed

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

Returns

mixed —

matchIps()

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

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

Returns

mixed —

matchMethod()

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

Adds a check for the HTTP method.

Parameters

string|string[]|null $method

An HTTP method or an array of HTTP methods

Returns

mixed —

matchAttribute()

matchAttribute(string  $key, string  $regexp) : mixed

Adds a check for request attribute.

Parameters

string $key
string $regexp

Returns

mixed —

matches()

matches(\Symfony\Component\HttpFoundation\Request  $request) : bool

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

Parameters

\Symfony\Component\HttpFoundation\Request $request

Returns

bool —