Handle incomplete requests.
More...
|
| __construct (array $options=[], ResponseInterface $response=null) |
|
| __invoke (RequestInterface $request, ResponseInterface $response, $err=null) |
| Handle incomplete requests.
|
|
| setOriginalResponse (ResponseInterface $response=null) |
| Set the original response and response body size for comparison.
|
|
Handle incomplete requests.
__construct |
( |
array |
$options = [] , |
|
|
ResponseInterface |
$response = null |
|
) |
| |
- Parameters
-
array | $options | Options that change default override behavior. |
null | ResponseInterface | $response | Original response, if any. |
__invoke |
( |
RequestInterface |
$request, |
|
|
ResponseInterface |
$response, |
|
|
|
$err = null |
|
) |
| |
Handle incomplete requests.
This handler should only ever be invoked if Next exhausts its stack.
When that happens, one of three possibilities exists:
- If an $err is present, create a 500 status with error details.
- If the instance composes a response, and it differs from the response passed during invocation, return the invocation response; this is indicative of middleware calling $next to allow post-processing of a populated response.
- Otherwise, a 404 status is created.
- Parameters
-
RequestInterface | $request | Request instance. |
ResponseInterface | $response | Response instance. |
mixed | $err | |
- Returns
- ResponseInterface
setOriginalResponse |
( |
ResponseInterface |
$response = null | ) |
|
Set the original response and response body size for comparison.
- Parameters
-
ResponseInterface | $response | |