DefaultHandlerTrait
Default Handler Trait.
Table of Contents
Properties
- $responseFactory : ResponseFactoryInterface
- $streamFactory : StreamFactoryInterface
Methods
- __construct() : mixed
- handle() : ResponseInterface
- Handle a request
Properties
$responseFactory
protected
ResponseFactoryInterface
$responseFactory
$streamFactory
protected
StreamFactoryInterface
$streamFactory
Methods
__construct()
public
__construct(ResponseFactoryInterface $responseFactory, StreamFactoryInterface $streamFactory) : mixed
Parameters
- $responseFactory : ResponseFactoryInterface
- $streamFactory : StreamFactoryInterface
handle()
Handle a request
public
handle(RequestInterface $request) : ResponseInterface
Each middleware will either create a response or return control to the handler.
If the middlewares created no response, the payload handler will.
Finally the we will return a response ourselves.
Parameters
- $request : RequestInterface