CallableMiddleware
in package
implements
MiddlewareInterface
Adapts a plain callable into a MiddlewareInterface, so Client::addMiddleware() can accept a closure directly instead of requiring a full class
Tags
Table of Contents
Interfaces
- MiddlewareInterface
- Client middleware interface - a PSR-15-style interceptor for Client's outbound dispatch. Not a literal PSR-15 implementation: PSR-15's real interfaces are typed to ServerRequestInterface (server-side only) and cannot apply to a Client's outbound RequestInterface flow, so this mirrors PSR-15's shape with the request type swapped.
Properties
- $callable : callable
- The wrapped callable
Methods
- __construct() : mixed
- Constructor
- process() : ResponseInterface
- Process the request by delegating to the wrapped callable
Properties
$callable
The wrapped callable
protected
callable
$callable
Methods
__construct()
Constructor
public
__construct(callable $callable) : mixed
Parameters
- $callable : callable
process()
Process the request by delegating to the wrapped callable
public
process(RequestInterface $request, RequestHandlerInterface $handler) : ResponseInterface
Parameters
- $request : RequestInterface
- $handler : RequestHandlerInterface