SymfonyComponentHttpFoundationRequestMatcher

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

Summary

No protected methods found
No protected properties found
N/A
No private methods found
N/A
File
vendorSymfonyComponentHttpFoundationRequestMatcher.php
Package
Default
Class hierarchy
SymfonyComponentHttpFoundationRequestMatcher
Implements
SymfonyComponentHttpFoundationRequestMatcherInterface

Tags

author

Fabien Potencier fabien@symfony.com

api

Properties

$path

$path : string

Type

string

Tags

None found

$host

$host : string

Type

string

Tags

None found

$methods

$methods : array

Type

array

Tags

None found

$ip

$ip : string

Type

string

Tags

None found

$attributes

$attributes : array

Type

array

Tags

None found

Methods

__construct()

__construct(string|null  $path = null, string|null  $host = null, string|array<mixed,string>|null  $methods = null, string|null  $ip = null, array  $attributes = array()) 

Parameters

string|null $path
string|null $host
string|array<mixed,string>|null $methods
string|null $ip
array $attributes

Tags

None found

matchHost()

matchHost(string  $regexp) 

Adds a check for the URL host name.

Parameters

string $regexp

A Regexp

Tags

None found

matchPath()

matchPath(string  $regexp) 

Adds a check for the URL path info.

Parameters

string $regexp

A Regexp

Tags

None found

matchIp()

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

Tags

None found

matchMethod()

matchMethod(string|array<mixed,string>|null  $method) 

Adds a check for the HTTP method.

Parameters

string|array<mixed,string>|null $method

An HTTP method or an array of HTTP methods

Tags

None found

matchAttribute()

matchAttribute(string  $key, string  $regexp) 

Adds a check for request attribute.

Parameters

string $key

The request attribute name

string $regexp

A Regexp

Tags

None found

matches()

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

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

Parameters

SymfonyComponentHttpFoundationRequest $request

The request to check for a match

Returns

Boolean —

true if the request matches, false otherwise

Tags

api