Documentation

RequestMatcher
in package
implements RequestMatcher

FinalYes

A port of the Symfony RequestMatcher for PSR-7.

Tags
author

Fabien Potencier fabien@symfony.com

author

Joel Wurtz joel.wurtz@gmail.com

Table of Contents

Interfaces

RequestMatcher
Match a request.

Properties

$host  : string
$methods  : array<string|int, mixed>
$path  : string
$schemes  : array<string|int, string>

Methods

__construct()  : mixed
The regular expressions used for path or host must be specified without delimiter.
matches()  : bool
Decides whether the rule(s) implemented by the strategy matches the supplied request.

Properties

Methods

__construct()

The regular expressions used for path or host must be specified without delimiter.

public __construct([string|null $path = null ][, string|null $host = null ][, string|array<string|int, string>|null $methods = [] ][, string|array<string|int, string>|null $schemes = [] ]) : mixed

You do not need to escape the forward slash / to match it.

Parameters
$path : string|null = null

Regular expression for the path

$host : string|null = null

Regular expression for the hostname

$methods : string|array<string|int, string>|null = []

Method or list of methods to match

$schemes : string|array<string|int, string>|null = []

Scheme or list of schemes to match (e.g. http or https)

matches()

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

public matches(RequestInterface $request) : bool
APIYes
Parameters
$request : RequestInterface

The PSR7 request to check for a match

Return values
bool

true if the request matches, false otherwise


        
On this page

Search results