CallbackRequestMatcher
in package
implements
RequestMatcherInterface
Delegates request matching to an application callback.
$pock->addMatcher(new CallbackRequestMatcher(static function (RequestInterface $request) {
return $request->hasHeader('X-Signed');
}));
Tags
Table of Contents
Interfaces
- RequestMatcherInterface
- Contract for reusable request matching rules registered through PockBuilder::addMatcher().
Methods
- __construct() : mixed
- CallbackRequestMatcher constructor.
- matches() : bool
- Return true when the request satisfies this rule.
Methods
__construct()
CallbackRequestMatcher constructor.
public
__construct(callable $callback) : mixed
Parameters
- $callback : callable
matches()
Return true when the request satisfies this rule.
public
matches(RequestInterface $request) : bool
Parameters
- $request : RequestInterface