pock

RequestMatcherInterface

Contract for reusable request matching rules registered through PockBuilder::addMatcher().

final class InternalRequestMatcher implements RequestMatcherInterface
{
    public function matches(RequestInterface $request): bool
    {
        return 'internal' === $request->getHeaderLine('X-Caller');
    }
}
Tags
category

RequestMatcherInterface

Table of Contents

Methods

matches()  : bool
Return true when the request satisfies this rule.

Methods

matches()

Return true when the request satisfies this rule.

public matches(RequestInterface $request) : bool
Parameters
$request : RequestInterface
Return values
bool
On this page

Search results